5. The software for move recognition

After the player has made their move, the camera takes a photo. The code crops and rotates this so that the chessboard exactly fits the subsequent image.

The chessboard squares need to look square!. There is distortion in the image because the edges of the board are further away from the camera than the centre of the board is. However, the camera is far enough away so that, after cropping, this distortion is not significant.

Because the robot knows where all the pieces are after the computer move, then all that has to be done after the human makes a move is for the code to be able to tell the difference between the following three cases:

  • An empty square 
  • A black piece of any kind 
  • A white piece of any kind
This covers all cases, including castling and en passant.

The robot checks that the human's move is correct, and informs them if it isn't!

The only case not covered is where the human player promotes a pawn into a non-queen. The player has then to tell the robot what the promoted piece is.

For more info, see page 7 - The VISION Software.

No comments:

Post a Comment

Intro

I have built a chess robot using Lego and Raspberry Pi . I have placed an improved description of the robot at  Chess Robot Made With LEGO...