This is a complete code to solve Sudoku puzzles.
For example, given this image
the solver outputs
- Install Bazel or better Bazelisk
- Install OpenCV and Tesseract with included scripts
- 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 a simple ML model
- Solves it through backtracking
- Puts answers into the same grid
- OpenCV
- Tesseract
- Abseil
- Glog, Gtest and a few other dev dependencies
If you have any thoughts or questions, ping me.

