Using python-sudoku 0.13 generate sudoku image, and solve the parsed puzzle;
Using Tesseract 3 python wrapper to do digit, but it will not be sucessful for all times.
download the package pythonsudoku-0.13-orcsudoku, extract to anywhere, cd pythonsudoku-0.13/ocrsudoku/, run: python cvsudoku.py <inputimagefile>
Python to solve sudoku using tesseract and OpenCV
—————————————————-
Copyright
Qingfeng Xia @ iesensor.com 2012
To share info about sensor and robot
License: GPLv2
—————————————————-
1 Reference to blogs
(1) “OpenCV sudoku, part one”, stackoverflow.com
(2) Another blog finish the digit OCR by OpenCV ()
http://www.codeproject.com/Articles/238114/Realtime-Webcam-Sudoku-Solver
2 Test Environment:
Ubuntu 12.04, Tesseract 3.01, OpenCV 2.3 all with Python bilnding
pythonsudoku-0.13
this folder “ocrsudoku”, should be put under the folder of “pythonsudoku-0.13” as it is shipped
packages depends: python-opencv python-tesseract
3. Usage:
change folder into “ocrsudoku”
(1) ./cvsudoku.py , or by double clicking, it will solve random generated sudoku and display result
or in terminal and show result images.
(2)./cvsudoku.py sudoku_unsolved.png
4. Problems during programming:
(1)The data type to represent the image in OpenCV 1.x API
(2)Tesseract python binding support OpenCV 2.3 with old style python-opencv binding,
but it supports new style API cv2.* ,
5. limitations:
(1)Using python-sudoku 0.13 generate sudoku image, and solve the parsed puzzle;
Therefore, tilted grid will not be recognized in this version. ( only horizontal and vertical grid is acceptable)
(2)Using Tesseract 3 python wrapper to do digit, but it will not be sucessful for all times.
python pythonsudoku-0.13\ocrsudoku\cvsudoku.py <inputimagefile>