This class implements the possibility to find local maximum in a 2D array by applying a non-maximum-suppression search.
More...
|
template<typename TCoordinate , typename TStrength > |
using | StrengthPositions = std::vector< StrengthPosition< TCoordinate, TStrength > > |
| Definition of a vector holding strength pixel positions. More...
|
|
template<typename TCoordinate , typename TStrength > |
using | PositionCallback = Callback< bool, const unsigned int, const unsigned int, const T, TCoordinate &, TCoordinate &, TStrength & > |
| Definition of a callback function used to determine the precise sub-pixel position of a specific point. More...
|
|
|
| NonMaximumSuppression (NonMaximumSuppression< T > &&nonMaximumSuppression) noexcept |
| Move constructor. More...
|
|
| NonMaximumSuppression (const NonMaximumSuppression< T > &nonMaximumSuppression) noexcept |
| Copy constructor. More...
|
|
| NonMaximumSuppression (const unsigned int width, const unsigned int height, const unsigned int yOffset=0u) noexcept |
| Creates a new maximum suppression object with a predefined size. More...
|
|
unsigned int | width () const |
| Returns the width of this object. More...
|
|
unsigned int | height () const |
| Returns the height of this object. More...
|
|
unsigned int | yOffset () const |
| Returns the optional offset in the vertical direction. More...
|
|
void | addCandidate (const unsigned int x, const unsigned int y, const T &strength) |
| Adds a new candidate to this object. More...
|
|
void | addCandidates (const T *values, const unsigned int valuesPaddingElements, const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows, const T &minimalThreshold, Worker *worker) |
| Adds new candidates to this object from a given buffer providing one value for each bin/pixel of this object. More...
|
|
void | removeCandidatesRightFrom (const unsigned int x, const unsigned int y) |
| Removes all candidates from a specified row having a horizontal location equal or larger than a specified coordinate. More...
|
|
template<typename TCoordinate , typename TStrength , bool tStrictMaximum = true> |
StrengthPositions< TCoordinate, TStrength > | suppressNonMaximum (const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows, Worker *worker=nullptr, const PositionCallback< TCoordinate, TStrength > *positionCallback=nullptr) const |
| Applies a non-maximum-suppression search on a given 2D frame in a 3x3 neighborhood (eight neighbors). More...
|
|
void | reset () |
| Removes the gathered non-maximum suppression information so that this object can be reused again (for the same task with same resolution etc.). More...
|
|
NonMaximumSuppression< T > & | operator= (NonMaximumSuppression< T > &&nonMaximumSuppression) |
| Move operator. More...
|
|
NonMaximumSuppression< T > & | operator= (const NonMaximumSuppression< T > &nonMaximumSuppression) |
| Copy operator. More...
|
|
template<typename TCoordinate , typename TStrength , bool tStrictMaximum> |
NonMaximumSuppression< T >::template StrengthPositions< TCoordinate, TStrength > | suppressNonMaximum (const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows, Worker *worker, const PositionCallback< TCoordinate, TStrength > *positionCallback) const |
|
template<typename TCoordinate , typename TStrength , bool tStrictMaximum> |
NonMaximumSuppression< T >::template StrengthPositions< TCoordinate, TStrength > | suppressNonMaximum (const unsigned int width, const unsigned int height, const StrengthPositions< TCoordinate, TStrength > &strengthPositions, const TCoordinate radius, Indices32 *validIndices) |
|
|
template<typename TCoordinate , typename TStrength , bool tStrictMaximum> |
static StrengthPositions< TCoordinate, TStrength > | suppressNonMaximum (const unsigned int width, const unsigned int height, const StrengthPositions< TCoordinate, TStrength > &strengthPositions, const TCoordinate radius, Indices32 *validIndices=nullptr) |
| Applies a non-maximum-suppression based on already existing strength positions (just with a custom suppression radius) e.g., as a post-processing step. More...
|
|
template<typename TFloat > |
static bool | determinePrecisePeakLocation1 (const T &leftValue, const T &middleValue, const T &rightValue, TFloat &location) |
| Determines the precise peak location in 1D space for three discrete neighboring measurements at location x == 0. More...
|
|
template<typename TFloat > |
static bool | determinePrecisePeakLocation2 (const T *const topValues, const T *const centerValues, const T *const bottomValues, VectorT2< TFloat > &location) |
| Determines the precise peak location in 2D space for nine discrete neighboring measurements at location x == 0, y == 0. More...
|
|
|
void | addCandidatesSubset (const T *values, const unsigned int valuesStrideElements, const unsigned int firstColumn, const unsigned int numberColumns, const T *minimalThreshold, const unsigned int firstRow, const unsigned int numberRows) |
| Adds new candidates to this object from a subset of a given buffer providing one value for each bin/pixel of this object. More...
|
|
template<typename TCoordinate , typename TStrength , bool tStrictMaximum> |
void | suppressNonMaximumSubset (StrengthPositions< TCoordinate, TStrength > *strengthPositions, const unsigned int firstColumn, const unsigned int firstRow, Lock *lock, const PositionCallback< TCoordinate, TStrength > *positionCallback, const unsigned int numberColumns, const unsigned int numberRows) const |
| Applies a non-maximum-suppression search on a subset of a given 2D frame in a 3x3 neighborhood (eight neighbors). More...
|
|
template<typename T>
class Ocean::CV::NonMaximumSuppression< T >
This class implements the possibility to find local maximum in a 2D array by applying a non-maximum-suppression search.
The search is done within a 3x3 neighborhood (centered around the point of interest).
Use this class to determine e.g. reliable feature points.
The class supports bin accuracy (pixel accuracy) and sub-bin accuracy (sub-pixel accuracy).
The non-maximum-suppression search is implemented by a vertical list holding maps of horizontal array elements.
The performance depends on the number of elements inserted into the individual maps.
Thus, do not add data elements with negligible value.
It should be mentioned that the application of this class should be restricted to situations in which the entire filter response values do not exist already.
The performance boost comes with a simultaneous determination of filter responses and the insertion of possible candidates for maximum locations.
- Template Parameters
-
T | The data type of the individual elements that are applied for the non-maximum-suppression search. |
template<typename T >
template<typename TCoordinate , typename TStrength , bool tStrictMaximum = true>
Applies a non-maximum-suppression search on a given 2D frame in a 3x3 neighborhood (eight neighbors).
This function allows to determine the precise position of the individual maximum value positions by application of a callback function determining the individual positions.
- Parameters
-
firstColumn | First column to be handled, with range [1, width() - 1) |
numberColumns | Number of columns to be handled |
firstRow | First row to be handled, with range [yOffset() + 1, height() - 1) |
numberRows | Number of rows to be handled |
worker | Optional worker object to distribute the computation |
positionCallback | Optional callback function allowing to determine the precise position of the individual maximum value positions |
- Returns
- Resulting non maximum suppressed positions including the strength parameters
- Template Parameters
-
TCoordinate | The data type of a scalar coordinate |
TStrength | The data type of the strength parameter |
tStrictMaximum | True, to search for a strict maximum (larger than all eight neighbors); False, to allow equal values in the upper left neighborhood |
template<typename T >
template<typename TCoordinate , typename TStrength , bool tStrictMaximum>
void Ocean::CV::NonMaximumSuppression< T >::suppressNonMaximumSubset |
( |
StrengthPositions< TCoordinate, TStrength > * |
strengthPositions, |
|
|
const unsigned int |
firstColumn, |
|
|
const unsigned int |
firstRow, |
|
|
Lock * |
lock, |
|
|
const PositionCallback< TCoordinate, TStrength > * |
positionCallback, |
|
|
const unsigned int |
numberColumns, |
|
|
const unsigned int |
numberRows |
|
) |
| const |
|
private |
Applies a non-maximum-suppression search on a subset of a given 2D frame in a 3x3 neighborhood (eight neighbors).
This function allows to determine the precise position of the individual maximum value positions by application of a callback function determining the individual positions.
- Parameters
-
strengthPositions | Resulting non maximum suppressed positions including the strength parameters |
firstColumn | First column to be handled |
numberColumns | Number of columns to be handled |
lock | The lock object that must be defined if this function is executed in parallel on several threads |
positionCallback | Optional callback function allowing to determine the precise position of the individual maximum value positions |
firstRow | First row to be handled |
numberRows | Number of rows to be handled |
- Template Parameters
-
tStrictMaximum | True, to search for a strict maximum (larger than all eight neighbors); False, to allow equal values in the upper left neighborhood |