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

ProfileLocalExtrema
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Finds the locations at which the values of the input profile are locally highest or lowest.
Syntax
void fil::ProfileLocalExtrema ( const fil::Profile& inProfile, ftl::Optional<const fil::Range&> inRange, const bool inCyclic, const fil::ExtremumType::Type inExtremumType, fil::ProfileInterpolationMethod::Type inInterpolationMethod, const bool inConsiderPlateaus, ftl::Optional<float> inMinValue, ftl::Optional<float> inMaxValue, ftl::Optional<const fil::LocalBlindness&> inLocalBlindness, ftl::Array<fil::Extremum1D>& outLocalExtrema )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inProfile | const Profile& | Input profile | |
![]() |
inRange | Optional<const Range&> | NIL | |
![]() |
inCyclic | const bool | Indicates whether the last element should be considered a neighbour of the first element | |
![]() |
inExtremumType | const ExtremumType::Type | Type of extremum to find | |
![]() |
inInterpolationMethod | ProfileInterpolationMethod::Type | Quadratic4 | When interpolation is set to Quadratic each non-plateau extremum is located using a parabola fit |
![]() |
inConsiderPlateaus | const bool | True | Indicates whether the result should include centers of plateau extrema |
![]() |
inMinValue | Optional<float> | NIL | Minimum value of an extremum |
![]() |
inMaxValue | Optional<float> | NIL | Maximum value of an extremum |
![]() |
inLocalBlindness | Optional<const LocalBlindness&> | NIL | Defines conditions in which weaker extrema can be detected in the vicinity of stronger ones |
![]() |
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. |