Skip to content

Parimala6/Sudoku_solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku_solver

Solving Sudoku with OpenCV_Python_CNN

Sudoku_raw_image:

Converting image to gray scale to reduce information:

Blur the image to remove noise:

(Smoothing the image with Gaussian filter, a low-pass filter that reduces the high-frequency components)

Thresholding the image to seperate foreground pixels from background pixels (minimizing the background noise):

Adaptive thresholding - the threshold value is calculated for smaller regions and therefore, there will be different threshold values for different regions.

Inverting colors so as to find the contours properly:

Finding the largest contour in the image i.e., sudoku:

Finding the corners and extracting the ROI:

Extracting all the cells of the grid:

Extracted cell:

Extracting and recognizing the digits in the cell:

Solving the sudoku using python-constraints

Solved Sudoku: