Question

As part of my Bachelor-Thesis, I'm trying to implement a corner detector with the Harris and Stephens algorithm: A combined Corner and Edge Detector

I do calculate:

  1. The x- and y- deviations with sobel Filters (3x3)
  2. Calculate the system Matrix M

    M = [A C; C B]

    which means, if I got all right:

    1. A = Response of sobel_x squared: Ix * Ix (at certain pixel)
    2. B = Response of sobel_y squared: Iy * Iy (at certain pixel)
    3. C = Response of sobel_x multiplied by response of sobel_y: Ix * Iy (at certain pixel)
  3. now I do calculate trace(M) and what I'm especially more concerned: determinant(M)

In there paper they suggest the following approximation for the determinant, as it avoids expensive calculation of the eigenvalues:

det(M) = A * B - C^2

This must always terminates in Zero!

The expression det(M) = A * B - C^2 can be rewritten as: (using the knowledge of point 2)

det(M) = A * B - C * C

det(M) = Ix*Ix * Iy*Iy - Ix*Iy * Ix*Iy

det(M) = Ix*Ix * Iy*Iy - Ix*Ix * Iy*Iy

det(M) = 0

So why should I even bother calculating the determinant? As far as I see, it is sufficent to calculate the trace! (Or did I make somewhere a major mistake?)

Was it helpful?

Solution

Before you calculate the R, apply Gaussian kernel on Ix2, Iy2, Ixy.

OTHER TIPS

I ran into the same issue. For each pixel in the image, you want to consider a small window, say 3x3 around the pixel.

For each pixel in that 3x3 window, you apply a gaussian mask to it for Ix^2, Ix*Iy, and Iy^2 to construct the 2x2 matrix H'. You then sum up the H' matrixes to obtain the final H matrix, and you calculate the determinant from there.

What I'm not clear on though is why the gaussian mask needs to be applied as many slides and resources found online don't mention it

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