Skip to content

points_harrisPointsHarrisPointsHarrispoints_harrisT_points_harrisπŸ”—

Short descriptionπŸ”—

points_harrisPointsHarrisPointsHarrispoints_harrisT_points_harris β€” Detect points of interest using the Harris operator.

SignatureπŸ”—

points_harris( image Image, real SigmaGrad, real SigmaSmooth, real Alpha, number Threshold, out point.y Row, out point.x Column )void PointsHarris( const HObject& Image, const HTuple& SigmaGrad, const HTuple& SigmaSmooth, const HTuple& Alpha, const HTuple& Threshold, HTuple* Row, HTuple* Column )static void HOperatorSet.PointsHarris( HObject image, HTuple sigmaGrad, HTuple sigmaSmooth, HTuple alpha, HTuple threshold, out HTuple row, out HTuple column )def points_harris( image: HObject, sigma_grad: float, sigma_smooth: float, alpha: float, threshold: Union[float, int] ) -> Tuple[Sequence[float], Sequence[float]]

Herror T_points_harris( const Hobject Image, const Htuple SigmaGrad, const Htuple SigmaSmooth, const Htuple Alpha, const Htuple Threshold, Htuple* Row, Htuple* Column )

void HImage::PointsHarris( double SigmaGrad, double SigmaSmooth, double Alpha, const HTuple& Threshold, HTuple* Row, HTuple* Column ) const

void HImage::PointsHarris( double SigmaGrad, double SigmaSmooth, double Alpha, double Threshold, HTuple* Row, HTuple* Column ) const

void HImage.PointsHarris( double sigmaGrad, double sigmaSmooth, double alpha, HTuple threshold, out HTuple row, out HTuple column )

void HImage.PointsHarris( double sigmaGrad, double sigmaSmooth, double alpha, double threshold, out HTuple row, out HTuple column )

DescriptionπŸ”—

points_harrisPointsHarris extracts points of interest from an image. The Harris operator is based upon the smoothed matrix

\[\begin{eqnarray*} M = G_{\sigma} * \left( \begin{array}{cc} \displaystyle \sum_{c=1}^n I_{x,c}^{2} & \displaystyle \sum_{c=1}^n I_{x,c}I_{y,c} \\ \displaystyle \sum_{c=1}^n I_{x,c}I_{y,c} & \displaystyle \sum_{c=1}^n I_{y,c}^{2} \end{array} \right) \enspace , \end{eqnarray*}\]

where \(G_{\sigma}\) stands for a Gaussian smoothing of size SigmaSmoothsigmaSmoothsigma_smooth and \(I_{x,c}\) and \(I_{y,c}\) are the first derivatives of each image channel, computed with Gaussian derivatives of size SigmaGradsigmaGradsigma_grad. The resulting points are the positive local extrema of

\[\begin{eqnarray*} \mathrm{Det}M - \textrm{Alpha}*(\mathrm{Trace}M)^{2}. \end{eqnarray*}\]

If necessary, they can be restricted to points with a minimum filter response of Thresholdthresholdthreshold. The coordinates of the points are calculated with subpixel accuracy.

AttentionπŸ”—

points_harrisPointsHarris uses a special implementation that is optimized using SSE2 instructions if the system parameter 'sse2_enable'"sse2_enable" is set to 'true'"true" (which is default if SSE2 is available on your machine). This implementation is slightly inaccurate compared to the pure C version due to numerical issues (for β€˜byte’ images the difference in Rowrowrow and Columncolumncolumn is in order of magnitude of \(1.0e-5\)). If you prefer accuracy over performance you can set 'sse2_enable'"sse2_enable" to 'false'"false" (using set_systemSetSystem) before you call points_harrisPointsHarris. This way points_harrisPointsHarris does not use SSE2 accelerations. Don’t forget to set 'sse2_enable'"sse2_enable" back to 'true'"true" afterwards.

points_harrisPointsHarris can be executed on an OpenCL device if both SigmaGradsigmaGradsigma_grad and SigmaSmoothsigmaSmoothsigma_smooth induce a filter size of no more than 129 pixels. This corresponds to a value of less than \(20.7\) for both parameters. As with the SSE2 version, the results of the OpenCL implementation may diverge slightly from that of pure C version due to numerical issues.

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution informationπŸ”—

Execution information
  • Supports OpenCL compute devices.

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

ParametersπŸ”—

Imageimageimage (input_object) (multichannel-)image β†’ object (byte* / uint2* / real*)HObject (byte* / uint2* / real*)HImage (byte* / uint2* / real*)HObject (byte* / uint2* / real*)Hobject (byte* / uint2* / real*) *allowed for compute devices

Input image.

SigmaGradsigmaGradsigma_grad (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Amount of smoothing used for the calculation of the gradient.

Default: 0.70.7
Suggested values: 0.7, 0.8, 0.9, 1.0, 1.2, 1.5, 2.0, 3.00.7, 0.8, 0.9, 1.0, 1.2, 1.5, 2.0, 3.0
Recommended increment: 0.1
Restriction: SigmaGrad > 0.0

SigmaSmoothsigmaSmoothsigma_smooth (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Amount of smoothing used for the integration of the gradients.

Default: 2.02.0
Suggested values: 0.7, 0.8, 0.9, 1.0, 1.2, 1.5, 2.0, 3.00.7, 0.8, 0.9, 1.0, 1.2, 1.5, 2.0, 3.0
Recommended increment: 0.1
Restriction: SigmaSmooth > 0.0

Alphaalphaalpha (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Weight of the squared trace of the squared gradient matrix.

Default: 0.080.08
Suggested values: 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.080.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08
Value range: 0.0 ≀ Alpha
Minimum increment: 0.001
Recommended increment: 0.01

Thresholdthresholdthreshold (input_control) number β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Minimum filter response for the points.

Default: 1000.01000.0
Restriction: Threshold >= 0.0

Rowrowrow (output_control) point.y-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinates of the detected points.

Columncolumncolumn (output_control) point.x-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinates of the detected points.

ResultπŸ”—

points_harrisPointsHarris returns 2 (H_MSG_TRUE) if all parameters are correct and no error occurs during the execution. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

gen_cross_contour_xldGenCrossContourXld

Alternatives

points_foerstnerPointsFoerstner, points_lepetitPointsLepetit, points_harris_binomialPointsHarrisBinomial

ReferencesπŸ”—

C. Harris, M. Stephens: ``A combined corner and edge detectorβ€™β€˜. Proceedings of the 4th Alvey Vision Conference, pp. 147-151, 1988.

V. Gouet, N.Boujemaa: ``Object-based queries using color points of interestβ€™β€˜. IEEE Workshop on Content-Based Access of Image and Video Libraries, CVPR/CBAIVL 2001, Hawaii, USA, 2001.

ModuleπŸ”—

Foundation