This invention relates to techniques of decoding barcodes, and more particularly, to a method of decoding a 1-D barcode in which the barcode is scanned at multiple scanning lines so as to read and decode barcodes of low quality, poor readability and/or having one or more defects by potentially using information from different horizontal portions of different scan lines to piece the together the equivalent of a single scan line.
1-D barcodes are universally used to provide information in a machine-readable format, such as the well-known Universal Product Code (UPC) strip on a product package. A 1-D barcode is usually formed by bars and spaces arranged in parallel along a length of the barcode, and the encoded information is represented by the arrangement of the bars and the spaces, and in particular, by the locations along the length of the barcode where the bars exist. To read the barcode, the varying widths of the bars, and the spaces between the bars, are measured and interpreted to extract the data.
However, the barcode is difficult to correctly read when the barcode is defective or not clear. For example, as shown in
Therefore, there exists a need to improve the reliability in reading a barcode, especially when the barcode is defective or has poor readability.
The present invention provides a method of encoding a barcode in which the barcode is scanned along multiple scanning lines along a length of the barcode to determine potential locations where the bars probably exist. For each potential location, data obtained at all the scanning lines are analyzed in combination to determine the validity of the location. Thus, the defective barcode with poor readability can still be correctly read since most of the scanning lines may run across the good portions of the defective bars.
In a preferred embodiment, the barcode is scanned by an image area reader or area scanner. Preferably, there are at least three scanning lines, and for each potential location found by the scanning, the majority of the data obtained at all the scanning lines determines the data. Then, the determination at each location is used in combination with the determination at other locations to fully decode the information. In other enhanced embodiments, other combinations in addition to a “majority rules” decision may be utilized.
The above and other advantages and features of the present invention will be clearer after reading the detailed description of preferred embodiments of the present invention with reference to the accompanying drawings in which:
FIGS. 1(a) and 1(b) illustrate the problems existing with the conventional methods in reading defective barcode symbols; and
FIGS. 2(a) and 2(b) illustrate that the method of the present invention solves the problems in FIGS. 1(a) and 1(b).
According to the present invention, the barcode is scanned along multiple scanning lines instead of using only one single scanning line in the conventional method. Preferably, the scanning lines are generally parallel to each other. In an embodiment as illustrated in FIGS. 2(a) and 2(b), the barcode 10 is scanned along three scanning lines 2, 3 and 4. Obviously, more scanning lines can be used to increase the reliability. This can be done by means of an image area reader or area scanner. The barcode 10 can be scanned at the multiple scanning lines 2,3, 4 simultaneously or can be scanned line by line.
As shown in
However, according to the method of the present invention, for each of the above potential locations determined by the points 12, 13 and 14, the data obtained in all the three scanning lines 2, 3 and 4 are combined to determine the actual presence of the bars at these locations according to a predetermined technique. In a preferred embodiment, majority decision rule is adopted to ascertain the information at the location. More specifically, with respect to a specific location, if the majority of the scanning lines indicate that there is a bar, the location is determined to contain a bar, while if more scanning lines indicate that there is no bar, the location is determined to not contain a bar.
For example, as to the location corresponding to point 12, the data obtained at scanning lines 3 and 4 shows that there is no bar found at points 12a and 12b corresponding to the location. Similarly, as to the location corresponding to point 14, the data obtained at the scanning lines 2 and 3 indicates that there is no bar at corresponding points 14a and 14b. According to the majority decision rule, the locations corresponding to points 12 and 14 are determined invalid and there is no bar running across the points 12 and 14.
As to point 13 where the scanning line 13 happens to meet with a bar 1, the data obtained at other two scanning lines 2 and 4 also indicates that a bar may exist at the location corresponding to the point 13. Thus, the location corresponding to point 13 is validated, and there is a bar existing at the location corresponding to point 13 and running through point 13. For all other bars 1, the data read at all three scanning lines 2, 3 and 4 is the same, and the locations where the bars 1 exist can be thus determined. When scanning is complete, the information can be compiled from piecing together the information gathered at each location using the foregoing technique. After all the locations are determined, the barcode is decoded according to the techniques well-known in the art.
It is also notable that other techniques of combining the plural scanning lines in addition to a “majority rules” decision may be utilized. For example, the system could require that at least four out of five show the presence of the bar. Or, the system could combine the light levels received when reading all of the bars and determine the presence of a bar if and when the combined signals from all the scanning lines exceed a predetermined threshold. Therefore, with the teaching of the present invention, the tilted line 11 or other imperfections do not result in an incorrect interpretation of the data.
Similarly, defective bar 1b can be determined to be there from the data obtained at the scanning lines 2 and 4 even though the scanning line 3 does not detect bar 1b. Thus, the location corresponding to the meeting points 21b and 41b is validated by the fact that more scanning lines (2 and 4) show that there is a bar.
Though the preferred embodiments of the invention have been described above in detail, it is understood that adaptations and modifications are possible to a person of ordinary skill in the art without departing from the spirit and scope of the invention. For example, the 1-D barcode may be a constituent part of a stacked barcode, and a variety of one and two dimensional barcodes may be utilized. Instead of the majority decision rule, an average calculation of the data obtained at a specific location by all the scanning lines may be used. Thus, the scope of the present invention is solely defined by the accompanying claims.