Skip to content

local_max_sub_pixlocal_max_sub_pixLocalMaxSubPixLocalMaxSubPixlocal_max_sub_pixT_local_max_sub_pix🔗

Short description🔗

local_max_sub_pixlocal_max_sub_pixLocalMaxSubPixLocalMaxSubPixlocal_max_sub_pixT_local_max_sub_pix — Subpixel precise detection of local maxima in an image.

Signature🔗

local_max_sub_pix( image Image, string Filter, real Sigma, real Threshold, out point.y Row, out point.x Column )local_max_sub_pix( Image : : Filter, Sigma, Threshold : Row, Column )void LocalMaxSubPix( const HObject& Image, const HTuple& Filter, const HTuple& Sigma, const HTuple& Threshold, HTuple* Row, HTuple* Column )static void HOperatorSet.LocalMaxSubPix( HObject image, HTuple filter, HTuple sigma, HTuple threshold, out HTuple row, out HTuple column )def local_max_sub_pix( image: HObject, filter: str, sigma: float, threshold: float ) -> Tuple[Sequence[float], Sequence[float]]

Herror T_local_max_sub_pix( const Hobject Image, const Htuple Filter, const Htuple Sigma, const Htuple Threshold, Htuple* Row, Htuple* Column )

void HImage::LocalMaxSubPix( const HString& Filter, double Sigma, double Threshold, HTuple* Row, HTuple* Column ) const

void HImage::LocalMaxSubPix( const char* Filter, double Sigma, double Threshold, HTuple* Row, HTuple* Column ) const

void HImage::LocalMaxSubPix( const wchar_t* Filter, double Sigma, double Threshold, HTuple* Row, HTuple* Column ) const (Windows only)

void HImage.LocalMaxSubPix( string filter, double sigma, double threshold, out HTuple row, out HTuple column )

Description🔗

local_max_sub_pixLocalMaxSubPix extracts local maxima from the image Imageimageimage with subpixel precision. To do so, in each point the input image is approximated by a quadratic polynomial in x and y and subsequently the polynomial is examined for local maxima. The partial derivatives, which are necessary for setting up the polynomial, are calculated either with various Gaussian derivatives or using the facet model, depending on Filterfilterfilter. In the first case, Sigmasigmasigma determines the size of the Gaussian kernels, while in the second case, before being processed the input image is smoothed by a Gaussian whose size is determined by Sigmasigmasigma. Therefore, 'facet'"facet" results in a faster extraction at the expense of slightly less accurate results. A point is accepted to be a local maximum if both eigenvalues of the Hessian matrix are smaller than -Thresholdthresholdthreshold. The eigenvalues correspond to the curvature of the gray value surface.

Attention🔗

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
  • 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) singlechannelimage → object (byte / int1 / int2 / uint2 / int4 / real)object (byte / int1 / int2 / uint2 / int4 / real)HObject (byte / int1 / int2 / uint2 / int4 / real)HImage (byte / int1 / int2 / uint2 / int4 / real)HObject (byte / int1 / int2 / uint2 / int4 / real)Hobject (byte / int1 / int2 / uint2 / int4 / real)

Input image.

Filterfilterfilter (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Method for the calculation of the partial derivatives.

Default: 'facet'"facet"
List of values: 'facet', 'gauss'"facet", "gauss"

Sigmasigmasigma (input_control) real → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Sigma of the Gaussian. If Filterfilterfilter is ‘facet’, Sigmasigmasigma may be 0.0 to avoid the smoothing of the input image.

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
Restriction: Sigma >= 0.0

Thresholdthresholdthreshold (input_control) real → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Minimum absolute value of the eigenvalues of the Hessian matrix.

Default: 5.05.0
Suggested values: 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.02.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0
Restriction: Threshold >= 0.0

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

Row coordinates of the detected maxima.

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

Column coordinates of the detected maxima.

Result🔗

local_max_sub_pixLocalMaxSubPix 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, disp_crossDispCross

Alternatives

critical_points_sub_pixCriticalPointsSubPix, local_min_sub_pixLocalMinSubPix, saddle_points_sub_pixSaddlePointsSubPix

See also

local_maxLocalMax, plateausPlateaus, plateaus_centerPlateausCenter

Module🔗

Foundation