Harris detector#

The objective of this exercise is to detect corners using the Harris detector.

The Harris detector can detect corners of an image, based on differences in intensity.

With the function corner_harris, choose method='k' and a value of \(k\) between 0 and 0.2. This results in a new image, of the same size as the original image, whose intensities are proportional to the presence of a corner.

In the images below, the intensities are restricted to the interval \([-0.4, 0.4]\) in order to highlight the values of the image.

../_images/6d7eede0b24d9374cc96469d1be6a3cece26e3152cf9443ce50dd44837b2b751.png

The function corner_peaks returns the coordinates of the strong values of the image, which correspond to the corners. These coordinates are returned in the form of a matrix, the first column corresponds to the ordinates, the second to the abscissas.

../_images/bb8f247f3f3b15f25b32286a6499b25657cf0a1d1770d7bfdd3892bef560d44f.png

The images above correspond to the result obtained for two values of \(k\) (and threshold_rel=0.01). When \(k\) is large, only the sharpest corners are detected: one can see this in the image on the right.

However, not all corners of are detected: how to improve the result?

In addition, some points do not correspond to corners. They correspond actually to pixels with very different intensity from their neighbors, which is the definition of a corner for Harris.