aishack / sudoku-detector

www.aishack.in/2010/08/sudoku-grabber-with-opencv
26 stars 9 forks source link

Linux Portability :) #1

Open AmmarkoV opened 12 years ago

AmmarkoV commented 12 years ago

You can add a "typedef unsigned char BYTE;" in the digitrecognizer.cpp and remove #include from stdafx.h

You can also add a custom bash make script

!/bin/bash

OpenCVStuff="pkg-config --cflags opencv pkg-config --libs opencv" Optimizations="-O3 -fexpensive-optimizations" CPU="-mfpmath=sse -mtune=core2 -msse -msse2 -msse3" g++ $OpenCVStuff $Optimizations $CPU digitrecognizer.cpp stdafx.cpp "Sudoku Solver.cpp" -o sudoku_detector exit 0

Running it the program is compiled without problems without visual studio provided the opencv libraries are installed ( sudo apt-get install libcv-dev )

Keep up the good work :)

AmmarkoV commented 12 years ago

I meant remove #include tchar.h from stdafx.h since it could not be found , and probably doesnt exist on linux/bsd/unix systems

AmmarkoV commented 12 years ago

You could also add before the exit 0

wget http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz gunzip train-images-idx3-ubyte.gz

wget http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz gunzip train-labels-idx1-ubyte.gz to auto get and unzip the files that are needed for digit recognition

and also change bool b = dr->train("D:/Test/Character Recognition/train-images.idx3-ubyte", "D:/Test/Character Recognition/train-labels.idx1-ubyte"); to.. bool b = dr->train("train-images.idx3-ubyte", "train-labels.idx1-ubyte");

:)

liquidmetal commented 12 years ago

Thanks! I'll do that as soon as I get home!

AmmarkoV commented 12 years ago

added all the things mentioned above in http://ammar.gr/myloader/vfile.php?i=dd73671cc2b670569d3f38df4954c1bc-SudokuDetectorLinux.tar.gz 724KB ( a screenshot takes 90% of the size + :P ) It would also be cool if you added the sudoku.jpg on the repo for instant fun :)

patelbhavin27 commented 12 years ago

hi folks,

I need some help regarding concept of split image based on lines.

Suppose I have a image that contains two images with strong black lines around them.

how can I split it ? I do not have any image analysis knowledge.

can you guide me which tools I can use ? OR any example would be great.

Thanks, Bhavin

AmmarkoV commented 12 years ago

Well unfortunately you need some basic understanding of image processing to do these kind of things , the source code in this repository does what you want as a part of the process , ( see outer box on the code ) so it can be used as a template

What you want is to convert the image to its sobel derivative with some thresholding .. Then make a hough transform to find lines Then pick the outer lines and copy the part of the image they contain in a new buffer ( thus splitting it )

This is an excelent book : http://www.cse.iitk.ac.in/users/vision/dipakmj/papers/OReilly%20Learning%20OpenCV.pdf See pages 160 -174

patelbhavin27 commented 12 years ago

Thank you.