SolveSudoku extract and solve sudoku from image. It uses a collection of basic image processing techniques and CNN for training and recognition of characters. CNN is trained on MNIST dataset.
How to use
git clone https://github.com/aakashjhawar/SolveSudoku.git
cd SolveSudoku
python3 sudoku.py <path/to/input_image>
- Python 3.5
- OpenCV
sudo apt-get install python-opencv
- Image preprocessing (Thresholding).
- Find the largest contour (sudoku square).
- Get the cordinates of largest contour.
- Crop the image.
- Perform Warp perspective on image
- Extract each cells from the image by slicing the sudoku grid.
- Extract the largest component in the sudoku image (number).
- Remove noise in block.
- Send the number to pre trained Digit Recogition model.
- Send the grid to Sudoku Solver to perform the final step.