Skip to main content
  • Internship report
  • Research

Internship report: solving a game of Qwirkle with Custom Vision & OpenCV

An internship project using Azure Custom Vision and OpenCV to detect Qwirkle tiles and calculate the optimal next move in real time.

Jul 2, 2021By Evi Leroy, VIVES Hogeschool
Qwirkle tiles on a table

This 50-day internship project investigated using artificial intelligence to determine optimal moves in the board game Qwirkle, combining computer vision technologies with game logic algorithms.

01

Colour and shape detection

Rather than training Custom Vision to identify colour-shape combinations separately, the team used pixel analysis at bounding box centres, converting RGB values to HSV colour space for accurate colour determination independent of lighting conditions.

Custom Vision was trained on six shape categories using approximately 53 photos per classification, achieving reliable performance through variable-distance training samples.

02

Perspective correction and preprocessing

OpenCV handled perspective correction before Custom Vision analysis. The preprocessing pipeline included edge detection, contour analysis, and Hough line detection to orient game boards correctly for recognition.

Qwirkle tiles recognised on the board
03

Brute-force optimisation for maximum points

A brute-force algorithm evaluated all possible tile placements, scoring combinations based on Qwirkle's point system and identifying sequences yielding maximum points. The three-phase methodology, research, training, and implementation, demonstrated how Custom Vision API and OpenCV can work together for practical game-solving applications.

Want to work together

Project in mind?

Start with a conversation, or with the readiness check. Either way, you talk to the people who build it.