Simple program to solve Sudoku puzzles only with the source image.
Project description
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).
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.
Installation
To install Sudoku Wizard, follow these steps:
Prerequisites
- Python 3.8 or later
- 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:
import cv2 as cv
from sudoku_wizard 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
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! 🧩✨
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sudokuwizard-0.0.1.tar.gz.
File metadata
- Download URL: sudokuwizard-0.0.1.tar.gz
- Upload date:
- Size: 67.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3552193125d236834065539bdfe99b9d93fce643ddf1f427afa247c1426e27e
|
|
| MD5 |
b33fe1de073ffe1b93cbe55be6cc842b
|
|
| BLAKE2b-256 |
7edaf41c2d36252387bca7bbc168ecafe4bdff099c29bb2836e881da2ff3ee83
|
File details
Details for the file sudokuwizard-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sudokuwizard-0.0.1-py3-none-any.whl
- Upload date:
- Size: 82.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75c9d2541937db7ae757b7570143d26c9fb7dc78542971d830c39a0426d81197
|
|
| MD5 |
7205601edea64702db7da20b99771d3c
|
|
| BLAKE2b-256 |
efe155deff13a8d9228bc1f39b61c30a65b877df51f845f555464e37bdfc298e
|