Skip to content

data-stats/Sudoku-Solver-using-OpenCV

Repository files navigation

SolveSudoku

SolveSudoku extract and solve sudoku from image. It uses a collection of basic image processing techniques and CNN for training and recognition of characters. CNN is trained on MNIST dataset.

Prerequisites

  • Python 3.5
  • OpenCV
sudo apt-get install python-opencv

Procedure

  1. Image preprocessing (Thresholding).
  2. Find the largest contour (sudoku square).
  3. Get the cordinates of largest contour.
  4. Crop the image.
  5. Perform Warp perspective on image
  6. Extract each cells from the image by slicing the sudoku grid.
  7. Extract the largest component in the sudoku image (number).
  8. Remove noise in block.
  9. Send the number to pre trained Digit Recogition model.
  10. Send the grid to Sudoku Solver to perform the final step.

Working

Input image of Sudoku-

Input image of sudoku

Image of Sudoku after thresholding-

Threshold image of sudoku

Contour corners of Sudoku-

Contour of sudoku

Warp Image-

Warp of sudoku

Final output of ExtractSudoku-

Final image of sudoku

Extracted grid-

extracted grid

Solved grid-

Solved grid

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published