Skewed Reading/Decoding

 

Valid Skewed barcodes:

Skewed barcode reading/decoding methods read and decode skewed barcodes. These methods first detect the skew angle, deskew the image, and afterwards try to decode the horizontal barcode. Unfortunately, deskewing discreate images always amounts to losing some information from the original image due to the discreate pixel positions. The thicker the bars are, the lower level of distortion can be reached during deskewing. If a barcode (generated by the barcode writing functions) is rotated and attempted to be read back as a skewed barcode later, use the thickest bars and spaces that are possible for the given space. 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. These methods assume that there is almost nothing on the given part of the deskewed image but the barcode, except for some noise. There can be any kind of noise above and below the deskewed barcode, but there cannot be any vertical noise in the complete height of the deskewed barcode on the left or the right side of the barcode. See the examples below.

 

 

 

 

 

 

 

The images “A” and “B” are readable, correct horizontal deskewed barcodes, but “C” is an incorrect, unreadable barcode with horizontal deskewed barcode reading 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.

Effect of deskewing: Unfortunately, rotating a digital image always decreases the quality of the image, so decoding a deskewed barcode is harder than decoding a horizontal barcode. Sometimes it’s possible to decode a horizontal barcode, and it’s impossible to decode the same, but rotated barcode, due to the descreate pixels.