How to recognise images in other windows - card games

Discussion in 'Mac Programming' started by jimbojammy85, Dec 16, 2015.

  1. jimbojammy85 macrumors newbie

    Joined:
    Dec 16, 2015
    #1
    Hi All!

    Im hoping anyone might be able to point me in the right direction for a poker math program I am writing please...

    Basically, when we play poker online, I am writing an application to automatically calculate pot and card odds and probabilities.

    The game logic I have written, however, I cannot figure out how to make my app recognise images of the cards on my poker window.

    I was initially thinking to get my app to screenshot an image of the window and then compare the cards images with a picture of a spade, diamond, heart and club - but Im not even sure how to do this.

    Would anyone have any suggestions please?
    Thanks,
    J
     
  2. teagls macrumors regular

    Joined:
    May 16, 2013
    #2
    What you are trying to do is image matching. Use OpenCV. There are lots of ways to do the image analysis. Histogram matching is a very straight forward and easy thing to do. You take a histogram of the color intensities of a known image like spade and then compare it to what you are trying to match.

    The other more robust option is using SIFT or Scale-Invariant Feature Transform. This is fully supported in OpenCV and fairly easy to do.

    http://docs.opencv.org/master/da/df5/tutorial_py_sift_intro.html#gsc.tab=0
     

Share This Page