Sudoku Wizard is a Python project that digitizes and solves Sudoku puzzles from images using advanced image processing techniques and OCR (Optical Character Recognition).
- 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.
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!
To install Sudoku Wizard via GitHub, follow these steps:
- Python 3.11
- Git
git clone https://github.com/yourusername/SudokuWizard.git
cd SudokuWizard
To install the dependencies using pip
, run:
pip install -r requirements.txt
To create a conda environment and install the dependencies, run:
conda env create -f environment.yml
conda activate sudoku-wizard
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()
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.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
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!