PDF417DetectionParams
Description
Specifies how PDF417 codes are being detected.Structure fields and default values (if defined) are described below:
- float ContrastThreshold = 5.0f - Guaranteed gray level difference between dark and bright modules
- float ContrastHysteresis = 0.0f - A value dynamically subtracted from ContrastThreshold to improve local segmentation
- int DetectionScanCount = 3 - Number of scan lines used for detecting the code
- int ScanWidth = 1 - Width of the single scan
- float SmoothingStdDev = 0.6f - Parameter for gaussian smoothing used during scanning
- float MinEdgeMagnitude = 8.0f - Minimum acceptable edge strength
struct PDF417DetectionParams
{
float ContrastThreshold;
float ContrastHysteresis;
int DetectionScanCount;
int ScanWidth;
float SmoothingStdDev;
float MinEdgeMagnitude;
explicit PDF417DetectionParams
(
float ContrastThreshold_ = 5.0f,
float ContrastHysteresis_ = 0.0f,
int DetectionScanCount_ = 3,
int ScanWidth_ = 1,
float SmoothingStdDev_ = 0.6f,
float MinEdgeMagnitude_ = 8.0f
) :
ContrastThreshold(ContrastThreshold_),
ContrastHysteresis(ContrastHysteresis_),
DetectionScanCount(DetectionScanCount_),
ScanWidth(ScanWidth_),
SmoothingStdDev(SmoothingStdDev_),
MinEdgeMagnitude(MinEdgeMagnitude_)
{}
float ContrastThreshold() const { return ContrastThreshold; };
float ContrastHysteresis() const { return ContrastHysteresis; };
int DetectionScanCount() const { return DetectionScanCount; };
int ScanWidth() const { return ScanWidth; };
float SmoothingStdDev() const { return SmoothingStdDev; };
float MinEdgeMagnitude() const { return MinEdgeMagnitude; };
bool operator == ( const avl::PDF417DetectionParams& rhs ) const
{
return ContrastThreshold == rhs.ContrastThreshold &&
ContrastHysteresis == rhs.ContrastHysteresis &&
DetectionScanCount == rhs.DetectionScanCount &&
ScanWidth == rhs.ScanWidth &&
SmoothingStdDev == rhs.SmoothingStdDev &&
MinEdgeMagnitude == rhs.MinEdgeMagnitude;
}
bool operator != ( const avl::PDF417DetectionParams& rhs ) const
{
return !(operator==(rhs));
}
};
