How CamChess Works
CamChess uses OpenCV and Numpy to analyse images of the chess board. It uses python-chess for its chess related processing. After taking its first picture of the board, CamChess needs to recognise the board and find its four corners. OpenCV has a very helpful function called findChessboardCorners . Its main use appears to be for identifying checker board patterns for calibrating lenses, but it serves our purpose. It finds the inner corners of the chess board. Unfortunately, it does not return them in a consistent order for different images, but this problem is easily side stepped, as we shall see. The 49 inner corners are shown in red and blue above. We are particularly interested in the red corners. If we have the coordinates of the red corners, we can easily find approximate coordinates for the outer corners of the chess board (shown in green). We can do this by simple proportion along the two long diagonals. We can find the coordinates of the top-left and bottom right inner corne...