Image.Harris#

Image.Harris(**kwargs: Any) HarrisFeature[source]#

Find Harris features in image

Inheritance diagram of machinevisiontoolbox.ImagePointFeatures.HarrisFeature
Parameters:
  • nfeat (int, optional) – maximum number of features to return, defaults to 250

  • k (float, optional) – Harris constant, defaults to 0.04

  • scale (int, optional) – nonlocal minima suppression distance, defaults to 7

  • hw (int, optional) – half width of kernel, defaults to 2

  • patch (int, optional) – patch half width, defaults to 5

Returns:

set of 2D point features

Return type:

HarrisFeature

Harris features are detected as non-local maxima in the Harris corner strength image. The descriptor is a unit-normalized vector of image elements in a \(w_p \times w_p\) patch around the detected feature, where \(w_p = 2\mathtt{patch}+1\).

Returns an iterable and sliceable object that contains Harris features and descriptors.

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read("eiffel-1.png")
>>> harris = img.Harris()
>>> len(harris)  # number of features
3542
>>> print(harris[:5])
HarrisFeature features, 5 points

Note

The Harris corner detector and descriptor is not part of OpenCV and has been custom written for pedagogical purposes.

References:
Seealso:

HarrisFeature