image = | harrisCorner2dImg (inImg) |
image = | harrisCorner2dImg (inImg,inGradStdDev) |
Computes the Harris corner detection response.
This algorithm computes the cornerness for each pixel of the input image, according to the Harris corner detector algorithm [1] or to the Shi-Tomasi [2] [3] corner detector algorithm (with respect to method contained by parameter ).
The basic idea of the Harris corner detector is that a corner can be characterized by high intensity variation in all directions. It means that a pixel at position is a corner if the energy
, described by the following equation, reaches a maximum value compared to its neighbourhood
:
Where is the pixel's neighbourhood,
is the input image and
is the Gaussian coefficient at the position
. The gaussian coefficients are computed using the parameters
and
.
The energy can be approximated by a first order Taylor expansion :
Where
Where and
are the spatial derivatives of the input image at the position
along the directions x and y respectively. In this implementation, the spatial derivatives are computed using the Gaussian Gradient 2d algorithm.
Here is an example of a 2d Harris cornerness calculation applied to an 8-bits grey level input image (with and
):
[1] C. Harris and M. Stephens (1988). "A combined corner and edge detector". Proceedings of the 4th Alvey Vision Conference. pp. 147 - 151.
[2] J. Shi and C. Tomasi (June 1994). "Good Features to Track". 9th IEEE Conference on Computer Vision and Pattern Recognition. Springer
[3] C. Tomasi and T. Kanade (2004). "Detection and Tracking of Point Features". Pattern Recognition. 37: 165 - 168