Harris Corner Detector

The Harris corner detector identifies corners in an image by analyzing how the image intensity changes in a small window around each pixel, in all directions. If shifting the window in any direction produces a large intensity change, the point is likely a corner (as opposed to an edge, where the change is large in only one direction, or a flat region, where it’s small in all directions). It computes this using the local gradients to build a matrix (the structure tensor) whose eigenvalues indicate the strength and nature of intensity variation, then derives a “corner response” score from that matrix to flag strong corner candidates. The Harris corner detector is invariant to rotation, illumination variation and image noise. It delivers a vector of points of interest.

Harris corner detector example.

The EasyImage Harris corner detector requires three parameters:

  • The integration scale \(σ_{i}\): the standard deviation of the Gaussian Filter used for scale analysis. \(σ_{d} = 0.7 \times σ_{i}\), where \(σ_{d}\) is the differentiation scale: the standard deviation of the Gaussian Filter used for noise reduction during computation of the gradient.

  • A corner threshold: a fraction ranging from 0 to 1 of the maximum value of the cornerness of the source image.

  • A Boolean that toggles sub-pixel detection.

The following characteristics are available for every point of interest:

  • Corner position (pixel coordinates with sub-pixel accuracy if enabled).

  • Cornerness measurement.

  • Gradient magnitude in regard to the differentiation scale \(σ_{d}\).

  • Gradient value along the X-axis in regard to the differentiation scale \(σ_{d}\).

  • Gradient value along the Y-axis in regard to the differentiation scale \(σ_{d}\).

The API of the Harris corner detector is a single class named EHarrisCornerDetector .NET Python and these methods:

Basic Usage of Harris Corner Detector

An object of the EHarrisCornerDetector .NET Python class can be reused across Harris detector applications in order to reduce the setup time.

  1. Create an instance of the detector and set the appropriate method, for instance, the integration scale, EHarrisCornerDetector::SetIntegrationScale .NET Python, with the structures of interest that could have a spatial extent of 2 pixels.

  2. EHarrisCornerDetector::Apply .NET Python the detector with two arguments to the new image : the input image and the interest points in the input image EHarrisInterestPoints .NET Python.

  3. Access the individual elements of the output vector.

See Also

Code Snippets

Easy to understand, ready to copy code snippets.

Harris Corner Detector
Canny Edge Detector

Detect edges in an image using gradient magnitudes and hysteresis thresholding.

Canny Edge Detector