Barcode probability

Barcode probability

Calculates the probability that a barcode is present in an image patch. For this, gradient orientation histogram is used.

Inputs

image
Input image.
corner
Pixel coordinate of the upper left corner of the region of interest. A 1-by-2 matrix.
size
The size of the rectangle framing the region-of-interest. If size is undefined (either width or height is NAN), the histogram is computed from the whole image.
angleBins
The number of quantization bins for gradient angle.
preferredAngle
A-priori information about the orientation of the barcode. Setting this parameter favors barcodes which have orientation near the given angle. This improves the probability of correct detection if the information is available. The default value is NAN, which means no preference.

Outputs

confidence
The probability (0-1) that the region-of-interest in image represents a barcode.