Converts image of SUDOKU into digital form and finds a solution
- Using Python 3.6.8 and OpenCV 4.1.0
-
Install Anaconda
-
Clone this repository
git clone https://github.com/horczech/sudoku.git -
Install the virtual environment from
enviroment.ymlfile located in the root directory of the repository usingconda env create -f environment.yml -
Activate the virtual enviroment
conda activate sudoku_env
-
There are two scripts that can be used from command line.
1
sudoku_solver.pythat accepts SUDOKU image and returns image with solved SUDOKU and text version of solution.python3 sudoku_solver.py sudoku_imgs/web_cam/webcam_clean_1.jpgThere is also optional parameter
--configwhere you can specify parameters of the algorithm. The example config files can be found in/configs/directory.python3 sudoku_solver.py sudoku_imgs/web_cam/webcam_clean_1.jpg --config configs/config_072
camera_sudoku_solver.pyThis script has no input arguments it just finds and solves soduku from the camera stream. By pressing "F" key on the keyboard it will freeze the surrent frame from camera and by pressing "R" key it will return to the camera stream. By pressing "P" key it will wait till it finds valid solution of the SUDOKU and prints image with the solution and text version of solution. Run it usingpython3 camera_sudoku_solver.py