Skip to content

rimma-kubanova/sudoku-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SudokuSolverAI

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.

Demonstration

Screenshots of solving Sudoku through MacBook Webcam:

Screenshot 2023-09-08 at 14 54 27 Screenshot 2023-09-08 at 14 54 27

Process

Here is the step-by-step how image processing and image detection works in the program using OpenCV and Tensorflow. Screenshot 2023-09-08 at 14 54 27 Screenshot 2023-09-08 at 15 14 40 Screenshot 2023-11-23 at 18 01 14

  • 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.

Setup

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages