dickreuter / Poker

Fully functional Pokerbot that works on PartyPoker, PokerStars and GGPoker, scraping tables with Open-CV (adaptable via gui) or neural network and making decisions based on a genetic algorithm and montecarlo simulation for poker equity calculation. Binaries can be downloaded with this link:
http://www.deepermind-pokerbot.com
GNU General Public License v3.0
2.01k stars 506 forks source link

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

Open Slimbips opened 1 year ago

Slimbips commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 :)