← Back to team overview

sikuli-driver team mailing list archive

[Question #233608]: Efficiency for Chess

 

New question #233608 on Sikuli:
https://answers.launchpad.net/sikuli/+question/233608

I am experimenting with standalone JAVA Sikuli to do chess board piece recognition. I am using an HD web camera directly above a chess board with fixed lighting. The purpose of this program is to always output to the user the state of the board by means of an NxN matrix. 0 would indicate an empty square. RNQKBP would inidicate one of the given pieces. My theoretical tasks and questions are as follows:

Tasks: 
1.) Take image of entire chessboard with pieces in starting position and put into some kind of buffer
2.) find board corners and set as region, or set region manually, divide that resulting square-shaped image into an 8x8 grid
3.) store grid images of chess pieces per black and white sides
4.) by method of comparison, detect changes of board state
5.) if a change was detected, update "OverLord" class that manages the state of the game after every detected move 
6.) repeat until checkmate

Problems:
1.) How can sikuli differentiate between a white piece on a white square & black square? This will confuse it undoubtedly.
2.) Is there a faster way of knowing what pieces are on the board other than doing a full board scan for all known piece types? I am trying to capture and process information as close to real-time as possible. Delays are critical to eliminate. 
3.) What is the best way to "slice" an image into 64 parts (grid cells)? Should I use the sikuli subImage() method?
4.) Any other ideas to make recognition less CPU taxing and faster? 

THANK YOU!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.