You are here: Start » AVL.NET » Function Reference » Image » Image Features » AVL.ImageLocalMaxima

AVL.ImageLocalMaxima

Finds image locations characterized by locally maximal pixel values.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void ImageLocalMaxima
(
	AvlNet.Image inImage,
	bool inConsiderPlateaus,
	float? inMinValue,
	float? inMaxValue,
	float inMinDistance,
	NullableRef<List<AvlNet.Extremum2D>> outLocalMaxima,
	NullableRef<SafeList<AvlNet.Region>> outMaximaRegions
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inConsiderPlateausboolConsider multi-pixel maxima (plateaus) or not.
inMinValuefloat?Minimal value of maximum to be considered. Default value: atl::NIL.
inMaxValuefloat?Maximal value of maximum to be considered. Default value: atl::NIL.
inMinDistancefloat<0.0f, INF>Minimal distance between two found maxima.
outLocalMaximaAvlNet.NullableRef<System.Collections.Generic.List<AvlNet.Extremum2D>>Found local maxima. Can be null to skip this parameter calculation.
outMaximaRegionsAvlNet.NullableRef<AvlNet.SafeList<AvlNet.Region>>Regions of local maxima (plateaus and singletons). Can be null to skip this parameter calculation.

Description

The operation finds local maxima on the image inImage within specific region inRoi.

It returns three arrays of the same length:

  • Subpixel precise positions of the maxima
  • Values of the maxima
  • Regions of equally bright pixels around the maxima

If the given image consists of more than one channel, they are averaged to obtain monochromatic image, so that the values of the extrema are of type float.

There are two types of local extrema:

  • Peak/hole: single pixel (strictly) brighter/darker than its neighbourhood (eight pixels). The extremum's position is determined with subpixel precision using gradient method with Sobel gradient. Returned region contains only one pixel.
  • Plateau/lowland: a connected set of equally bright pixels (strictly) brighter/darker from their neighbourhood. Returned position for this extremum is the center of mass of the plateau.

If parameter inConsiderPlateaus is set to true, the filter finds both types. Otherwise, it finds only strict maxima.

Parameter inMinValue determines the minimal value of the maximum to be considered.

Examples

Example image

Output for example image

Remarks

If a plateau/lowland is concave, it's center of mass may lie outside it. In such case, the value of the extremum (which is equal to the common value of its pixels) may be different from the value of pixel indicated by position of the extremum.

Errors

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in ImageLocalMaxima.

Function Overrides

See also