In this AI-assisted Sudoku Solver, algorithm is able to detect and to directly solve AI sudokus in VR.
Grids Extraction
Firstly, the algorithm have to find where the grids are ! The pipeline is :
- Preprocess image to enhance high frequencies
- Find lines thanks to Hough Space
- Analyse lines to know which can correspond to a grid
Digits Identification & Grids Solving
Once grids are extracted, for each grid we do :
- Detect shape which can be digits
- Use my CNN do identify digits
- Create a numeric grid in a table & solve it
Grids Reconstruction
- Create a virtual image to fill the initial image
- Add the 2 images together to create the final result
Video Case
When user chose to use video as input, the algorithm will act quite differently :
- For grids extraction, we use position of last grids to deduce if 2 grids in 2 pictures are actually the same
- For grids solving, we wait to have meet the same extracted numeric grid twice, to be confident on digits extraction
- It do not resolve a grid if it a grid is detected as same as an already solved grid
How to use AI Sudoku ?
The best way to use my algorithm is to firstly clone the git repo where you want to. Then, open a terminal & go in the repositorycd /path/to/the/folder/
You can see the options by typing python3 sudoku_solver_main.py -h
You will need some libraries before running it
- Numpy
- OpenCV
- Keras
- Tensorflow
To Install : pip install <library_name>
Easy way
Take your own picture/video of your process target and use the commandpython3 sudoku_solver_main.py -i path/to/your/file
You also want to add -s
to save the output result In both cases, the result will be display on your monitor during processing
If you want to use your webcam, you can chose the profile n°2 by adding -p 2
to your command. Nevertheless, the algorithm is too long to give a real-time pleasant experience (mainly cause of the Hough Transform)
Advanced way
The user can use his own Keras model to identify digits. For that use the parameter -mp path/to/your/model
- Watersheds Extraction From Satellite Images Using Attention U-Net
- Mastering Image Classification with SIFT and KNN on CIFAR-10
- Hyperparameter Optimization Made Easy: Scikit-Learn Pipelines and GridSearchCV
- How To Install the Anaconda Python on Windows 11 & Ubuntu 20.04 Linux
- Hand Detection & Gesture Recognition – OpenCV Python