Skip to content

lubosmato/sudoku-solver

Repository files navigation

Sudoku Solver

Demo (fill 1)

Demo

Sudoku solver is a fun project of mine to test new technologies and to be good at sudoku solving.

The app can:

  1. Generate sudoku puzzle with given difficulty
  2. Solve sudoku puzzle
  3. Scan sudoku puzzle
  4. Share sudoku puzzle link
  5. Print sudoku puzzle
  6. Download sudoku puzzle image

Everything is written in JavaScript so it is damn slow on some devices 🙂.

Used technologies:

Scanning steps

  1. Apply binary threshold on black and white image
  2. Invert colors
  3. Find lines with Hough Lines algorithm
  4. Group lines into horizontal and vertical groups based on their slope angle
  5. Average lines that are close to each other into single line for both groups
  6. Find sequence of 10 lines which have distance between next line approximately same for both groups
  7. Find corners defined by intersections of first and last lines from both groups
  8. Find perspective transformation and warp input image based on corner points
  9. Calculate cells positions
  10. Apply Tesseract.js OCR for all found cells

Install the dependencies

yarn

Start the app in development mode (hot-code reloading, error reporting, etc.)

quasar dev -m spa

Lint the files

yarn run lint

Build the app for production

quasar build -m pwa

Customize the configuration

See Configuring quasar.conf.js.