You are on page 1of 3

OpenCV-Python: Sudoku Solver - Part 1 http://opencvpython.blogspot.in/2012/06/sudoku...

7 More Next Blog mr.rahul.tripathy@gmail.com Dashboard Sign Out

OpenCV Python Tutorials

Home List of Articles What's New? (05-Mar-2013) Links

Friday, June 1, 2012 About Me

Abid Rahman K
Sudoku Solver - Part 1 Follow 1k

Hi, View my complete profile

Now I would like to post a series of tutorials on "Sudoku Solver" .

Actually I started this a few months ago, but got stuck at final part, more specifically, the OCR 1k
part. But after a little hacks, I could find a simple method for OCR using kNN. Hope you have
read that article !!!
Total Pageviews
In this post, I will tell you what exactly I did to develop a "Sudoku Solver".
1,426,951
What exactly it does?

Search This Blog


This project on successful completion, accept an image of Sudoku as input, and returns a solved
Sudoku back.
Search
See a demonstration below:

Google+ Followers

OpenCV Python
Follow

Input Image. Output of sudoku solver

How to accomplish this :


871 have us in circles View all
It can be done implementing the methods given in image below :

Followers

Followers (118) Next

Follow

Blog Archive

2011 (2)
2012 (26)
March (1)
April (3)
May (5)
June (12)
We will deal with each of one of the steps above:
Sudoku Solver - Part 1
1. Reading the Image : It is our normal image reading in OpenCV Difference between Matrix Arithmetic in
OpenCV and...
2. Image Pre-processing : It includes noise removal, brightness/contrast adjustment,
thresholding etc. Smoothing Techniques in OpenCV

3. Find Sudoku Square & Corners : Here we find outer border of Sudoku square and its Sudoku Solver - Some Common
corners. Questions

1 of 3 7/6/17, 12:12 PM
OpenCV-Python: Sudoku Solver - Part 1 http://opencvpython.blogspot.in/2012/06/sudoku...

4. Image Transformation : Here we reshape irregular Sudoku in input image to a perfect Sudoku Solver - Part 2
square. Image Derivatives and its Applications
5. Recognize the digit (OCR) : Recognizes the digits in input image and place them in
Fast Array Manipulation in Numpy
correct position
Contours - 1 : Getting Started
6. Solve the Sudoku : Here, real solving of Sudoku take place.
Contours - 2 : Brotherhood
7. Project back the Result : We project the solved Sudoku to image as shown in demo.
Contours - 3 : Extraction
In some steps, we take some practical assumptions. One, I would like to tell you now :
Contours - 4 : Ultimate
Sudoku Solver - Part 3
The biggest square in the image should be Sudoku Square. In short, image should be
taken close to Sudoku, as you can see in the input image of demo. ( Reason, I will tell in July (3)
upcoming posts).
December (2)

That is all the theory about this. From next post onwards, we get into practicals on how to 2013 (10)
implement this.

Waiting for your feedback,


ARK. Popular Posts

Inspired by Install OpenCV in Windows for Python


1 - Google Goggles Android Application
2 - C++ implementation of Sudoku Solver at Aishack.in Contours - 1 : Getting
Started
And more...

Posted by Abid Rahman K at 3:46 PM


Contours - 2 : Brotherhood
+7 Recommend this on Google

6 comments Simple Digit Recognition


OCR in OpenCV-Python

Add a comment as Rahul Tripathy


Skeletonization using
OpenCV-Python

Top comments

SOGARIKING Amasaki 11 months ago - Shared publicly


nice work man

Reply

Sarath Sp 4 years ago - Shared publicly


best blog to learn opencv python...nice work

+1 Reply

Pete Weissbrod 3 years ago - Shared publicly


Its pretty clear that your python solution was copied from a pre-existing
C++ version. You should give some credit to the original author.

Reply

Abid Rahman K 3 years ago


Hi Pete, you are right about it (to some extent). I got this idea of
sudoku solver when I rst saw google goggles android application
(may be 2-3 yrs back). It was the same time, I was starting to learn
Read more (21 lines)

Abid Rahman K 3 years ago


And I admit it was my mistake I didn't give credit to all those sources.
really I missed it. I thought I should complete all the articles and join
them to one with full details. (Unfortunately I didn't get the time to
Read more (13 lines)

vipul banker 3 years ago - Shared publicly


Excellent Job!!!

Reply

2 of 3 7/6/17, 12:12 PM
OpenCV-Python: Sudoku Solver - Part 1 http://opencvpython.blogspot.in/2012/06/sudoku...

Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Latex

Simple theme. Powered by Blogger.

3 of 3 7/6/17, 12:12 PM

You might also like