based on SolveSudoku
SolveSudoku extract and solve sudoku from image. It uses a collection of image processing techniques and Convolution Neural Network for training and recognition of characters. CNN is trained on MNIST dataset to detect digits.
Checkout the articles on SolveSudoku on Medium.com
Sudoku Solver using OpenCV and DL — Part 1
Sudoku Solver using OpenCV and DL — Part 2
- Python 3.5 or above
- OpenCV
- tensorflow
How to use
- clone the repo
git clone https://github.com/aakashjhawar/SolveSudoku.git
- set up python virtual environment in the repo
- install the requirements2.txt
pip install -r requirement2.txt
- train the model specific to your system
python cnn_model1.py
- run djnago server
python manage.py runserver 0.0.0.0:8000
- checkout frontend repo
https://github.com/pulkitbajaj1999/sudoku-frontend.git
- after starting both fronend and backend got to browser and open frontend
- 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.