1

I'm trying to take an ongoing chess game and use image recognition to automatically transcribe it into a list of chess moves (1. e4 e5 2. Nf3 Nc6), automatically.

Given a 2D layout of the board and pieces, and standard images for each of the pieces, how would I go about in Java doing this?

Thanks!

5
  • I made the assumption that you were transcribing an entire game, where the starting position of every piece is known. I realise now that this may not be the case. Are you likely to be wanting to transcribe partial games where the initial state of the board needs to be established first? Commented Nov 12, 2010 at 8:57
  • When a white pawn resides on e4 and a black one on e5, how would you know that the position is established by 1. e2e4 e7e5 or by 1. e2e3 e7e6 2. e3e4 e6e5? Commented Nov 12, 2010 at 9:03
  • I'm looking for a way to use some image recognition (this is just a side project I've found myself thinking about) Commented Nov 12, 2010 at 9:04
  • @Bart - It wouldn't matter if I started with a pawn on e4 and a pawn on e5 -- I'd just start transcribing the moves after. Otherwise, my program should be able to detect the incremental change. Commented Nov 12, 2010 at 9:05
  • another question springs to mind: does the image only contain the board, and if so, is the boundary of the image the boundary of the board, or do you have to "find" the board as well? If you could stick a sample image into the question it would really help. Commented Nov 15, 2010 at 10:54

3 Answers 3

1

I would imagine that depending on the set being played with, given a top down view of the board, it might prove difficult to distinguish between the different pieces.

Rather than relying on image recognition to determine which pieces are which, it would almost certainly be easier to simply track the pieces throughout the course of the game. You already know exactly where they started from, so after each turn it should be possible to deduce which square is now empty that wasn't previously empty, and which square is now occupied that wasn't previously occupied. This makes your image analysis much simpler as you're just determining whether each square on the board is empty or not.

Sign up to request clarification or add additional context in comments.

2 Comments

Assume the set is a 2D board on the computer, as simple an image as can be -- it could even be K for king, etc.
@Michael: aah ok, I was thinking you were planning on using photographs :-) my above answer still stands as a simpler approach to tracking a game as it develops, the tough bit is going to be establishing the initial board state for partial games.
0

Well if you have an image for each piece than just follow and save(using some arrays) all the moves. But first show us some code on what you have. More info.

Comments

0

For image classification in JAVA you can try Rapidminer and IMMI extension for image mining: http://spl.utko.feec.vutbr.cz/en/component/content/article/46-image-processing-extension-for-rapidminer-5

For this purpose you should extract global features from images and than train some classifier (e.g. SVM). Another approach might be training Viola-Jones detector.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.