Read 1D Barcode Concepts |
The Read 1D Barcode step consists of two phases:
- Phase during which you specify an region of interest in the image, which helps to locate the region occupied by the barcode.
- Phase during which the region you specify is analyzed to decode the barcode.
The following table lists the types of barcodes and their characteristics:
Barcode Type | Supported Characters | Length | Different Bar Widths | Checksum |
---|---|---|---|---|
Codabar | 0-9, - (dash), : (colon), . (period), $ (dollar), / (slash), + (plus) | variable | 2 | optional |
Code 39 | Uppercase letters A-Z, 0-9, space, - (dash), . (period), $ (dollar), + (plus), % (percent) | variable | 2 | optional |
Code 93 | Uppercase letters A-Z, 0-9, space, - (dash), . (period), $ (dollar), + (plus), % (percent), * (asterisk) | variable | 4 | required |
Code 128 | All ASCII characters and control codes | variable | 4 | required |
EAN 8 | Numbers only | 7 data and 1 checksum | 4 | required |
EAN 13 | Numbers only | 12 data and 1 checksum | 4 | required |
Interleaved 2 of 5 | Numbers only | variable | 2 | optional |
MSI | Numbers only | variable | 2 | required |
UPC A | Numbers only | 11 data and 1 checksum | 4 | required |
Pharmacode | Numbers only | variable | 2 | none |
RSS Limited | Numbers only | 2 data and 1 checksum, 46 elements | 8 | required |
The limit conditions are different for barcodes that have two different widths of bars and spaces and for barcodes that have four different widths of bars and spaces.
The following factors can cause errors in the decoding phase:
Low Image Resolution
The resolution of an image is determined by the width of the smallest bar and space. These widths must be at least 3 pixels for all barcodes.
High Horizontal or Vertical Light Drift
Light drift is quantified by the difference between the average of the gray level of the left (upper) line and the right (bottom) line of the background of the barcode. Decoding inaccuracies can occur if the light drift is greater than 120 gray levels for barcodes with two different widths of bars and spaces, and it can occur if the light drift is greater than 100 gray levels for barcodes with four different widths of bars and spaces.
Poor Resolution
In overexposed images, the gray levels of the wide and narrow bars in the barcode tend to differ. Decoding results may not be accurate when the difference in gray levels is less than 80 for barcodes with two different widths of bars and spaces, and less than 100 for barcodes with four different widths of bars and spaces.
Consider the difference in gray levels between the narrow bars and the wide bars. The narrow bars are scarcely visible. If this difference of gray level exceeds 115 on 8-bit images (256 gray levels) for barcodes with two different widths of bars and spaces and 100 for barcodes with four different widths of bars and spaces, the results may be inaccurate.
Noise and Reflection
Noise is defined as the standard deviation of a rectangular region of interest drawn in the background. It must be less than 57 for barcodes with two different widths of bars and spaces and less than 27 for barcodes with four different widths of bars and spaces.
Reflections on the barcode can introduce errors in the value read from the barcode. Bars and spaces that are masked by the reflection produce errors.