Hexa Tick Tack Toe

Image 1

Image 2

Place the playing board somewhere on a wall (in the reaching distance of the robot), take turns and try to win the game

How does it work

I am using OpenCV in order to process the image and get bounding boxes for the game board itself and also for each of the smaller 9 squares (where X or 0 would be written).

In more details, the image processing pipeline looks like this:

  1. Inverting pixels
  2. Applying threshold
  3. Computing contours
  4. Filtering contours

Approximating the contours (to remove extra edges)

Keeping only the contours that have 4 edges

Looking for a bigger contour that includes 9 sub contours (game board with all the 9 smaller squares)

  1. Iterating through contours and looking at the pixels colors to determine if a square is empty, contains and X or 0 (the robot and the player are going to use different colors)

Robot writing

I have mounted a marker on the robot’s head and using a built-in distance sensor it will approach the wall until the tip of the marker touches it, and then it nods its head or tilts its body to make an X

Problem: the distance to the wall must be very precise, otherwise the marker would just bend

Technologies used

  • GO
  • OpenCV

Github

Project link

The Project was realized in the 3rd year of University