This project is a Sudoku solver that uses a combination of computer vision and a SAT solver to solve Sudoku puzzles from an image.
- Preprocessing: The input image is processed using OpenCV to detect the Sudoku board and warp it into a top-down perspective.
- Cell Detection: The individual cells of the Sudoku grid are detected and cut out to be used later on.
- OCR: The digits in the cells are recognized using doctr's vitstr-small.
- SAT-Solving: The Sudoku puzzle is converted into a satisfiability problem (SAT) and solved using the Kissat SAT solver.
- Solution Rendering: The sat-compiled solution is rendered back onto the original image.
Here's an example of the solver in action:
Input Image:
Output Image:
Also has a Sudoku generation feature using the Algorithm outlined in this Stack Overflow post