Skip to content

Latest commit

 

History

History

doublegame

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Double game

License: MIT openCV version
A program to find the common element on the double's game

How to use

You need the non free algorithms of openCV, so I compile it from source with this command:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D OPENCV_GENERATE_PKGCONFIG=ON \
      -D OPENCV_ENABLE_NONFREE=ON \
      -D OPENCV_EXTRA_MODULES_PATH=~/opencv_src/opencv_contrib/modules ../opencv

Test the detection of the common element:

python3 doublegame.py test/card_06.png

You will obtain something like this:
result

How it works

  • Read image
  • Transform into grayscale
  • Detect the cards (circles)
  • Extract the cards for an image without background
  • Apply a threshold for the contours detection
  • Make a FLANN matching between each card to find the macthing points
  • For each match, retrieve the corresponding contour to draw the bounding rect

processing