OpenCv python: solve sudoku from image

Nhan Cao
2 min readJul 15, 2018

Original input image

image from google

First: process input image

Next step, image cell board

This step will split each cell of sudoku (9x9 = 81 cell), after that find contours of number, resize it and push to board.

Next step, recognize number convert to digit array 9x9 using opencv machine learning SVM.

I have to make training data for myself. So that it’s just enough in some case.

Find sudoku solution

Final step: draw to image