Back to Aurora Vision Library website

You are here: Start » Function Reference » Profile » Profile Features » ProfileLocalExtrema

ProfileLocalExtrema


Header: AVL.h
Namespace: avl
Module: FoundationPro

Finds the locations at which the values of the input profile are locally highest or lowest.

Syntax

C++
C#
 
void avl::ProfileLocalExtrema
(
	const avl::Profile& inProfile,
	atl::Optional<const avl::Range&> inRange,
	const bool inCyclic,
	const avl::ExtremumType::Type inExtremumType,
	avl::ProfileInterpolationMethod::Type inInterpolationMethod,
	const bool inConsiderPlateaus,
	atl::Optional<float> inMinValue,
	atl::Optional<float> inMaxValue,
	atl::Optional<const avl::LocalBlindness&> inLocalBlindness,
	atl::Array<avl::Extremum1D>& outLocalExtrema
)

Parameters

Name Type Default Description
Input value inProfile const Profile& Input profile
Input value inRange Optional<const Range&> NIL
Input value inCyclic const bool Indicates whether the last element should be considered a neighbour of the first element
Input value inExtremumType const ExtremumType::Type Type of extremum to find
Input value inInterpolationMethod ProfileInterpolationMethod::Type Quadratic4 When interpolation is set to Quadratic each non-plateau extremum is located using a parabola fit
Input value inConsiderPlateaus const bool True Indicates whether the result should include centers of plateau extrema
Input value inMinValue Optional<float> NIL Minimum value of an extremum
Input value inMaxValue Optional<float> NIL Maximum value of an extremum
Input value inLocalBlindness Optional<const LocalBlindness&> NIL Defines conditions in which weaker extrema can be detected in the vicinity of stronger ones
Output value outLocalExtrema Array<Extremum1D>& Extrema of the profile values

Description

The operation returns locations where the profile values are locally extremal, i.e. maximal or minimal, depending on the inExtremumType parameter. If the inConsiderPlateaus parameter is set to true, the same-value-ranges of the input profile will also be detected. The inMinValue and inMaxValue parameters control how strong an extremum has to be to be a part of the result. The inLocalBlindness parameter allows to have an even better control over the results of the filter. Its fields define a set of conditions in which weaker extrema can be detected in the vicinity of stronger extrema. When e.g. a maximum of value 50 is present at location 35 and another maximum of value 40 is present at location 28, the local blindness with the threshold bigger than 0.8 and the radius not smaller than 7 will suppress the weaker maximum. For minimum, the threshold works as a reciprocal, i.e. under a local blindness with the threshold equal to 0.8 the minimum with value 20 could suppress another minimum with value 26, but not a minimum with value 24. It should be noted that the inLocalBlindness parameter has no effect at all when inExtremumType is set to Any. When some profile values are negative, setting inLocalBlindness leads to undefined results.

Errors

List of possible exceptions:

Error type Description
DomainError Range exceeds the input profile in ProfileLocalExtrema.