How to recognise images in other windows - card games

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

  1. jimbojammy85 macrumors newbie

    Dec 16, 2015
    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?
  2. teagls macrumors regular

    May 16, 2013
    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.

Share This Page