8#ifndef META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_SHAPE_DETECTOR_H
9#define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_SHAPE_DETECTOR_H
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);
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);
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:1078
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:1969
This class provides the ground truth implementation of the gradient-based T-detector.
Definition TestShapeDetector.h:77
MinimalResponseStrategy
Definition of individual strategies to handle a minimal edge response.
Definition TestShapeDetector.h:95
@ MRS_IGNORE
The minimal response is ignored.
Definition TestShapeDetector.h:97
@ MRS_SEPARATE_HORIZONTAL_VERTICAL
The minimal response is checked separately across the horizontal and vertical edge responses.
Definition TestShapeDetector.h:99
@ MRS_SEPARATE_OPPOSITE_SIDE
The minimal response is checked separately across opposite edges.
Definition TestShapeDetector.h:101
PenaltyUsage
Definition of individual penalty usages.
Definition TestShapeDetector.h:108
@ PU_DIVISION
The penalty is used to normalize the edge response (by division).
Definition TestShapeDetector.h:112
@ PU_SUBTRACT
The penalty is subtracted from the edge response.
Definition TestShapeDetector.h:110
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 strategies to determine edge response.
Definition TestShapeDetector.h:84
@ ERS_GRADIENT_TO_CENTER
The edge gradient (vertical and horizontal) is determine between the edge pixel and the center pixel.
Definition TestShapeDetector.h:88
@ ERS_GRADIENT_TO_NEIGHBOR
The edge gradient (vertical and horizontal) is determined between the edge pixel and the direct neigh...
Definition TestShapeDetector.h:86
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_END
Last (exclusive) band strategy value.
Definition TestShapeDetector.h:312
@ BS_SUBTRACT_AND_DIVIDE
The band variance is divided and subtracted.
Definition TestShapeDetector.h:310
@ BS_SKIP
The band variance is not used.
Definition TestShapeDetector.h:306
@ 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_NONE
No optimization.
Definition TestShapeDetector.h:321
@ 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_END
Last (exclusive) optimization strategy value.
Definition TestShapeDetector.h:331
@ 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 strategies to determine the gradient response.
Definition TestShapeDetector.h:176
@ GRS_MAX_ABSOLUTE_DIFFERENCE
The foreground response is based on the maximum absolute difference.
Definition TestShapeDetector.h:178
@ GRS_SUM_ABSOLUTE_DIFFERENCES
The foreground response is based on the sum of absolute differences.
Definition TestShapeDetector.h:180
ThresholdStrategy
Definition of individual threshold strategies.
Definition TestShapeDetector.h:202
@ TS_BASED_ON_TOP_100_65
The threshold is based on 65% of the sorted top 100 shapes.
Definition TestShapeDetector.h:206
@ TS_VALUE
The threshold value is used as defined.
Definition TestShapeDetector.h:204
@ TS_BASED_ON_TOP_75_55
The threshold is based on 55% of the sorted top 75 shapes.
Definition TestShapeDetector.h:208
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
@ BS_SEPARATE_MAX
The band variance is determined based on the maximum variance of all band blocks.
Definition TestShapeDetector.h:193
@ BS_SEPARATE_AVERAGE
The band variance is determined based on the average variance of all band blocks.
Definition TestShapeDetector.h:191
@ BS_JOINED
The band variance is determined based on a joining all band blocks.
Definition TestShapeDetector.h:189
@ BS_SKIP
The band variance is not used.
Definition TestShapeDetector.h:195
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.
CV::Detector::ShapeDetector::TShape TShape
Definition TestShapeDetector.h:40
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
@ RV_LINEAR
The response values are visualized with linear normalization.
Definition TestShapeDetector.h:68
@ RV_LOGARITHMIC
The response values are visualized with a logarithmic normalization.
Definition TestShapeDetector.h:70
CV::Detector::ShapeDetector::XShape XShape
Definition TestShapeDetector.h:41
ResponseType
Definition of individual response types.
Definition TestShapeDetector.h:53
@ RT_HORIZONTAL
The response is just based on the horizontal response.
Definition TestShapeDetector.h:57
@ RT_HORIZONTAL_AND_VERTICAL
The response is composed of the horizontal and vertical response.
Definition TestShapeDetector.h:55
@ RT_VERTICAL
The response is just based on the vertical response.
Definition TestShapeDetector.h:59
CV::Detector::ShapeDetector::LShape LShape
Definition TestShapeDetector.h:39
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
Namespace of the CV Detector Test library.
Definition LineDetectorHough.h:28
Namespace of the CV Test library.
Definition LineDetectorHough.h:28
Namespace of the Test library.
Definition LineDetectorHough.h:28
The namespace covering the entire Ocean framework.
Definition Accessor.h:15