SudokuSolverAI - an app for solving sudoku puzzles through a web camera (augmented reality).
The program detects the sudoku puzzle using the webcam and implements OpenCV for image processing. Using a neural network for digit prediction, it solves the puzzle using an efficient backtracking algorithm. If a solution exists, it showcases the answer on the screen.
Screenshots of solving Sudoku through MacBook Webcam:
Here is the step-by-step how image processing and image detection works in the program using OpenCV and Tensorflow.
- 1 step: Process the image using the gaussian blur, threshold filter to get the grids of sudoku more accurate.
- 2 step: Find corners and crop the image by outer corners.
- 3 step: Detect the digits using the trained model. Detect the grids and identify order of numbers
- 4 step: Use the backtracking algorithm to solve the sudoku.
- 5 step: Show the solution on the empty grids of the sudoku.
The project is created with:
- Python: 3.11.5
- OpenCV: 4.8.0
- NumPy: 1.24.3
- Tensorflow: 2.13.0
- Keras: 2.13.1
To run this project, first install all libraries mentioned in requirements.txt using the code below:
pip install -r requirements.txt
Then run the project in the main package using the following code:
python3 main.py