karayaman / lichess-with-a-real-board

Lichess.org client for real life chess boards.
GNU General Public License v3.0
108 stars 7 forks source link

Using chess board with classic colors #3

Open Kacnep87 opened 2 years ago

Kacnep87 commented 2 years ago

Hi, Alper. Thank you once again for the great app and opportunity to play online chess without buying DGT Chess Board. I have regular classic chess board. Problem is that, what i can't use that in your software. When i use only my table lightning lamp and launch board calibration proccess i see only my chess board without coordinates, but there must be seen coordinates too. But when i use light falling on a chessboard from a lamp on the ceiling i see my chess board without coordinates, but there must be seen coordinates too. And the last option, when i use lightning from the street only, it works like it must be, i mean i see my chess board and coordinates and can rotate image with r button. What i do wrong and how to fix this problem, because i want to play on this board using light from table or ceiling lamp?

https://imageup.ru/img288/3962824/ceiling-lamp.jpg.html

https://imageup.ru/img247/3962825/table-lamp.jpg.html

https://imageup.ru/img91/3962827/street-lightning.jpg.html

P.S. Using modified chess table like in my last videos on youtube https://www.youtube.com/watch?v=W0mohAhS4hI&list=PLCe-Dywn_53tC_ntZLbGo6vKnWaw3lyXn&index=2 is working very good.

KasperDeBlieck commented 1 year ago

Hi Alper,

I have a similar issue. When I try to use the application app with my traveling chess set, it works great. The traveling set has a high contrast between light and dark squares, and the squares are evenly filled with 1 color. However, when trying to do the same with a more classic chess board with less contrast between light and dark squares and a wooden print, I cannot get the calibration to work.

The cv2 library doesn't seem to recognize the chessboard using the settings applied here. I tried playing around with the configuration (including preprocessing the image), but didn't manage to make it work with a chess board with a wooden print. I'll let you know and create a PR if I happen to find something that's robust in all situations, as other people might encounter the issue as well.

karayaman commented 3 weeks ago

Hi, to address this issue, I've developed a new board calibration mode based on machine learning that calibrates while the pieces are in their starting positions. Since it leverages machine learning, it can support a wider range of chess boards.