8 #ifndef META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_SHAPE_DETECTOR_H
9 #define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_SHAPE_DETECTOR_H
26 namespace TestDetector
53 RT_HORIZONTAL_AND_VERTICAL = 0u,
84 ERS_GRADIENT_TO_NEIGHBOR = 0u,
86 ERS_GRADIENT_TO_CENTER = 1u
97 MRS_SEPARATE_HORIZONTAL_VERTICAL = 1u,
99 MRS_SEPARATE_OPPOSITE_SIDE = 2u
139 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);
160 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);
176 GRS_MAX_ABSOLUTE_DIFFERENCE = 0u,
178 GRS_SUM_ABSOLUTE_DIFFERENCES = 1u,
189 BS_SEPARATE_AVERAGE = 1u,
191 BS_SEPARATE_MAX = 2u,
204 TS_BASED_ON_TOP_100_65 = 1u,
206 TS_BASED_ON_TOP_75_55 = 2u,
236 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);
259 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);
357 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);
382 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);
406 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);
430 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);
440 static bool test(
const double testDuration);
478 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< LShape > LShapes
Definition of a vector holding L-shape objects.
Definition: ShapeDetector.h:369
std::vector< TShape > TShapes
Definition of a vector holding T-shape objects.
Definition: ShapeDetector.h:374
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:1792
This class provides the ground truth implementation of the gradient-based T-detector.
Definition: TestShapeDetector.h:75
MinimalResponseStrategy
Definition of individual stategies to handle a minimal edge response.
Definition: TestShapeDetector.h:93
PenaltyUsage
Definition of individual penalty usages.
Definition: TestShapeDetector.h:106
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:82
This class provides the ground truth implementation of the gradient&variance-based T-detector.
Definition: TestShapeDetector.h:295
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:302
@ BS_SUBTRACT_AND_DIVIDE
The band variance is divided and subtracted.
Definition: TestShapeDetector.h:308
@ BS_DIVIDE
The band variance is divided.
Definition: TestShapeDetector.h:306
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:317
@ 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:323
@ 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:327
@ 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:325
@ 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:321
This class provides the ground truth implementation of the variance-based T-detector.
Definition: TestShapeDetector.h:167
GradientResponseStrategy
Definition of individual stategies to determine the gradient response.
Definition: TestShapeDetector.h:174
ThresholdStrategy
Definition of individual threshold strategies.
Definition: TestShapeDetector.h:200
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:185
This class implements tests for the Shape detector.
Definition: TestShapeDetector.h:34
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:43
ResponseVisualization
Definition of individual response visualization types.
Definition: TestShapeDetector.h:64
static bool test(const double testDuration)
Tests the shape detector functions.
ResponseType
Definition of indivdual response types.
Definition: TestShapeDetector.h:51
static bool testGradientVarianceBasedTShapeDetectorVerticalResponse(const double testDuration)
Test the vertical response of the gradient&variance-based T-shape detector.
CV::Detector::ShapeDetector::LShapes LShapes
Definition: TestShapeDetector.h:41
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:481
CV::Detector::ShapeDetector::TShapes TShapes
Definition: TestShapeDetector.h:42
static bool testGradientVarianceBasedTShapeDetector(const double testDuration)
Test the gradient&variance-based T-shape detector.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15