CSC 370

CSC 370 Assignment: Corner Detection

 

In this assignment you will investigate corner detection, which is the first step in most feature-based correspondence and object recognition techniques, inclusing SIFT and SURF. We will follow Algorithm 4.1 from Szeliski.

  1. Compute the horizontal and vertical derivatives of the image Ix and Iy by convolving the original image with derivatives of Gaussians (Section 3.2.3).
  2. Compute the three images corresponding to the outer product of these gradients. (The matrix A is symmetric, so only three entries are needed.)
  3. Convolve each of these images with a larger Gaussian.
  4. Compute the scalar interest measure using one of the formulas discussed above.
  5. Find the local maxima above a certain threshold and report them as detected feature point locations.

Details

Try this out on the standard Cameraman image, available in Matlab: imread('cameraman.tif');. Because this comes in as a matrix of unsigned integers, before further processing you will want to convert the result to double and divide by 255.

For the first step of the algorithm, you can use Matlab's builtin gradient function. Alternately you could compute the gradient components yourself using fspecial to get a Gaussian filter, and then take its derivative by convolving it with [-1 1] or the transpose.

The "outer products" referred to in the second step are A11 = Ix2, A12 = A21 = IxIy, and A22 = Iy2. You can compute them using the .* operator (element-wise multiply) in Matlab.

Again, use fspecial with a larger sigma value for step 3.

The interest measures are given earlier in the chapter. Two that you could easily try are the Harris criterion, D-αT (the suggested value for α is 0.06) or the Brown criterion, D/T. In both formulae, D refers to the determinant of A, or A11A22-A12A21, and T refers to the trace of A, or A11A22.

For the last step, you can use imagesc(interest) followed by colorbar to pick an appropriate threshold value t. The following code will then display the points you have chosen:

[y,x] = find(bwmorph(interest>.t,'shrink',inf));
imshow(img)
hold on
plot(x,y,'ro')
hold off

Do the identified points make sense to you?

Further Investigation

Detection of interest points is only a first step. The next stage usually consists of drawing correspondances between interest points detected in two (possibly) related images. To do this, the area around the points must be described using some sort of featural descriptor, so that it can be compared for similarity to the descriptors of other points. Common ways of doing this include the Histogram of Oriented Gradients (HOG), Scale Invariant Feature Transform (SIFT), Speeded Up Robust Features (SURF), and more.

For more on object category recognition, you might take a look at Torralba's 2005 seminar, which includes demo Matlab scripts.