Skip to content

Failing to identify chess boards #15

@rokopi

Description

@rokopi

Hi Sebastian,

I want to start by saying that I really am enjoying working with this project!

I've managed to get the program to run on Win64, but it is really struggling to find chessboards. With mss 4.0.3 I get an error:

Exception in Tkinter callback
Traceback (most recent call last):
File "F:\ProgramData\Anaconda3\lib\tkinter_init_.py", line 1705, in call
return self.func(*args)
File "F:\ChessVisionBot\code\main.py", line 77, in start_playing
resized_chessboard = chessboard_detection.get_chessboard(game_state)
File "F:\ChessVisionBot\code\chessboard_detection.py", line 113, in get_chessboard
img = np.array(sct.grab(monitor))
File "F:\ProgramData\Anaconda3\Lib\site-packages\mss\base.py", line 88, in grab
return self._grab_impl(monitor)
File "F:\ProgramData\Anaconda3\Lib\site-packages\mss\windows.py", line 262, in _grab_impl
self._bmi.bmiHeader.biWidth = width
TypeError: int expected instead of float

I tried forcing x1, x2, y1, y2 to be int, but that causes the system to find invalid chessboards:

resized_chessboard

which then lead to bad FEN strings and cause the chess engine to crash.

I would really appreciate any help you can offer here! I'm hoping it might be something simple like a missing package, but I'm not sure where to look at this point.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions