This is a program that attempts to solve Sudoku puzzles that have been extacted from an image.
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
- Test data to train a support vector machine used for optical character recognition
- Various test puzzles with the ground truth values used for comparison.
- OpenCV
- OpenCV
- Numpy
- PyLab
- LibSVM
- Python Imaging Library (PIL)
- Scipy
To run the program:
type python imsudoku.py
The average accuracy of extracting the initial digits was 86%.