8#ifndef META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_SHAPE_DETECTOR_H
9#define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_SHAPE_DETECTOR_H
55 RT_HORIZONTAL_AND_VERTICAL = 0u,
86 ERS_GRADIENT_TO_NEIGHBOR = 0u,
88 ERS_GRADIENT_TO_CENTER = 1u
99 MRS_SEPARATE_HORIZONTAL_VERTICAL = 1u,
101 MRS_SEPARATE_OPPOSITE_SIDE = 2u
141 static void detectShapes(
const Frame& yFrame,
const double threshold,
const double responseMultiplicationFactor,
LShapes& lShapes,
TShapes& tShapes,
XShapes& xShapes,
const int sign,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double penaltyFactor,
const unsigned int minimalEdgeResponse,
const double nonMaximumSupressionRadius,
const EdgeResponseStrategy edgeResponseStrategy,
const MinimalResponseStrategy minimalResponseStrategy,
const PenaltyUsage penaltyUsage,
Frame* fResponseTopDown =
nullptr,
Frame* fResponseBottomUp =
nullptr);
162 static double tShapeDetectorResponse(
const Frame& yFrame,
const unsigned int x,
const unsigned int y,
const int sign,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double penaltyFactor,
const unsigned int minimalEdgeResponse,
const EdgeResponseStrategy edgeResponseStrategy,
const MinimalResponseStrategy minimalResponseStrategy,
const PenaltyUsage penaltyUsage);
178 GRS_MAX_ABSOLUTE_DIFFERENCE = 0u,
180 GRS_SUM_ABSOLUTE_DIFFERENCES = 1u,
191 BS_SEPARATE_AVERAGE = 1u,
193 BS_SEPARATE_MAX = 2u,
206 TS_BASED_ON_TOP_100_65 = 1u,
208 TS_BASED_ON_TOP_75_55 = 2u,
238 static void detectShapes(
const Frame& yFrame,
const double threshold,
const double responseMultiplicationFactor,
LShapes& lShapes,
TShapes& tShapes,
XShapes& xShapes,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double minimalGradient,
const double varianceFactor,
const double minimalVariance,
const double maximalRatio,
const double nonMaximumSupressionRadius,
const ThresholdStrategy thresholdStrategy,
const GradientResponseStrategy gradientResponseStrategy,
const BandStrategy bandStrategy,
Frame* fResponseTopDown =
nullptr,
Frame* fResponseBottomUp =
nullptr);
261 static double tShapeDetectorResponse(
const uint32_t* linedIntegral,
const uint64_t* linedIntegralSquared,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double minimalGradient,
const double varianceFactor,
const double minimalVariance,
const double maximalRatio,
const GradientResponseStrategy gradientResponseStrategy,
const BandStrategy bandStrategy);
359 static void detectShapes(
const Frame& yFrame,
const double threshold,
const double responseMultiplicationFactor,
LShapes& lShapes,
TShapes& tShapes,
XShapes& xShapes,
const int sign,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double minimalGradient,
const double maximalResponseRatio,
const BandStrategy bandStrategy,
const OptimizationStrategy optimizationStrategy,
const double nonMaximumSupressionRadius,
Frame* fResponseTopDown =
nullptr,
Frame* fResponseBottomUp =
nullptr);
384 static void detectShapesModified(
const Frame& yFrame,
const double threshold,
const double responseMultiplicationFactor,
LShapes& lShapes,
TShapes& tShapes,
XShapes& xShapes,
const int sign,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double minimalGradient,
const double maximalResponseRatio,
const BandStrategy bandStrategy,
const double nonMaximumSupressionRadius,
Frame* fResponseTopDown =
nullptr,
Frame* fResponseBottomUp =
nullptr);
408 static double tShapeDetectorResponse(
const uint32_t* linedIntegral,
const uint64_t* linedIntegralSquared,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y,
const int sign,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double minimalGradient,
const double maximalResponseRatio,
const BandStrategy bandStrategy,
const OptimizationStrategy optimizationStrategy,
double* horizontalResponse =
nullptr,
double* verticalResponse =
nullptr);
432 static double tShapeDetectorResponseModified(
const uint32_t* linedIntegral,
const uint64_t* linedIntegralSquared,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y,
const int sign,
const unsigned int shapeWidth,
const unsigned int shapeHeight,
const unsigned int shapeStepSize,
const unsigned int shapeTopBand,
const unsigned int shapeBottomBand,
const ResponseType responseType,
const double minimalGradient,
const double maximalResponseRatio,
const BandStrategy bandStrategy,
double* horizontalResponse =
nullptr,
double* verticalResponse =
nullptr);
481 static inline bool compareTshapes(
const TShape& left,
const TShape& right);
This class implements an L-shape element like a corner of a rectangle.
Definition ShapeDetector.h:175
This class implements a shape detector based on gradients and variance.
Definition ShapeDetector.h:503
This class implements a T-shape element like a junction connecting two lines, with one line having th...
Definition ShapeDetector.h:249
Scalar score() const
Returns the sore of this shape.
Definition ShapeDetector.h:1081
This class implements a X-shape element like a crossing of two lines, with both lines not crossing ne...
Definition ShapeDetector.h:302
std::vector< TShape > TShapes
Definition of a vector holding T-shape objects.
Definition ShapeDetector.h:374
std::vector< LShape > LShapes
Definition of a vector holding L-shape objects.
Definition ShapeDetector.h:369
std::vector< XShape > XShapes
Definition of a vector holding X-shape objects.
Definition ShapeDetector.h:379
This class implements Ocean's image class.
Definition Frame.h:1879
This class provides the ground truth implementation of the gradient-based T-detector.
Definition TestShapeDetector.h:77
MinimalResponseStrategy
Definition of individual stategies to handle a minimal edge response.
Definition TestShapeDetector.h:95
PenaltyUsage
Definition of individual penalty usages.
Definition TestShapeDetector.h:108
static void detectShapes(const Frame &yFrame, const double threshold, const double responseMultiplicationFactor, LShapes &lShapes, TShapes &tShapes, XShapes &xShapes, const int sign, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double penaltyFactor, const unsigned int minimalEdgeResponse, const double nonMaximumSupressionRadius, const EdgeResponseStrategy edgeResponseStrategy, const MinimalResponseStrategy minimalResponseStrategy, const PenaltyUsage penaltyUsage, Frame *fResponseTopDown=nullptr, Frame *fResponseBottomUp=nullptr)
Detects shapes in a given image.
static double tShapeDetectorResponse(const Frame &yFrame, const unsigned int x, const unsigned int y, const int sign, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double penaltyFactor, const unsigned int minimalEdgeResponse, const EdgeResponseStrategy edgeResponseStrategy, const MinimalResponseStrategy minimalResponseStrategy, const PenaltyUsage penaltyUsage)
Determines the gradient-based T-shape detector response.
EdgeResponseStrategy
Definition of individual stategies to determine edge response.
Definition TestShapeDetector.h:84
This class provides the ground truth implementation of the gradient&variance-based T-detector.
Definition TestShapeDetector.h:297
static void detectShapesModified(const Frame &yFrame, const double threshold, const double responseMultiplicationFactor, LShapes &lShapes, TShapes &tShapes, XShapes &xShapes, const int sign, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double minimalGradient, const double maximalResponseRatio, const BandStrategy bandStrategy, const double nonMaximumSupressionRadius, Frame *fResponseTopDown=nullptr, Frame *fResponseBottomUp=nullptr)
Detects modified shapes in a given image.
static void detectShapes(const Frame &yFrame, const double threshold, const double responseMultiplicationFactor, LShapes &lShapes, TShapes &tShapes, XShapes &xShapes, const int sign, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double minimalGradient, const double maximalResponseRatio, const BandStrategy bandStrategy, const OptimizationStrategy optimizationStrategy, const double nonMaximumSupressionRadius, Frame *fResponseTopDown=nullptr, Frame *fResponseBottomUp=nullptr)
Detects standard shapes in a given image.
BandStrategy
Definition of individual band strategies.
Definition TestShapeDetector.h:304
@ BS_SUBTRACT_AND_DIVIDE
The band variance is divided and subtracted.
Definition TestShapeDetector.h:310
@ BS_DIVIDE
The band variance is divided.
Definition TestShapeDetector.h:308
static double tShapeDetectorResponse(const uint32_t *linedIntegral, const uint64_t *linedIntegralSquared, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y, const int sign, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double minimalGradient, const double maximalResponseRatio, const BandStrategy bandStrategy, const OptimizationStrategy optimizationStrategy, double *horizontalResponse=nullptr, double *verticalResponse=nullptr)
Determines the gradient&variance-based T-shape detector response.
static double tShapeDetectorResponseModified(const uint32_t *linedIntegral, const uint64_t *linedIntegralSquared, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y, const int sign, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double minimalGradient, const double maximalResponseRatio, const BandStrategy bandStrategy, double *horizontalResponse=nullptr, double *verticalResponse=nullptr)
Determines the gradient&variance-based T-shape detector response.
OptimizationStrategy
Definition of individual optimization strategies.
Definition TestShapeDetector.h:319
@ OS_SYMMETRIC_RESPONSES_FOUR_HORIZONTAL_DIFFERENT_VERTICAL
Applying symmetric responses to allow response recycling, top and bottom band need to be identical,...
Definition TestShapeDetector.h:325
@ OS_SYMMETRIC_RESPONSES_TWO_HORIZONTAL_DIFFERENT_VERTICAL
Applying symmetric responses to allow response recycling, top and bottom band need to be identical,...
Definition TestShapeDetector.h:329
@ OS_SYMMETRIC_RESPONSES_TWO_HORIZONTAL_SAME_VERTICAL
Applying symmetric responses to allow response recycling, top and bottom band need to be identical,...
Definition TestShapeDetector.h:327
@ OS_SYMMETRIC_RESPONSES_FOUR_HORIZONTAL_SAME_VERTICAL
Applying symmetric responses to allow response recycling, top and bottom band need to be identical,...
Definition TestShapeDetector.h:323
This class provides the ground truth implementation of the variance-based T-detector.
Definition TestShapeDetector.h:169
GradientResponseStrategy
Definition of individual stategies to determine the gradient response.
Definition TestShapeDetector.h:176
ThresholdStrategy
Definition of individual threshold strategies.
Definition TestShapeDetector.h:202
static void detectShapes(const Frame &yFrame, const double threshold, const double responseMultiplicationFactor, LShapes &lShapes, TShapes &tShapes, XShapes &xShapes, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double minimalGradient, const double varianceFactor, const double minimalVariance, const double maximalRatio, const double nonMaximumSupressionRadius, const ThresholdStrategy thresholdStrategy, const GradientResponseStrategy gradientResponseStrategy, const BandStrategy bandStrategy, Frame *fResponseTopDown=nullptr, Frame *fResponseBottomUp=nullptr)
Detects shapes in a given image.
static double tShapeDetectorResponse(const uint32_t *linedIntegral, const uint64_t *linedIntegralSquared, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y, const unsigned int shapeWidth, const unsigned int shapeHeight, const unsigned int shapeStepSize, const unsigned int shapeTopBand, const unsigned int shapeBottomBand, const ResponseType responseType, const double minimalGradient, const double varianceFactor, const double minimalVariance, const double maximalRatio, const GradientResponseStrategy gradientResponseStrategy, const BandStrategy bandStrategy)
Determines the gradient-based T-shape detector response.
BandStrategy
Definition of individual band strategies.
Definition TestShapeDetector.h:187
This class implements tests for the Shape detector.
Definition TestShapeDetector.h:36
static bool testGradientVarianceBasedTShapeDetectorHorizontalResponse(const double testDuration)
Test the horizontal response of the gradient&variance-based T-shape detector.
static bool testGradientBasedTShapeDetector(const double testDuration)
Test the gradient-based T-shape detector.
CV::Detector::ShapeDetector::XShapes XShapes
Definition TestShapeDetector.h:45
ResponseVisualization
Definition of individual response visualization types.
Definition TestShapeDetector.h:66
ResponseType
Definition of indivdual response types.
Definition TestShapeDetector.h:53
static bool testGradientVarianceBasedTShapeDetectorVerticalResponse(const double testDuration)
Test the vertical response of the gradient&variance-based T-shape detector.
static bool test(const double testDuration, const TestSelector &selector)
Tests the shape detector functions.
CV::Detector::ShapeDetector::LShapes LShapes
Definition TestShapeDetector.h:43
static bool compareTshapes(const TShape &left, const TShape &right)
Compares two T-shapes and returns whether the left shape has a higher score.
Definition TestShapeDetector.h:484
CV::Detector::ShapeDetector::TShapes TShapes
Definition TestShapeDetector.h:44
static bool testGradientVarianceBasedTShapeDetector(const double testDuration)
Test the gradient&variance-based T-shape detector.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15