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 ContrastPerturbations = 0 - Number of perturbations applied to ContrastThreshold for improving possibility of detection when lighting conditions are highly variable
- 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 quiet 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 quiet zone
- DataMatrixPyramidStrategy PyramidStrategy = Fast - Specifies the step of image downsampling used for finding codes at different scales
- DataMatrixOutlineStrategy OutlineStrategy = Fast - Specifies precision of outline detection
struct DataMatrixDetectionParams { int ContrastThreshold; int ContrastHysteresis; int ContrastPerturbations; int DynamicSNRatio; Bool NonBinarySegmentation; Bool ForceIsotropy; DataMatrixDetectionMethod DetectionMethod; DataMatrixPyramidStrategy PyramidStrategy; DataMatrixOutlineStrategy OutlineStrategy; explicit DataMatrixDetectionParams ( int ContrastThreshold_ = 10, int ContrastHysteresis_ = 0, int ContrastPerturbations_ = 0, DataMatrixDetectionMethod DetectionMethod_ = QuietZone, DataMatrixPyramidStrategy PyramidStrategy_ = Fast, DataMatrixOutlineStrategy OutlineStrategy_ = Fast ) : ContrastThreshold(ContrastThreshold_), ContrastHysteresis(ContrastHysteresis_), ContrastPerturbations(ContrastPerturbations_), DetectionMethod(DetectionMethod_), PyramidStrategy(PyramidStrategy_), OutlineStrategy(OutlineStrategy_) {} int ContrastThreshold( void ) const { return ContrastThreshold; }; int ContrastHysteresis( void ) const { return ContrastHysteresis; }; int ContrastPerturbations( void ) const { return ContrastPerturbations; }; 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; }; DataMatrixOutlineStrategy OutlineStrategy( void ) const { return OutlineStrategy; }; bool operator == ( const avl::DataMatrixDetectionParams& rhs ) const { return ContrastThreshold == rhs.ContrastThreshold && ContrastHysteresis == rhs.ContrastHysteresis && ContrastPerturbations == rhs.ContrastPerturbations && DynamicSNRatio == rhs.DynamicSNRatio && NonBinarySegmentation == rhs.NonBinarySegmentation && ForceIsotropy == rhs.ForceIsotropy && DetectionMethod == rhs.DetectionMethod && PyramidStrategy == rhs.PyramidStrategy && OutlineStrategy == rhs.OutlineStrategy; } bool operator != ( const avl::DataMatrixDetectionParams& rhs ) const { return !(operator==(rhs)); } };