Skip to content

bashtavenko/sudoku

Repository files navigation

Sudoku solver

This is a complete code to solve Sudoku puzzles.

For example, given this image

Example

the solver outputs

Result

Installation on Ubuntu

  1. Install Bazel or better Bazelisk
  2. Train a model based on MNIST. See download_mnist and run training.
  3. Run bazel run //:solver_main -- --image_path=$HOME/sudoku/testdata/sudoku_9_9.png --model_path=$HOME/sudoku/model.yml

Overview

  1. Detects Sudoku grid and extracts 81 digit cells
  2. Detects each cell with simple ML model
  3. Solves through backtracking
  4. Puts answers into the same grid

Dependencies

  • OpenCV, built from source
  • Abseil
  • Glog, Gtest and a few other dev dependencies

If you have any thoughts or questions, ping me.

About

Sudoku solver and more

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published