Sudoku Image Solver
Overview
This is a program that attempts to solve Sudoku puzzles that have been extacted from an image.
How it works
Through various image processing techniques combined with optical character recognition (OCR) this program will try to extract the digits from a Sudoku puzzle. Once the digits are extracted, it will attempt to solve it. The process works as follows:
- Find the main grid for the puzzle
- Find the four corners associated with this grid
- Perform a homology to extract just the puzzle from the image
- Perform a form of thresholding if necessary
- Extract each cell from the puzzle
- Perform OCR to determine the digits
- Solve the puzzle
What is included
- Test data to train a support vector machine used for optical character recognition
- Various test puzzles with the ground truth values used for comparison.
Required libraries
- OpenCV
- Numpy
- PyLab
- LibSVM
- Python Imaging Library (PIL)
- Scipy
Execution
To run the program:
type python imsudoku.py
Results
The average accuracy of extracting the initial digits was 86%.