Class BarcodeDetector
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
BarcodeDetector use a super resolution model. super resolution model is applied to zoom in Barcode when it is small.
public class BarcodeDetector : CvObject, IDisposable
- Inheritance
-
BarcodeDetector
- Implements
- Inherited Members
Constructors
- BarcodeDetector(string)
Initialize the BarcodeDetector. Optionally loads an ONNX super resolution model that is applied to zoom in barcodes when they are small. Pass an empty string to create the default detector without a super resolution model.
Methods
- DecodeWithType(InputArray, IEnumerable<Point2f>, out string[], out string[])
Decodes barcode in image once it's found by the detect() method.
- DetectAndDecode(InputArray, out Point2f[], out string[], out string[])
Both detects and decodes barcode. To simplify the usage, there is a only API: detectAndDecode
- GetDetectorScales()
Get detector box filter sizes.
- GetDownsamplingThreshold()
Get detector downsampling threshold.
- GetGradientThreshold()
Get detector gradient magnitude threshold.
- SetDetectorScales(IEnumerable<float>)
Set detector box filter sizes.
Adjusts the value and the number of box filters used in the detect step. The filter sizes directly correlate with the expected line widths for a barcode.Corresponds to expected barcode distance. If the downsampling limit is increased, filter sizes need to be adjusted in an inversely proportional way.
- SetDownsamplingThreshold(double)
Set detector downsampling threshold.
By default, the detect method resizes the input image to this limit if the smallest image size is is greater than the threshold. Increasing this value can improve detection accuracy and the number of results at the expense of performance. Correlates with detector scales.Setting this to a large value will disable downsampling.
- SetGradientThreshold(double)
Set detector gradient magnitude threshold.
Sets the coherence threshold for detected bounding boxes. Increasing this value will generate a closer fitted bounding box width and can reduce false-positives. Values between 16 and 1024 generally work, while too high of a value will remove valid detections.