"For example, the program is able to determine whether each square is white or black by calculating its average color and comparing it to the black and white colors" I bet you could get away with determining the color of a corner square and assuming the rest.
Thanks for the feedback. I did not think about this. Some of the square edges actually belongs to the surroundings squares because the cut is not 100% accurate and the chess piece are not always position at the center of the square but I could get around that. The way this algorithm works is simple. I compare the RGB values for each pixel of a square to the black color and white color. Black is Red=0, Green=0, Blue=0…
Show HN: My weekend project - Chessboard picture recognition
41–50 of 57 posts
Re: Show HN: My weekend project - Chessboard picture recognition
#42For figuring out chess pieces, maybe determining the light source and looking for light/dark patterns in certain areas? The problem is, from top view, even a human would have a difficult time figuring out if a piece was a bishop or pawn.
This is true. I may need to work on a collection of pictures or even a video.
Re: Show HN: My weekend project - Chessboard picture recognition
#43Hmm, interesting project. If you're ok with helping the computer out a bit, you could put a very small matrix bar code (think QR Code) on top of each piece. Since there are 6 chess pieces and 2 colors, you could have a code for each piece in just a 2x2 matrix (4 dots / bits). Otherwise, it seems like it may be very difficult, as I'm not even sure of what some of the black on black pieces are myself (bottom right).
If you want only to modify the chessmen and not the board then I'm sure some transponder could be fitted and the table could have 3 receivers removably fixed to it that could triangulate their positions.
If it has to be camera based but you're going to modify them men could you just give them all different coloured hats.
Re: Show HN: My weekend project - Chessboard picture recognition
#44Re: Show HN: My weekend project - Chessboard picture recognition
#45You might look into the academic literature for OCR, which this will reduce to. (Most AI problems are "How can I apply human intelligence to cleverly reduce this problem from something which appears to require intelligence to something which actually only requires well-understood math?") I think the punchline is likely to be that you end up taking dot products of feature vectors generated by library code and writing…
Re: Show HN: My weekend project - Chessboard picture recognition
#46similar successful project of a robot playing chess naturally: http://www.youtube.com/watch?v=OZ0Hx04KFCg
Re: Show HN: My weekend project - Chessboard picture recognition
#47Here is a related project on turning an image of a Go board into a computer readable file understood by most GUIs for playing Go: http://www.inference.phy.cam.ac.uk/cjb/image2sgf.html
Re: Show HN: My weekend project - Chessboard picture recognition
#48I don't know anything about "chess theory" but are there some squares that only certain pieces can get to? I don't think it's possible for a Knight to ever be on some squares, so maybe you could use logic like that to narrow down the piece detection. It may be easier to just track the game state from the start instead of trying to identify the position of the board at a random snapshot in time. Cool project though, s…
The only thing I can think of is that pawns cannot be in the first rank nor the last rank.
Re: Show HN: My weekend project - Chessboard picture recognition
#49Earlier quoted context omitted.
Nor will you ever find both bishops of one color on the same color square.
You have to be careful there, you can only make that assertion if you can prove that no pawn has been promoted to a bishop (eg if all 8 pawns are still on the board, or 7 pawns and 2 queens etc).
Re: Show HN: My weekend project - Chessboard picture recognition
#50Earlier quoted context omitted.
Nor will you ever find both bishops of one color on the same color square.
You have to be careful there, you can only make that assertion if you can prove that no pawn has been promoted to a bishop (eg if all 8 pawns are still on the board, or 7 pawns and 2 queens etc).