OpenCV detects angles

I am using OpenCV on the iPhone. I want to find Sudoku in the photo. I started with some Gaussian Blur, Adaptive Threshold, Image Invert and Dilate. Then I did some findContour and drawContour to isolate the Sudoku grid. Then I used the Hough Transform transform to find the lines, and now I need to find the corners of the grid. A photo of Sudoku can be taken at an angle, so I need to find the angles so that I can crop and distort the image correctly.

Here's what two different photos look like. One is pretty straight and one at an angle:

Probabilistic Hur

http://img96.imageshack.us/i/skrmavbild20110424kl101.png/

http://img846.imageshack.us/i/skrmavbild20110424kl101.png/

(A standard Hough post appears in a comment. I cannot post more than two links)

So what would be the best approach to find these angles? And which of the two transformations is the easiest to use?

Regards Linus

+5
source share
4 answers

Why not use OpenCV angle detection? Take a look at cvCornerHarris ().

Alternatively take a look at cvGoodFeaturesToTrack (). This is a Swiss Army function detection knife and can be configured to use a Harris corner detector (among others).

+2
source

. . "" "" (.. ). . . , . 90 - 180 .

+1
0

All Articles