8 #ifndef META_OCEAN_TEST_TESTCV_TESTSEGMENTATION_TEST_MASK_ANALYZER_H
9 #define META_OCEAN_TEST_TESTCV_TESTSEGMENTATION_TEST_MASK_ANALYZER_H
28 namespace TestSegmentation
40 template <
typename TDistanceType>
46 typedef std::unordered_set<CV::PixelBoundingBox, CV::PixelBoundingBox>
BoundingBoxSet;
63 static bool test(
const unsigned int width,
const unsigned int height,
const double testDuration,
Worker& worker);
256 template <
typename TDistanceType>
330 template <
typename TDistanceType>
331 static bool validateComputeDistanceTransform8Bit(
const uint8_t* source,
const uint32_t width,
const uint32_t height,
const TDistanceType* validationTarget,
const bool validationTargetStatus,
const TDistanceType distanceVerticalHorizontal,
const TDistanceType distanceDiagonal,
const uint8_t referenceValue,
const uint32_t sourcePaddingElements = 0u,
const uint32_t validationTargetPaddingElements = 0u);
This class implements functions analyzing masks, determining specific pixels in relation to masks and...
Definition: segmentation/MaskAnalyzer.h:39
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a generator for random numbers.
Definition: RandomGenerator.h:42
This class implements a mask analyzer test.
Definition: testsegmentation/TestMaskAnalyzer.h:36
static bool validateFindBorderPixels4(const Frame &mask, const CV::PixelBoundingBox &boundingBox, const CV::PixelPositions &borderPixels)
Validates the find border pixels in a 4-neighborhood function.
std::unordered_set< CV::PixelBoundingBox, CV::PixelBoundingBox > BoundingBoxSet
Definition of an unordered set holding bounding boxes.
Definition: testsegmentation/TestMaskAnalyzer.h:46
static bool testFindNonUniquePixels8(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests the non-unique pixels in an 8-neighborhood function.
static bool testHasMaskNeighbor9Center(const double testDuration)
Tests the has mask neighbor-9 center function.
static bool testHasMaskNeighbor5Center(const double testDuration)
Tests the has mask neighbor-5 center function.
static bool testFindBorderPixels8(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests the find border pixels in an 8-neighborhood function.
static bool validateFindNonUniquePixels4(const Frame &mask, const CV::PixelBoundingBox &boundingBox, const CV::PixelPositions &nonUniquePixels)
Validates the find non-unique pixels in a 4-neighborhood function.
static bool testComputeDistanceTransform8Bit(const uint32_t width, const uint32_t height, ComputeDistanceTransformFunctionPointer< TDistanceType > computeDistanceTransformPtr, const TDistanceType distanceVerticalHorizontal, const TDistanceType distanceDiagonal, const double testDuration)
Test for distance transform functions.
static bool testHasMaskNeighbor8(const double testDuration)
Tests the has mask neighbor-8 function.
static bool testCountMaskPixels(const double testDuration)
Tests the count mask pixels functions.
static bool testFindOutlinePixels4(const unsigned int width, const unsigned int height, const double testDuration)
Tests the outline pixels in a 4-neighborhood function.
static bool validateFindNonUniquePixels8(const Frame &mask, const CV::PixelBoundingBox &boundingBox, const CV::PixelPositions &nonUniquePixels)
Validates the find non-unique pixels in an 8-neighborhood function.
static bool validateComputeDistanceTransform8Bit(const uint8_t *source, const uint32_t width, const uint32_t height, const TDistanceType *validationTarget, const bool validationTargetStatus, const TDistanceType distanceVerticalHorizontal, const TDistanceType distanceDiagonal, const uint8_t referenceValue, const uint32_t sourcePaddingElements=0u, const uint32_t validationTargetPaddingElements=0u)
Validation function for the distance transform function.
static bool testComputeL2DistanceTransform8Bit(const uint32_t width, const uint32_t height, const double testDuration)
Test the distance transformations that uses the approximated L2 distance.
static bool testDetermineDistancesToBorder(const double testDuration, Worker &worker)
Tests the distance to border function.
static bool validateFindBorderPixels8(const Frame &mask, const CV::PixelBoundingBox &boundingBox, const CV::PixelPositions &borderPixels)
Validates the find border pixels in an 8-neighborhood function.
bool(*)(const uint8_t *, const uint32_t, const uint32_t, TDistanceType *, uint32_t *, const uint8_t, const uint32_t, const uint32_t) ComputeDistanceTransformFunctionPointer
Function pointer for distance transform the functions CV::Segmentation::MaskAnalyzer::compute{C,...
Definition: testsegmentation/TestMaskAnalyzer.h:41
static bool testComputeChessboardDistanceTransform8Bit(const uint32_t width, const uint32_t height, const double testDuration)
Test the distance transformations that uses the chessboard distance.
static bool testHasMaskNeighbor4(const double testDuration)
Tests the has mask neighbor-4 function.
static bool testHasMaskNeighbor4Center(const double testDuration)
Tests the has mask neighbor-4 center function.
static bool validateDetermineDistancesToBorder(const Frame &mask, const Frame &distance, const unsigned int maximalDistance, const bool assignFinal)
Validates the distance to border function.
static bool testHasMaskNeighbor9(const double testDuration)
Tests the has mask neighbor-9 function.
static bool testFindNonUniquePixels4(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests the non-unique pixels in a 4-neighborhood function.
static bool testFindBorderPixels4(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests the find border pixels in a 4-neighborhood function.
static bool testHasMaskNeighbor5(const double testDuration)
Tests the has mask neighbor-5 function.
static Frame generateTestMask(RandomGenerator &randomGenerator, const unsigned int width, const unsigned int height, const uint8_t maskValue=0x00u, const uint8_t nonMaskValue=0xFFu)
Generates test data for the mask analyzer tests This will generate a white mask frame with a black cr...
static bool testDetectBoundingBoxes(const double testDuration)
Test the determine bounding boxes function.
static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests all mask analyzer functions.
static bool testHasMaskNeighbor8Center(const double testDuration)
Tests the has mask neighbor-8 center function.
std::unordered_set< CV::PixelPosition, CV::PixelPosition > PixelPositionSet
Definition of an unordered set holding pixel positions boxes.
Definition: testsegmentation/TestMaskAnalyzer.h:51
static bool testComputeL1DistanceTransform8Bit(const uint32_t width, const uint32_t height, const double testDuration)
Test the distance transformations that uses the L1 distance.
static bool testDetermineDistancesToBorder(const unsigned int width, const unsigned int height, const double testDuration, const unsigned int maximalDistance, Worker &worker)
Tests the distance to border function.
static bool validateFindOutlinePixels4(const Frame &mask, const CV::PixelBoundingBox &boundingBox, const CV::PixelPositions &outlinePixels, const uint8_t nonMaskValue)
Validates the find outline pixels in a 4-neighborhood function.
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
std::vector< PixelPosition > PixelPositions
Definition of a vector holding pixel positions (with positive coordinate values).
Definition: PixelPosition.h:48
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15