This is a complete code to solve Sudoku puzzles.
For example, given this image
the solver outputs
- Install Bazel or better Bazelisk
- Train a model based on MNIST. See download_mnist and run training.
- Run
bazel run //:solver_main -- --image_path=$HOME/sudoku/testdata/sudoku_9_9.png --model_path=$HOME/sudoku/model.yml
- Detects Sudoku grid and extracts 81 digit cells
- Detects each cell with simple ML model
- Solves through backtracking
- Puts answers into the same grid
- OpenCV, built from source
- Abseil
- Glog, Gtest and a few other dev dependencies
If you have any thoughts or questions, ping me.