I recently moved to Barcelona to start working in here. Although I’m not working in any computer-vision based project, I still keep a high interest in this field, trying to conduct as many personal projects as possible. My work team is highly motivated and full of professionals, and we all keep our personal projects besides our work.
Recently I met Fegabe in Barcelona, who’s a member of the GTUG Barcelona core team and an Android Developer. We decided to start together a Sudoku Solver for Android. Although there are already many of them published in the Market, we just wanted to do it for fun and to get a bit deeper into computer vision and pattern recognition. There is an OpenCV port for Android, but we decided to keep our implementation pure Java.
The following steps are applied in order to capture, detect and solve the Sudoku:
-The user must take a picture of the Sudoku using the camera of the device.
-After the picture is taken, a Threshold is applied to the image, so we can get a black and white version. Of course, there is some preprocessing involved. Things like smoothing out noise, some morphological operations, etc.
-When the picture has been taken, we apply a blob detection in order to detect the biggest segment of the image. We work under the assumption that this segment will be the outer line of the Sudoku table.
-Afterwards, we can use the Hough transform to get lines in the image. It returns lines in mathematical terms. So after this step, we’ll know exactly where a lines lies… and not just the pixels where it lies.
-When the lines has been detected, it will be easier to locate each individual cell. The number inside will be recognized using a neural network.
-The last step is the easiest: we just solve the sudoku by using any of all the known algorithms
I shared the project with a GPL license in Google Code. All the technical information can be found there, besides the source code and a binary file for Android. If you wanna try out, I would highly appreciate any feedback