Horizontal and Vertical Reading/Decoding

Valid horizontal/vertical barcodes:

Description of valid horizontal barcodes can be easily generalized to vertical barcodes.

C,

 
Horizontal barcode reading/decoding methods read and decode horizontal barcodes with the direction from the left to the right, or from the right to the left. Use these reading methods only if you know the position of the barcode (the outlining rectangle), or when only the barcode is available on the image. In other cases first use automatic barcode detection to detect the positons of the available barcodes on the image. Horizontal/vertical recognition routines should be used in case of the awareness that the barcode to detect was written as a horiziontal or vertical barcode, and it's basically not skewed at the time of scanning it in. E.g. horizontal barcode is written onto a page, and later the page is scanned in as a normal Portrait or Landscape page. There's no predefined range for these routines. Based on the size and quality parameters of the barcode, a few to 10-15 degree difference between the barcode's angle and the ideal horizontal/vertical direction might be acceptable. These methods assume that there is almost nothing on the given part of the image, but the barcode except from some noise. There can be any kind of noise above and below the barcode but there cannot be any vertical noise in the complete height of the barcode on the left or the right side of the barcode. See the examples below.

 

 

 

 

 

 

 

The images “A” and “B” are readable, correct horizontal barcodes, but “C” is an incorrect, unreadable barcode with horizontal barcode reader methods due to the vertical noise on it’s left side. In the case of “C”, first try to find the barcode on the image, and call the reading methods only for the detected rectangle. In some cases when the barcode to detect is too noisy (such as image “B”), the automatic position detection of the barcode is not possible, however the barcode can still be decoded.

Use automatic barcode detection to find barcodes on images such as “C”.

String buffers: Decoding methods return the detected barcode type and the decoded value into the specified string buffers. These string buffers are allocated and freed up by the user, and have to contain enough space for the return values. The maximum value size of a given barcode is barcode standard dependent. If it’s not known, use the largest string length (255). For possible return values (and sizes) of detected coding, see coding values.

Score: Score is a value that shows the sureness of decoding. This value is similar to a probability, and it’s in the range 0.0 .. 100.0. On noisy, scanned images a Score greater than 10.0 shows a good decoding probability. Score values less than 10.0 are low probabilities, but a low probability does not mean that the decoded value is definitely wrong.