Our new challenge is to write a program that successfully plays the card game “Spot-It“.
There are several variations on the game, but the basic Spot-It mechanic is this:
- Two circular cards are turned over.
- Every pair of cards has precisely one symbol in common.
- The first player to point out the common symbol wins the round.
Here is a sample pair of Spot-It cards:
In this example, the common symbol is a 4-leaf clover.
Assume the cards will be laid out side by side, like in the above photo. Split the input image in half, assuming one card on the left side, and one card on the right. That way you can use the above photo to develop your algorithm, and then test it with a camera pointed at two real cards.
How to Match Symbols
There are a number of different ways to match symbols.
- Identify and extract the features for each card, and then find the areas on each card match features for each
- Extract the contours for each symbol, compute the moments for each contour, and then find the contours with the closest moments. The OpenCV call matchShapes might come in handy.
I’ll be focusing on the feature-based approach here. I’ll post more here later as I work on my solution.
Update: Several members of the meet up have done some amazing things with this.
Soheil Eizadi has solved the problem for the sample image. His code is available at: https://github.com/seizadi/spotit
JJ Stiff has gotten really nice outlines of the images. His code is available at: