Skip to content

Take a picture of your sudoku, and sit back while it is solved and your image is correctly filled with the missing numbers.

License

Notifications You must be signed in to change notification settings

INIGO-7/SudokuWizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku Wizard 💻🪄

Sudoku Wizard is a Python project that digitizes and solves Sudoku puzzles from images using advanced image processing techniques and OCR (Optical Character Recognition).

Screenshot from 2024-06-18 14-46-34

Features

  • Image Processing: Detects and extracts Sudoku grids from images.
  • OCR and Template Matching: Recognizes digits within the Sudoku grid using either OCR or template matching.
  • Sudoku Solving: Solves the extracted Sudoku puzzle using a DFS algorithm.
  • Visualization: Overlays the solution onto the original image.

Pip installation

To install Sudoku Wizard via PyPI, we only need to use pip in the command line!

(ensure you're in an environment that uses python 3.11)

pip install sudokuwizard

Now we're ready to use it!

GitHub Installation

To install Sudoku Wizard via GitHub, follow these steps:

Prerequisites

  • Python 3.11
  • Git

Clone the Repository

git clone https://github.com/yourusername/SudokuWizard.git
cd SudokuWizard

Using requirements.txt

To install the dependencies using pip, run:

pip install -r requirements.txt

Using environment.yml

To create a conda environment and install the dependencies, run:

conda env create -f environment.yml
conda activate sudoku-wizard

Usage

Here's a quick example of how to use Sudoku Wizard:

from SudokuWizard import SudokuWizard

# Create a SudokuWizard instance
sw = SudokuWizard()

# Load your sudoku image (works with .jpg, .jpeg, .png and .webp; support for other extensions is unknown)
sw.load_image('image.jpg')

# Run the Sudoku digitalization and resolution process (this will automatically show the solution in a new window)
sw.run()

Project Structure

  • sudoku_wizard.py: Main implementation of the Sudoku Wizard class.
  • sudoku_algorithms.py: Contains various algorithms for solving Sudoku puzzles.
  • exceptions.py: Custom exceptions for error handling.
  • res/photos/: Contains template images for number recognition.
  • requirements.txt: Python dependencies.
  • environment.yml: Conda environment configuration.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.


Feel free to reach out if you have any questions or need further assistance!


Enjoy solving Sudoku puzzles with Sudoku Wizard!

🪄

About

Take a picture of your sudoku, and sit back while it is solved and your image is correctly filled with the missing numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages