8 #ifndef META_OCEAN_TEST_TESTCV_TEST_NON_MAXIMUM_SUPPRESSION_H
9 #define META_OCEAN_TEST_TESTCV_TEST_NON_MAXIMUM_SUPPRESSION_H
60 static bool test(
const unsigned int width,
const unsigned int height,
const double testDuration,
Worker& worker);
73 static bool testSuppressionInFrame(
const unsigned int width,
const unsigned int height,
const unsigned int subFrameWidth,
const unsigned int subFrameHeight,
const bool strictMaximum,
const double testDuration,
Worker& worker);
89 template <
typename TCoordinate,
typename TStrength>
105 template <
typename T>
130 static inline StrengthPositions determineFeaturePoints(
const Frame& yFrame,
const unsigned int subRegionLeft,
const unsigned int subRegionTop,
const unsigned int subRegionWidth,
const unsigned int subRegionHeight,
const uint8_t minimalThreshold,
const bool strictMaximum,
Worker* worker =
nullptr);
144 static void determineFeaturePointsSubset(
const Frame* yFrame,
const uint8_t minimalThreshold,
const bool strictMaximum,
Lock* lock,
StrengthPositions* locations,
const unsigned int firstColumn,
const unsigned int numberColumns,
const unsigned int firstRow,
const unsigned int numberRows);
150 ocean_assert(subRegionLeft + subRegionWidth <= yFrame.
width() && subRegionTop + subRegionHeight <= yFrame.
height());
152 const unsigned int firstColumn = std::max(1u, subRegionLeft);
153 const unsigned int firstRow = std::max(1u, subRegionTop);
155 const unsigned int endColumn = std::min(subRegionLeft + subRegionWidth, yFrame.
width() - 1u);
156 const unsigned int endRow = std::min(subRegionTop + subRegionHeight, yFrame.
height() - 1u);
158 const unsigned int numberColumns = endColumn - firstColumn;
159 const unsigned int numberRows = endRow - firstRow;
166 worker->
executeFunction(
Worker::Function::createStatic(&
determineFeaturePointsSubset, &yFrame, minimalThreshold, strictMaximum, &lock, &result, firstColumn, numberColumns, 0u, 0u), firstRow, numberRows);
170 determineFeaturePointsSubset(&yFrame, minimalThreshold, strictMaximum,
nullptr, &result, firstColumn, numberColumns, firstRow, numberRows);
This class extends a 2D position by a third parameter storing a strength value.
Definition: NonMaximumSuppression.h:51
static Caller< void > createStatic(typename StaticFunctionPointerMaker< void, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass >::Type function)
Creates a new caller container for a static function with no function parameter.
Definition: Caller.h:2876
This class implements Ocean's image class.
Definition: Frame.h:1792
bool isValid() const
Returns whether this frame is valid.
Definition: Frame.h:4448
@ FORMAT_Y8
Pixel format for grayscale images with byte order Y and 8 bits per pixel.
Definition: Frame.h:594
unsigned int width() const
Returns the width of the frame format in pixel.
Definition: Frame.h:3143
PixelFormat pixelFormat() const
Returns the pixel format of the frame.
Definition: Frame.h:3153
unsigned int height() const
Returns the height of the frame in pixel.
Definition: Frame.h:3148
This class implements a recursive lock object.
Definition: Lock.h:31
This class tests the implementation of the NonMaximumSuppression class.
Definition: TestNonMaximumSuppression.h:32
std::vector< StrengthPosition > StrengthPositions
Definition of a vector holding locations.
Definition: TestNonMaximumSuppression.h:43
CV::NonMaximumSuppression< uint8_t >::StrengthPosition< int, uint8_t > StrengthPosition
Definition of a location combining a strength parameter.
Definition: TestNonMaximumSuppression.h:38
static bool testSuppressionInFrame(const unsigned int width, const unsigned int height, const unsigned int subFrameWidth, const unsigned int subFrameHeight, const bool strictMaximum, const double testDuration, Worker &worker)
Tests the non maximum suppression within a frame.
static void determineFeaturePointsSubset(const Frame *yFrame, const uint8_t minimalThreshold, const bool strictMaximum, Lock *lock, StrengthPositions *locations, const unsigned int firstColumn, const unsigned int numberColumns, const unsigned int firstRow, const unsigned int numberRows)
Determines the locations of the extrema by a standard implementation.
static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests the entire functionality.
static bool testSuppressionInStrengthPositions(const double testDuration)
Tests the non maximum suppression within a dataset of strength positions.
static bool testDeterminePrecisePeakLocation1()
Tests the 1D precise peak location function.
std::set< StrengthPosition > StrengthPositionSet
Definition of a set holding locations.
Definition: TestNonMaximumSuppression.h:48
static StrengthPositions determineFeaturePoints(const Frame &yFrame, const unsigned int subRegionLeft, const unsigned int subRegionTop, const unsigned int subRegionWidth, const unsigned int subRegionHeight, const uint8_t minimalThreshold, const bool strictMaximum, Worker *worker=nullptr)
Determines the locations of the extrema by a standard implementation.
Definition: TestNonMaximumSuppression.h:147
static void createFeaturePoints(Frame &yFrame, const unsigned int features, const uint8_t featurePointStrength=255u)
Creates a test frame with artificial feature points.
static bool testSuppressionInStrengthPositions(const double testDuration)
Tests the non maximum suppression within a dataset of strength positions.
static bool testDeterminePrecisePeakLocation2()
Tests the 2D precise peak location function.
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
bool executeFunction(const Function &function, const unsigned int first, const unsigned int size, const unsigned int firstIndex=(unsigned int)(-1), const unsigned int sizeIndex=(unsigned int)(-1), const unsigned int minimalIterations=1u, const unsigned int threadIndex=(unsigned int)(-1))
Executes a callback function separable by two function parameters.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15