DataMatrixDetectionParams
Description
Specifies how data matrix codes are being detected.
Structure fields and default values (if defined) are described below:
- int ContrastThreshold = 10 - Guaranteed gray level difference between dark and bright modules
- int ContrastHysteresis = 0 - A value dynamically subtracted from ContrastThreshold to improve local segmentation
- int DynamicSNRatio - Signal-to-Noise Ratio that dynamically increases ContrastThreshold; use with low values of ContrastThreshold
- Bool NonBinarySegmentation - Assumes that there might be pixels significantly brighter or darker than the foreground or the background modules in near proximity of the quite zone; use with DetectionMethod=FinderPattern
- Bool ForceIsotropy - Switches to image preprocessing methods that give more stable results for different code rotations
- DataMatrixDetectionMethod DetectionMethod = QuietZone - Specifies which feature is used for code detection: the shape of the finder pattern or the blob of the quite zone
- DataMatrixPyramidStrategy PyramidStrategy = Fast - Specifies the step of image downsampling used for finding codes at different scales
struct DataMatrixDetectionParams
{
int ContrastThreshold;
int ContrastHysteresis;
int DynamicSNRatio;
Bool NonBinarySegmentation;
Bool ForceIsotropy;
DataMatrixDetectionMethod DetectionMethod;
DataMatrixPyramidStrategy PyramidStrategy;
explicit DataMatrixDetectionParams
(
int ContrastThreshold_ = 10,
int ContrastHysteresis_ = 0,
DataMatrixDetectionMethod DetectionMethod_ = QuietZone,
DataMatrixPyramidStrategy PyramidStrategy_ = Fast
) :
ContrastThreshold(ContrastThreshold_),
ContrastHysteresis(ContrastHysteresis_),
DetectionMethod(DetectionMethod_),
PyramidStrategy(PyramidStrategy_)
{}
int ContrastThreshold( void ) const { return ContrastThreshold; };
int ContrastHysteresis( void ) const { return ContrastHysteresis; };
int DynamicSNRatio( void ) const { return DynamicSNRatio; };
Bool NonBinarySegmentation( void ) const { return NonBinarySegmentation; };
Bool ForceIsotropy( void ) const { return ForceIsotropy; };
DataMatrixDetectionMethod DetectionMethod( void ) const { return DetectionMethod; };
DataMatrixPyramidStrategy PyramidStrategy( void ) const { return PyramidStrategy; };
bool operator == ( const avl::DataMatrixDetectionParams& rhs ) const
{
return ContrastThreshold == rhs.ContrastThreshold &&
ContrastHysteresis == rhs.ContrastHysteresis && DynamicSNRatio == rhs.DynamicSNRatio &&
NonBinarySegmentation == rhs.NonBinarySegmentation && ForceIsotropy == rhs.ForceIsotropy &&
DetectionMethod == rhs.DetectionMethod && PyramidStrategy == rhs.PyramidStrategy
;
}
bool operator != ( const avl::DataMatrixDetectionParams& rhs ) const
{
return !(operator==(rhs));
}
};
