Haha, sure. Since this was a random fun project, the code was written with the objective function being "least amount of code to get the job done well enough" :)
As it should! Too often I get stuck in a rut, inspired by the myriad of articles I read about certain patterns and libraries, that I take too long to get a simple task done with my head in the wrong space. Good work! You can't refactor code you've haven't written.
I love this...I play around with OpenCV as much as a Rubyist can (with our kind-of-maintained wrapper) and would learn Python just to make better use of OpenCV...I don't know if what OP is doing is the most efficient way computationally, but it sure is clever, at least for me :)
For instance, recognizing the cards in an image...my first approach would've been to try to identify the numbers/letters of the cards...which would've been just stupid...but the OP's strategy of using findContours and simply choosing the four largest rectangles is elegant...in the way that OpenCV is so powerful you can problem-solve at a fairly high level.
For a more robust image registration, SIFT [1] could have been used too. SIFT is nothing short of amazing, capable of matching images under different rotations and scales. I'm pretty sure OpenCV has good support for it.
I have not, but I'm working on a project where I will use it to extract features from an image and use it to register two point clouds. There are many other algorithms for doing the same thing, but I have read that SIFT is very robust.
This is rather interesting. Have you thought about the conflict of interest between Google Glass and casinos? Very soon you won't need to count cards anymore; you can just walk in with your glasses on and OpenCV recognition.
Heck, you may not even need OpenCV. Just livestream, and let somebody far away tell you the probabilities..
Very soon they'll be banning Google Glasses from Las Vegas. Or any glasses, for that matter.
I wonder if casinos will start banning people from wearing Glass. I guess you could write some CV software to keep track of cards and then automatically display your probabilities, kind of like the graphics they show on TV when broadcasting poker.
There's going to be a problem when technology reaches the point that it's practical to embed a general-purpose computer with a decent neural interface in your skull.
It's been done, albeit a bit simpler, to cheat/assist in collusion in online poker.
You don't have an API (for obvious reasons) into the poker clients, so you have software that basically reads the screen as an image and works the keyboard/mouse.... the more sophisticated ones do it in a VM to avoid detection (some poker software actively scans your machine for known bot software or other tampering)
Very nice. Many years ago I built a machine vision system to inspect Playskool ABC blocks with the same method. I added some erosion to the images of the parts and some dilation to the template images. That way there's a little wiggle room to account for different temperatures of the branding iron and the press that made the embossed letters.
The thing worked pretty well, unfortunately production moved overseas and the company that made the blocks is gone now.
Awesome, reminds me I really need to port my C#+EmguCV (https://github.com/yol/SetVision) program to play Set to Python.
Its funny that recognizing the cards in Set is easy for humans and the combinatoric stuff hard, while for computers, it's exactly opposite.