Sudoku Solver!
Objective: A script to solve sudoku from just an image!
Update: It is now working, Final working scripts are inside Solution folder (https://github.com/itsnikhil/sudoku_solver/tree/master/Solution)
How to run?
- Install required libraries -
a) OpenCV (http://docs.opencv.org/3.2.0/d5/de5/tutorial_py_setup_in_windows.html)
b) pip install Pillow
c) Numpy http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy - Clone this repo (https://github.com/itsnikhil/sudoku_solver.git)
- Look for Solution folder
- Run 'TrainAndTest.py' in terminal/cmd
How it works?
- First 'sudoku.png' is converted to binary colors (Black and White) #'opencv.py' does this thersholding
- That binary image is chopped into 9x9 pieces #'slice_img.py' does this slicing
- Each digit is individually read using KNN character recogination algo #'TranAndTest.py' does this and below
- All the character read is stored in 'data.txt'
- Characters from 'data.txt' is then read to create Sudoku board which is then solved using Sudoku solving algo #'suduko_solver.py' does all this
- All the files created get removed in the end!