OpenCV detect corners

image processingopencv

I'm using OpenCV on the iPhone. I want to find a Sudoku in a photo.
I started with some Gaussian Blur, Adaptive Threshold, Inverting the image and Dilate.
Then I did some findContour and drawContour to isolate the Sudoku grid.
Then I've used the Hough Transform to find lines and what I need to do now is find the corners of the grid. The Sudoku photo may be taken in an angle so I need to find the corners so I can crop and warp the image correctly.

This is how two different photos may look. One is pretty straight and one in an angle:

Probabilistic Hough

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

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

(Standard Hough comes in a comment. I can't post more than two links)

So, what would be the best approach to find those corners? And which of the two transform is easiest to use?

Best Regards
Linus

Best Answer

Why not use OpenCV's corner detection? Take a look at cvCornerHarris().

Alternatively, take a look at cvGoodFeaturesToTrack(). It's the Swiss Army Knife of feature detection and can be configured to use the Harris corner detector (among others).

Related Topic