The method you describe.Why not roll your own?
1/ Scan the image looking for white-ish pixels (ie playing card background)
2/ Scan down from those pixels and count how many contiguous white-ish you have, to get an idea of the size of the card
3/ For plausible run lengths (eg the large cards in your example are 62 pixels tall, and the small cards are 50 pixels tall, so let's say anything in the range 40-to-90 pixels)
3a/ Scan left from the vertical middle of the run, until you hit a non-white-ish pixel, so that we now know where the top, bottom and left of the card are
4/ Probe a grid of pixels across the expected card area for white, red or black pixels, and compare them to what you'd expect for each of the 52 possible cards (plus jokers?)
bonus 1: it looks like you don't have to scan the whole image, because cards only appear in eg 7 areas above (6 players plus 1 dealer) and we don't need to check the corners, or the areas to the left of the players at the top and bottom
bonus 2: once you've located a card, you don't need to scan the rest of that area of the card
thought: the scan for "white-ish" pixels might be better done for "white-to-reddish or white-to-blackish" pixels ie if you have green or blue or yellow or any other hue that isn't red or black or white, then pixel isn't part of a card
thought: best to identify using left-third of card only, thanks to the sometimes overlaying by other cards
edit: hang on, you can only see your own cards and the dealer's cards, right? Not the other players? So now there are only two areas we need to scan. Bonus!!!
The method you describe.
Is it SIFT (Scale Invariant Feature Transformation)?
3/ For plausible run lengths (eg the large cards in your example are 62 pixels tall, and the small cards are 50 pixels tall, so let's say anything in the range 40-to-90 pixels)
3a/ Scan left from the vertical middle of the run, until you hit a non-white-ish pixel, so that we now know where the top, bottom and left of the card are
4/ Probe a grid of pixels across the expected card area for white, red or black pixels, and compare them to what you'd expect for each of the 52 possible cards (plus jokers?)
1) I must say that i don't know poker or any game it is... but i like the "concept"
2) You can grab only this region:
View attachment 135041
3) Give a try to tesseract-ocr to read/get it like this: "8 9 10 6 7"... so with regex.split you will split at an array int...
4) You can getpixel-color with specific distance from this image to take the color of cards... "or" check/recognize for those symbols too: ---> so you will get an array with those too...
View attachment 135042
Hi there... I don't remember if it is possible to train it with default pictures...View attachment 135424
I've tried things like that and the results are bad.
Even when I "clean" the image, leaving only the value of the cards, the result is very erratic.
My best result was reading letter by letter, even so there are many errors.
OCR is what I'm currently using, however when the screen size gets smaller it's a nightmare.
How did you get this results?
And how can I teach the application the cards value?
...hmm do you get always the same results for the cards from tesseract..View attachment 135424
I've tried things like that and the results are bad.
Even when I "clean" the image, leaving only the value of the cards, the result is very erratic.
My best result was reading letter by letter, even so there are many errors.
That's what I did....hmm do you get always the same results for the cards from tesseract..
For example if 19 is 9.. always replace the string with 9...
If [0 is 10... replace with 10
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?