Skip to content

Latest commit

 

History

History
65 lines (37 loc) · 1.88 KB

File metadata and controls

65 lines (37 loc) · 1.88 KB

Computer Vision Sudoku Solver

About

Utilizing computer vision to get Sudoku puzzles from pictures.

Example Image Example Image Example Image Example Image Example Image

Structure

  • All other code can be found in /models

    • /digit_classifier.ipynb: contains the code to create and train the DNN to classify digits. For this, the MNIST dataset was utilized.

    • /solve.ipynb: contains code to train a DNN and an analysis on time and accuracy.

  • All other code can be found in /src:

    • /camera.py: Opens the camera and returns the last frame.

    • /extract_puzzle.py: find the puzzle, classifies every digit with the DNN, and display the solution in bird view from the Sudoku obtained from the image.

    • /generate.py: generates easy or hard Sudoku puzzles with a unique solution.

    • get_data.py: saves generated puzzles in CSV format.

    • gui.py: makes the GUI where you can solve Sudoku's.

    • test.py: contains code that checks a Sudoku's validity and unique solvability.

Getting started

Requirements

Install the dependencies with the following command:


pip install -r requirements.txt

Python 3.11.4 was used.

Usage

Run the following command to open the GUI:


python main.py

Todos

  • Find smaller (faster) NN to solve Sudoku's with high accuracy

License

MIT