Monday, January 15, 2007

Interest Point Detection

When I first started working on interest/feature point detection last week, I realized that OpenCV already included an implementation of the Harris Corner Detector. Instead of moving on to feature correspondence, I decided to implement interest point detection using the Forstner interest operator (we did this last quarter in cse166 with Matlab) so that I could get some practice using OpenCV functions.


This is what my OpenCV implementation looks like on a checkerboard image. The resulting coordinates fall on or near the corners, but most of them have more than 1 point (190 points were plotted). The algorithm was:
  1. Compute the image gradient.
  2. Using a 3x3 window for each pixel location, find "lambda_min" -- the minimum eigenvalue of the outerproduct of the gradient in that window.
  3. Threshold lambda_min to find the corners.
The Harris Corner Detector also uses the image gradient, but instead of eigenvalues it uses C(x) = det(G) + k * trace(G)^2, where k is a constant and G is the outerproduct of the gradient for a window centered at x. This is what it looks like when applied to the same checkerboard image with the same 3x3 windows:

Most of the corners have multiple dots as well (it also detected 190 points). This can be improved on by enforcing a minimum separation space for each detected point. If we use a minimum distance of 3 pixels, the 49 points will be detected correctly :


For this last image I used OpenCV's function cvGoodFeaturesToTrack, which uses Harris' criterion and allows you to specify a minimum separation space. So it looks like I don't have to write any more code for detecting interest points. I'll post some more pictures once I finish creating some test sets.

Resources:

No comments: