Question

I am trying to find a good algorihtm that would detect corners in a image in a mobile phone. There are multiple algorithms to do that I am not sure which one will perform better in a memory and processor limited environment.

Specifically I am trying to find a sudoku grid in a picture taken using the camera of the phone. I am using C# and could not find any libraries that has basic image processing features. I implemented a Sobel filter to do edge detection and that is where I stand.

To make it clear the question is does anybody have any suggestions to use a specific algorithm or a library?

Was it helpful?

Solution

I wouldn't say "corner detection" by itself is a very good way to do this. Take a step back and think about a photo of a sodoku grid, there are probably lots of assumptions you can make to simplify things.

For example, a sodoku grid always looks exactly the same:

  • White square
  • 9 x 9 regular grid

treating the image in the HSV colour space will allow you to look for high lightness areas (white-ish colours), RGB is a bit pants for most image-processing techniques.

thresholding the image should then reduce noise

Adjusting the image histogram first may also give you better results as it will probably whiten the grid (depends on the image though).

Then all you have to do is find a square. Because you know the grid is regular within it, you can divide the pixels up accordingly and OCR the squares with a number in.

:D

OTHER TIPS

Since you are looking for a regular 9x9 grid consider the Hough transform. One way is to run an edge detector first, find all straight lines using the original Hough transform, and then try to figure out which of them form a grid. Or maybe you can come up with a clever way to parametrize the whole grid.

I have found OpenCV to be very useful in processing images, and I would score myself as a pretty average programmer.

Here's an example (in C++, but you could probably port it) that does corner detection in OpenCV.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top