machinevisiontoolbox.Image.Harris
- Image.Harris(**kwargs)
Find Harris features in image
- 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 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 3541 >>> 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:
A combined corner and edge detector. CG Harris, MJ Stephens Proceedings of the Fourth Alvey Vision Conference, 1988 Manchester, pp 147–151
- Robotics, Vision & Control for Python, Section 12.3.1,
Corke, Springer 2023.
- Seealso:
HarrisFeature