Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pokerbot doesnt read my cards well (example it sees a 7d instead of 8d) #194

Open
Slimbips opened this issue Aug 3, 2023 · 2 comments
Open

Comments

@Slimbips
Copy link

Slimbips commented Aug 3, 2023

Describe the bug
The bot cant read my hand well, while the search area and left and right cards are good and clear images.

Screenshot png file from the log\screenshots folder
ss of my table:
ss1

ss of my cards area:
sscardsarea

my left card:
leftcard

right card:
rightcard

Log information
INFO - Convert to Qpixmap
INFO - Update preview label
WARNING - AutoGraph is not available in this environment: functions lack code information. This is typical of some environments like the interactive Python shell. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/autograph/g3doc/reference/limitations.md#access-to-source-code for more information.
INFO - Downloading neural network weights for card recognition with tolerance...
INFO - Download complete
INFO - Is it my turn? True
1/1 [==============================] - 0s 173ms/step
1/1 [==============================] - 0s 12ms/step
INFO - My cards: ['JS', '7D']
INFO - My cards: ['JS', '7D']
Traceback (most recent call last):
File "poker\tools\screen_operations.py", line 251, in is_template_in_search_area
File "poker\tools\screen_operations.py", line 235, in check_if_image_in_range
File "poker\tools\screen_operations.py", line 33, in find_template_on_screen
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1175: error: (-215:Assertion failed) _img.size().height <= _templ.size().height && _img.size().width <= _templ.size().width in function 'cv::matchTemplate'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "poker\scraper\table_setup_actions_and_signals.py", line 71, in
File "poker\scraper\table_setup_actions_and_signals.py", line 586, in test_all
File "poker\scraper\table_scraper.py", line 115, in get_table_cards2
File "poker\tools\screen_operations.py", line 260, in is_template_in_search_area
RuntimeError: Search area for 8d None is too small. It is 354x57 but the template is 96x78.

Greets Slim

@dickreuter
Copy link
Owner

I see, can you give me the name of the table you used for mapping?

I think you might be able to significantly improve the results if you limit the left and right card to a smaller area, so that just the J (and suit below) is visible, same for the right card. There should definitely be nothing visible of the background behind the card.

Let me know if this helps.

@Slimbips
Copy link
Author

Slimbips commented Aug 3, 2023

the name of table i used is GGpoker v5

limitting like said i did like 100 times also with no succes..... but now i tried again and it sees my card.

ss of left card:
working j

ss of right card:
working 8

LOG:

INFO - Downloading neural network weights for card recognition with tolerance...
INFO - Download complete
INFO - Is it my turn? True
1/1 [==============================] - 0s 172ms/step
1/1 [==============================] - 0s 13ms/step
INFO - My cards: ['JS', '8D']
INFO - My cards: ['JS', '8D']
Traceback (most recent call last):
File "poker\tools\screen_operations.py", line 251, in is_template_in_search_area
File "poker\tools\screen_operations.py", line 235, in check_if_image_in_range
File "poker\tools\screen_operations.py", line 33, in find_template_on_screen
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1175: error: (-215:Assertion failed) _img.size().height <= _templ.size().height && _img.size().width <= _templ.size().width in function 'cv::matchTemplate'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "poker\scraper\table_setup_actions_and_signals.py", line 71, in
File "poker\scraper\table_setup_actions_and_signals.py", line 586, in test_all
File "poker\scraper\table_scraper.py", line 115, in get_table_cards2
File "poker\tools\screen_operations.py", line 260, in is_template_in_search_area
RuntimeError: Search area for 8d None is too small. It is 354x57 but the template is 96x78.

tested it with other cards and seems to work now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants