Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jimbojammy85

macrumors newbie
Original poster
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
 
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.