Blitz chess can be extremely fast. Each player typically only has a couple of seconds to think and then execute a move. That speed makes it impossible for the players to log the moves. Still, there are entire blitz chess tournaments of which you’d like to record hundreds of games.
One way to avoid logging the moves is to use a “digital” chess board. However, these are expensive and typically have a hard time keeping up with the speed at which the moves occur. Especially, towards the end of a game, when the players are in time trouble, moves come thick and fast and players become sloppy, not placing their pieces neatly on the board (even knocking them over), the digital boards often misinterpret the moves made.
I’d like to observe the chess board with a standard webcam and reconstruct the moves (and the move times) from the video feed.
I believe this can be done as follows:
- Detect the board, the pieces and the clock using YOLO.
- Detect that the board has changed. When it has changed, make a best guess of the current position of the pieces on the board. Log the time.
- Once the game has finished, do an error correction pass. From time to time, a board position will be mis-registered. From the starting position, reconstruct the moves played. When you run into an impossible position, drop it and try to reconstruct what happened by analyzing the subsequent board positions. (Typically, a move will not have been registered correctly or a piece will not be identified correctly).
- Once a legal sequence of moves has been reconstructed, store it as a PGN (Portable Game Notation).
So, the challenge here is being able to keep up with the speed of the players.
Plan:
Week 1.: Detect board, pieces and clock
Week 2.: Detect moves. Start very slow and correct. Speed-up to stress the system.
Week 3.: Write code to reconstruct and error correct the moves.
Week 4.: Clean up and submit
