GB2338102A - Decoding bar codes - Google Patents

Decoding bar codes Download PDF

Info

Publication number
GB2338102A
GB2338102A GB9920776A GB9920776A GB2338102A GB 2338102 A GB2338102 A GB 2338102A GB 9920776 A GB9920776 A GB 9920776A GB 9920776 A GB9920776 A GB 9920776A GB 2338102 A GB2338102 A GB 2338102A
Authority
GB
United Kingdom
Prior art keywords
character
bar
bar code
decoded
widths
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
GB9920776A
Other versions
GB9920776D0 (en
GB2338102B (en
Inventor
Hiroaki Kawai
Shinichi Sato
Motohiko Itoh
Mitsuo Watanabe
Isao Iwaguchi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from JP33671195A external-priority patent/JP3324374B2/en
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of GB9920776D0 publication Critical patent/GB9920776D0/en
Publication of GB2338102A publication Critical patent/GB2338102A/en
Application granted granted Critical
Publication of GB2338102B publication Critical patent/GB2338102B/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1486Setting the threshold-width for bar codes to be decoded
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Printers Characterized By Their Purpose (AREA)

Abstract

A bar code is decided by detecting bar width data of the bar code; storing the bar width data in storage means; reading the bar width data from the storage means in a first direction and decoding the same into a first character; determining whether or not the bar widths of a second character decoded just before the first character had been corrected according to the widths of a third character decoded just before the second character; if the bar widths of the second character had been corrected according to the bar widths of the third character, correcting the bar widths of the second character according to the bar widths of the first character and again decoding the second character; and determining whether or not the two decoded results of the second character are equal to each other.

Description

- 1 2338102 METHOD OF-DECODING BAR CODES AND BAR CODE READER This is a
divisional application of GB 2 308 710.
The present invention relates to a method of decoding bar codes and a bar code reader.
Many shops and supermarkets employ POS systems which include bar code readers. The bar code readers must read bar codes whose printed quality is not always good. Some bars of a bar code are thicker or thinner than standard widths, patchy, or partly broken due to poor printing quality. The bar code readers are required.to read such poor-quality bar codes correctly.
A UPC bar code is composed of start guard bars, center bars, and end guard bars. The center bars divide the bar code into two parts. A part between the start guard bars and the center bars is a lef t block, and A part between the center bars and the end guard bars is a right block. Each of the left and right blocks consists of six characters, and therefore, each bar code contains 12 characters. A photosensor for a bar code reader provides an electric signal representing "i" in response to reflected light from a black bar of the bar code, and an electric signal representing "0" in response to reflected light from a white bar of the bar code.
Each character of the bar code consists of two white bars and two black bars, and each character extends for seven module's. The module is a unit used to express the width of each bar of the bar code. The width of each white or black bar is an integral number of modules.
Each character of the bar code represents one of numerals 0 to 9 depending on the widths of the white and black bars of the character. Since each character consists of seven modules, the characters are classified into two groups. In one group, the total number of is modules of the two black bars of each character is even, and in the other group, the same is odd. Consequently, each UPC bar code is able to express 20 characters, i.e., even-O (E0) to even-9 (E9) each including an even number of black modules, and odd-O (00) to odd-9 (09) each including an odd number of black modules, as shown in Fig. 3. The two character groups are used to distinguish, for example, the left and right blocks of the bar code from each other.
The bar code reader emits a scan beam toward a bar code and receives a beam reflected from the bar code. The.bar code reader compares the intensity of the reflected beam with a reference value and provides an electric: signal representing 1 or 0. A decoder of the bar code reader decodes the electric signal into one of EO to E9 and 00 to 09 according to the level (1 or 0) and duration of the electric signal.
Each bar of the bar code is frequently too thin or too thick depending on printing conditions. The bar code reader is unable to test the printing" conditions, and therefore, may erroneously read the bar code that is poorly printed if the bar code reader directly reads the width of each bar of the bar code.
To solve this problem, there is a bar code decoding method that cancels the influence of thicker and thinner bars when reading a bar code. This method measures the widths Ti and T2 of adjacent two pairs of black and white bars of the bar code as shown in Fig. 2. The widths Tl and T2 are called delta distances. There are 20 character's ranging from EO to E9 and 00 to 09 to be expressed in a bar code. On the other hand, there are four delta distances ranging from two to five modules to provide 16 combinations of T1 and T2. As a result, the characters El and E7 provide the same combination of Tl and T2. Similarly, E2 and E8, 01 and 07, and 02 and 08 provide the same combinations of Tl and T2, respectively. For these characters, the delta distances Tl and T2 are 3 - insufficient to distinguish them from one another.
The characters having the same combination of Tl and T2 have, however, different number of modules in individual bars. Accordingly, members of any one of the pairs El"and E7, E2 and E8, 01 and 07, and 02 and 08 can be distinguished from each other by measuring the bars of the pair.
Here rises another problem that each bar of the pairs may also be thin or thick depending on printing conditions.
Then, measuring the widths of bars is insufficient to distinguish characters, for example, El and E7,1 having the same delta distances Tl and T2.
To solve this problem, there is a method of correcting the width of a bar of a character to be decoded, according to the width of a bar of the character that has already been decoded.
There is another method that sets an allowable error range for the width of a bar, determines whether or not each bar is within the range, and only when the bar is within the range, decodes the bar code.
If each bar has a large error, the allowable error range is expanded, to properly decode bar codes depending on situations.
This method, however, is complicated and is not preferable. There is no way to determine whether or not a corrected bar width is true. If the corrected bar width is wrong, the bar code reader will provide an incorrect result.
Recen bar codes are compact, short, and simply printed, and bar code readers are required to correctly read these bar codes.
Accordingly, it is desirable to provide a method of decoding bar codes and a bar code reader capable of correctly reading bar codes that require width corrections.
is According to a first aspect of the invention there is thus provided a method of decoding a bar code according to reflected light from the bar code, comprising the steps of: detecting bar width data of the bar code in the reflected light; storing the bar width data in storage means; reading the bar width data from the storage means in a first direction and decoding the same into a first chaiacter; determining whether or not the bar widths of a second character decoded just before the first character had been corrected according to the widths of a third character decoded just before the second character; if the bar widths of the second character had been corrected according to the bar widths of the third character, correcting the bar widths of the second character according to the bar widths of the first character and again decoding the second character; and determining whether or not the two decoded results of the second character are equal to each other.
According to a second aspect there is provided a bar code reader comprising: a light source; means for emitting light from the light source outside; means for receiving reflected light from a bar code and providing a signal representing bar code data; means for storing the bar code data; means for decoding the bar code data in a first direction into a first character, and if the bar widths of a second character decoded just before the first character had been corrected according to the bar widths of a third character decoded just before the second character, correcting the bar widths of the second character' according to the bar widths of the first character, and again decoding the second character; and means for comparing the two decoded results of the second character with each other.
The corrected bar widths are compared with each other to determine whether or not they are equal to each other. If they are equal to each other, they are accepted as correct. If they are not equal to each other, at least one of them is wrong.
For a better understanding of the invention, and to show how the same may be carried into effect, reference will now be made, purely by way of example, to the accompanying drawings, in which Figures 11 to 14 relate to the subject matter of thd parent application GB 2 308 710, and in which:
Fig. 1 shows an example of a UPC bar code; Fig. 2 shows an example of a character of the UPC bar code; Fig. 3 shows characters 00 to 09 and EO to E9 of the UPC bar code; Fig. 4 shows a normal bar code, a thickened bar code, and a thinned bar code; Fig. 5 is a table showing delta distances and - 6 corresponding characters; Fig. 6 is a table used to decode characters 1, 2, 7, and 8 of the UPC bar code; Fig. 7 shows a bar width correction; Fig. 8 shows an example of a bar code reader; Fig. 9 is a block diagram showing a bar code reader according to an embodiment of the present invention; Fig. 10 shows decoding directions of a bar code; Fig. 11 is a flowchart showing a bar code decoding routine described by way of background explanation;
Fig - 12 is a f lowchart showing another bar code decoding routine; Fig. 13 shows a character sandwiched between two characters; Fig. 14 is a flowchart showing a further bar code decoding routine; Fig. 15 is a flowchart showing a bar'code decoding routine according toa first embodiment of the present invention; and Fig. 16 is a flowchart showing a bar code decoding routine according toa second embodiment of the present invention.
For a better understanding of the preferred embodiments of the present invention, the problems in the prior art will be explained.
Figure 1 sfiows an example of a UPC bar code. The bar code has start guard bars 53, end guard bars 54, and center bars 55.
A part between the start guard bars 53 and the center bars 55 is a left block, and a part between the center bars 55 and the end guard bars 54 is a right block.
Each of the left and right blocks consists of six - 7 characters, and therefore, each bar code contains characters.
Figure 2 shows an example of a character of the UPC bar code. A photosensor of a bar code reader provides an electric signal representing "1" in response to reflected light from a black bar of the bar code, and an electric signal representing "0" in responie to reflected light from a white bar of the bar code.
Each character of the bar code consists of two white bars and two black bars. The width of each character is seven modules. The module is a unit used to express the width of each bar of the bar code. The width of each white or black bar must be an integral number of modules.
The start guard bars 53 include two black bars and a white bar sandwiched between the black bars, each bar having a width of one module. The end guard bars 54 have the same formation. The center bars 55 consist of three white bars and two black bars each having a width of one module. These bars are arranged in order of white, black, white, black, and white.
Each character of a bar code represents any one of numerals 0 to 9 depending on the widths of the white and black bars of the character. Since each character consists of seven modules, the characters are classified into two groups. In one group, the total number of modules of the two black bars of each character is even, and in the other group, the same is odd. Accordingly, a UPC bar code is able to express 20 characters, i.e., even-O (E0) to even-9 (E9) each including an even number of black modules, and odd-O (00) to odd-9 (09) each including an odd number of black modules, as shown in Fig. 3. The two character groups are used to distinguish, for example, the left and right blocks of the bar code from each other.
In Fig. 3, the right part shows EO to E9, and the left part shows 00 to 09. Each bar of each of these numerals consists of a specified number of modules.
The bar code reader emits a scan beam toward a bar code and receives a reflected beam from the bar code. The bar code reader compares the intensity of the reflected beam with a reference value and provides. an electric signal representing 1 or 0 (Fig. 2). A decoder of the bar code reader decodes the electric signal into one of EO to E9 and 00 to 09 according to the level (1 or 0) and duration of the electric signal.
Any one of EO to E9 and 00 to 09 of Fig. 3 of a given bar code is distinguishable according to reflected light from the bar code because each has a different structure of black and white bars. Consequently, each character in the bar code is decoded.
Bars of bar codes are frequently thinned or thickened depending on printing conditions as shown in Fig. 4. Figure 4 shows two white bars and one black bar each consisting of the same number of modules. In Fig. 4(1), the bars are normally printed. In Fig. 4(2), the black bar is thick. In Fig. 4(3), the black bar is thin.
In Fig. 4(1), the white bars Bl and f33 and black bar B2 are correctly printed with a normal width, and therefore, the bar code reader will correctly read these bars.
In Fig. 4(2), the black bar B2 is thickened by "PO x 2" from the normal width. As a result, each of the white bars Bl and B2 is thinned by the same portion from the normal width. In Fig. 4(3), the black bar B2 is thinned by "Pl x 2" from the normal width, and each of the white bars B1 and B2 is thickened by the same portion from the normal width.
The bar code reader is unable to test the printing conditions, and therefore, may incorrectly read the bar code that has the incorrectly printed bars of Figs. 4(2) and 4(3), if the bar code reader directly reads the width of each bar of the bar code.
A prior art for correctly reading a bar code having thinned or thickened bars will be explained with
9 - reference to Fig. 4.
A delta distance Tl is the total width of the black bar B2 and white bar B1, and a delta distance T2 is the total width of the white bar B3 and black bar B2..
Reading the bar code having thickened black bars will be explained with reference to Fig. 4(2). If each of the bars uniformly has a printEng error, a thick portion P01 of a black bar adjacent to the white bar Bl is nearly equal to a thick portion P03 on the left side of the black bar B2, and therefore, P01 and P03 cancel each other. Accordingly, the delta distance Tl is nearly equal to the total of the normal black bar B2 and normal white bar Bl. A thick portion P02 of the black bar B2.never affects the delta distance T1. Namely, the delta distance Tl is substantially free from the thick portions.
Similarly, the delta distance T2 is nearly equal to the total of the normal black bar B2 and normal white bar B3 because thick portions P02 and P04 cancel each other.
In Fig. 4(3), thin portions P11 and 13 in a delta distance Tl cancel each other, and thin portions P12 and P14 in a delta distance T2 cancel each other. Accordingly, the delta distances Tl and T2 are free from the thin portions. Namely, the delta distances Tl and T2 are substantially unchanged in the cases (1), (2), and (3) of Fig. 4. The prior art uses such delta distances to decode a given bar code.
Figure 3 shows the delta distances of each of the 20 characters of UPC bar codes. Each character consists of seven modules, and the width of each bar is at least one module. This -means that each delta distance is in the range of two to five modules. Figure 5 is a table showing the delta distances Tl and T2 of each of the 20 characters, i.e., EO to E9 and 00 to 09. To decode a bar code, the delta distances Tl and T2 of each character of the bar code are measured, and the character is decoded according to the table of Fig. 5.
As explained above, bar codes are able to express the 20 characters of EO to E9 and 00 to 09. On the other hand, there are four delta- distances ranging from two to five modules to provide 16 combinations of Tl and,T2. As a result, the characters El and E7 have the same combination of T1 and T2. Similarly, E2 and E8, 01 and 07, and 02 and 08 have the same c6mbinations of T1 and T2, respectively. Accordingly, the delta distances T1 and T2 are insufficient to distinguish the two characters of each of these pairs from each other.
The characters having the same combination of T1 and T2 have, however, different number of modules in individual bars. Accordingly, the characters of any one of the pairs El and Z7, E2 and E8, 01 and 07, and 02 and 08 can be distinguished from each other by measuring one of the bars of the pair.
Figure 6 shows a table used to identify each character of these pairs. For example, the characters E2 and.E8 having the same delta distances Tl and T2 of each 3 are distinguished from each other according to the table of Fig. 6.
If the detected delta distances Tl and T2 are each 3, the corresponding character must be E2 or E8. Accordingly, the widths of two black bars Bl and B3 (Fig. 2) are measured, and the table of Fig. 6 is referred to, to select one of E2 and E8.
If the character is E2, each of the black bars Bl and B3 have two modules. If it is E8, each of the black bars B1 and B3 have one module. In this way, any one of the two characters having the same delta distances T1 and T2 is identifiable.
This method, however, has a problem.
To distinguish two characters having the same delta distances from each other, it is necessary to measure the widths, i.e., the numbers of modules of specific bars. These bars are naturally thinned or thickened depending on printing conditions. For example, the character E2 - 11 has two black bars each having a width of two modules. If these black bars thinned each to one module due to poor printing conditions, the bar code reader may read the character as E8.
In this way, it is impossible to eliminate the influence of printing errors when distinguishing two characters having the same delta distances from each other.
To solve this problem, another method corrects the width of each bar of a given character according to the widths of bars of the preceding character already decoded, and then, decodes the given character.
Figure 7 explains this method.
A character of EO is in front of a character of E2 and is already decoded. To decode E2, black bars B3 and Bl of E2 must be measured. These black bars may involve printing errors. Since EO is already decoded, the numbers of modules of the black and white bars of EO are known.
TO correct the width of the black ba: B3 of E2, the width of the black bar B5 or B7 of EO is subtracted from the width of the black bar B3. The width of the black bar B5 or B7 is known and involves the printing errors. Accordingly, subtracting the width of the black bar B5 or B7 from the width of the black bar B3 cancels the printing errors in the black bar B3. if the black bar B5 is subtracted from the black bar B3, the difference will be "0" because each has a width of one module. If the black bar B7 is subtracted from the black bar B3, the difference will'be "-l."
Thereafter, the difference is added to the normal number of modules of B5 or B7 of EO. The normal module number involves no printing error. In this way, the width of the black bar B3 is correctly measured. Similarly, the width of the black bar B1 of the character E2 is correctly measured.
The character E2 with the corrected bar widths is 12 - correctly decoded irrespective of the printing errors.
It is impossible, however, to determine whether or not the character in front of the character E2 is surely EO, or whether or not the number of modules of the black bar B5 or B7 is correct. The method decodes the character E2 on the assumption that the character EO decoded before E2 is correct. If'this assumption is wrong due to broken bars, etc., the character E2 will not correctly be decoded. There is no way to test whether or not the decoded character EO is correct, or whether or not the bars of the character E2 have really been corrected.
If the bar code is printed on a curved surface, the.ratio of the character EO to the character E2 will not be 1:1. Then, correcting the widths of bars of the character E2 according to those of the character EO will provide a wrong result.
To solve this problem, there is a method that sets an allowable error range for the width of a bar, determines whether or not each bar is within the range, and only when the bar is within the range, decodes a corresponding bar code.
If each bar has a large error, the allowable error range is expanded, to properly decode bar codes according to situations.
This method, however, is complicated and is not preferable.
In addition, this method is unable to determine whether or not a given bar width is true. If it is wrong, the bar code reader will provide a wrong result.
Recent bar codes are compact, short, and simply printed, and bar Code readers are required to correctly read these bar codes.
Next, preferred embodiments of the present invention be explained.
Figure 8 shows an example of a bar code reader. This is of a stationary type fixed on, for example, a will 13 cashier's counter of a store- The bar code reader has a window 1 that emits laser beams in different downward directions.
Figure 9 is a block diagram showing a signal. processing system of a bar code reader according to an embodiment of the present invention. An optical system 11 includes a light source such ag a semiconductor laser, a mirror for reflecting a beam from the light source, a polygon mirror for providing a scanning beam according to the reflected beam, a window for emitting the scanning beam, and a photosensor for receiving reflected beam from a bar code. The photosensor provides an analog electric signal representing a value corresponding to a black or.white bar of the bar code.
An A/D converter 12 converts the analog electric signal into a digital electric signal representing a value of 1 or 0. A width counter 13 counts a period between edges of the output of the A/D converter 12 according to a clock signal provided by a clock gene rator 14. Namely, the width counter 13 measure s the width of a black or white bar of the bar code.
A memory 15 stores the output of the width counter 13. When a scanning operation is complete, a CPU 16 reads the bar widths out of the memory 15, and a decoder 17 decodes the bar widths into bar code characters.
A direction unit 18 determines a direction in which the width data in the memory 15 is read and decoded.
Figure 10 shows a bar code and bar code decoding directions. The bar code reader according to the present embodiment first decodes the bar code in the direction (1), and if necessary, in the direction (2), too. Namely, the bar code data stored in the memory 15 is first read in the direction (1) and decoded in the some direction then the same bar code data is read in the direction (2) and decoded in the same direction. The direction unit 18 determines one of the directions (1) and (2).
14 - Figure 11 is a flowchart showing a bar code decoding routine which is described by way of background explanation.
This routine is carried out after the bar code reader reads a bar code and the memory 15 stores bar width data. Step S101 reads the bar width data out of the memory 15 in the first direction and decodes the data character by character. Step 5102 stores a decoded result (a) in the first direction.
Step S103 reads and decodes the bar width data in the second direction character by character. Changing the decoding directions from one to another is controlled by the direction unit 18. The last character decoded in the f irst direction is the first decoded in the s'econd direction.
Step S104 stores a decoded result (b) in the second direction. Step S105 compares the decoded results (a) and (b) with each other. If the bar code is correctly read, the decoded results (a) and (b) must be equal to each other. Step S106 determines that the bar code has been correctly decoded if the results (a)"and (b) agree with each other. If the results (a) and (b) are not equal to each other, step S107 discards the decoded results.
In this way, the above routine decodes a bar code in two directions and determines whether or not the bar code has been successfully decoded according to the decoded results in the two directions. This makes the bar code decoding reliability higher than in the prior arts.
Figure 12 is a flowchart showing another bar code decoding routine described by way of background explanation.
This routine decodes a bar code in one direction or in two directions depending on whether or not the bar code includes any one of the characters El, E2, E7, E8, 01, 02, 07, and 08. These characters are called the special characters hereunder.
Any one of the special characters must be decoded - according to the actual widths of the bars thereof. To improve the reliability of a decoded result, the widths of the bars of these characters must be corrected according to the widths of the bars of a preceding character already decoded.
On the other hand, normal characters other than the special characters may be decoded 'according to the delta distances thereof without regard to printing errors. Namely, the normal characters require no bar width correction.
If the decoded preceding character is correct, the bar.width correction will be correct. If the decoded preceding character is wrong, the bar width correction.will be wrong, and therefore, the decoded result will be wrong.
The routine of Fig. 12 solves this problem.
Step S201 decodes a given bar code in the first direction. Step S202 stores a decoded result (a). These steps are the same as those of the f irst routine. Step 5203 determines whether or not the decoded result (a) includes any one of the special characters El, E2, E7, E8, 01, 02, 07, and 08. If it includes none of them, step S207 determines that the decoded result (a) is correct and acceptable.
If the decoded result (a) includes any one of the special characters, the widths of bars of the character will have been corrected according to the widths of bars of a decoded preceding character, and therefore, the bar width correction must be verified. For this purpose, step S204 decodes the bar code data in the second direction, and step S205 stores a decoded result (b) in the second direction.
Figure 13 shows a character A sandwiched between characters B and C. The character A is 01, i.e., one of the special characters, and therefore, the widths of bars thereof must be corrected according to the widths of bars of a preceding decoded character.
16 1 When the bar code is decoded in the first direction in Fig. 13, the character A is decoded after the character B. Accordingly, the widths of black bars of the character A are corrected according to the width of a black bar b of the character B. When the bar code is decoded in the second direction, the character A is dec6ded after the character C. Accordingly, the widths of the black bars of the character A are corrected according to the width of a black bar c of the character C.
In Fig. 13, the black bar used as a reference for correcting the widths of the black bars of the character A is the right black bar of each of the characters B and C.
In this way, the widths of the black bars of the character A are corrected two times according to the widths of the black bats of the characters B and C. Thereafter, the decoded results based on the two corrections are compared with each other. If the comparison provides no difference,. it is determined that the bar code has successfully been decoded, or that the bar width corrections were correct.
Returning to Fig. 12, if step S203 determines that the decoded result (a) includes any one of the special characters, step S204 decodes the bar code data in the second direction. Step S205 stores a decoded result (b) in the second direction. Step S206 compares the decoded results (a) and (b) with each other.
If the decoded results (a) and (b) are equal to each other, step S207 determines that the bar code has successfully been decoded. If they disagree with each other, step S208 discards the decoded results because at least one of them must be wrong.
In this way, the routine of Figure 12 des a bar code in different directions if the bar code contains any character that requires a bar width correction, compares decoded results in the different directions with each other, and determines whether or not the bar code has correctly been decoded.
If a bar code contains none of such special characters, the above routine decodes the bar.code only in one direction, to shorten a decoding time.
The Fig. 12 routine corrects the widths of black bars of the character A of Fig. 13 according to the bar widths of the characters B and C that areadjacent to the character A. This is to avoid the influence of the curvature of a surface on which the bar code is attached.
This, however, is not anessential feature. The bar width correction may be carried out according to, for example, a first decoded character or guard bars.
Figure 14 is a flowchart showing a further bar code decoding routine by way of background explanation.
This routine decodes a given bar code in.
the first and second directions if the bar code contains any of the special characters El, E2, E7, E8, 01, 02, 07, and 08 consecutively.
The bar widths of a third character 'are corrected according to the bar widths of a second character that is in front of the third character.- The bar widths of the second character are corrected according to the bar widths of a first character that is in front of the second character. If the bar width correction on the second character includes an error, the error will be expanded in the correction of the third character. As a result, the third character will have a larger error.
The."Fig- 14 routine decodes a given bar code in the second direction in addition to the first direction if the bar code consecutively includes some of the special characters whose bar widths have been corrected. In this case, the Fig- 14 routine corrects the bar widths of a given special character according to the bar widths of two different characters, to improve the reliability of the bar width correction and bar code decoding.
Step S301 decodes a bar code in the first direction, 18 is and step S302 stores a decoded result (a). Step S303 determines whether or not the decoded result (a) contains any of the special characters El, E2, E7, E8, 01, 02, 07, and 08 continuously. If it contains them continuously, step S304 decodes the bar code data in the second direction, and step S305 stores a decoded result (b).
Step S306 compares the decoded results (a) and (b) with each other. If they agree with each other, step S307 determines that the bar code has correctly been decoded. If they disagree with each other, step S308 discards the decoded results because at least one of them is wrong.
If step S303 determines that the decoded result (a).involves no consecutive special characters, step S307 determines that the decoded result (a) is correct.
The Fig- 14 routine does not decode a bar code in the second direction if the bar code contains any of the special characters that are not consecutive. This technique, however, is not essential.
Figure 15 is a flowchart showing a bar code decoding routine according to a first embodiment of the present invention. The first embodiment tests a first character just decoded to see if it is one of the special characters El, E2, E7, E8, 01, 02, 07, and 08, and if is, corrects the bar widths of the first character according to the bar widths of a second character to be decoded. Thereafter, the first embodiment again decodes the first character and determines whether or not the decoded results of the first character are unchanged before and after the bar width correction.
Any one of the routines of Fi11, 12and14 a given bar code entirely in both the first and second directions as and when required. This may lengthen the decoding time and deteriorate the operating efficiency of the bar code reader. Accordingly, the _ firstembodiment decodes only the special characters in the different directions and determines whether or not the decoded 19 - results are equal to each other.
Step S402 decodes a present character. Step S403 determines whether or not a preceding character is one of the special characters El, E2, E7, E8, 01, 02, 07, and 08. If it is not, the next character is decoded.
If the preceding character is one of the special characters, step S404 determines whether or not the present character is one of the special characters. if the present character is one of them, the bar widths of the preceding character must not be corrected according to the bar widths of the present character because there is a probability of causing a correction error. Therefore, step 5406 proceeds to the next character.
- If the present character is not one of the special characters in step S404, the bar widths of the preceding character are corrected according to the bar widths of the present character, and the preceding character is again decoded. Step S405 compares the decoded results of the preceding character before and after the correction with each other. If they agree with each other, step S406 proceeds to the next character. If they disagree with each other, step S407 determines that the decoding of the preceding character is wrong.
In this way, the first embodiment decodes only a character that must be verified in two directions and determines whether or not the decoded result is acceptable. This embodiment decodes a character that requires no verification in only one direction, to shorten the decoding time.
Figure 16 Is a flowchart showing a bar code decoding routine according to the -- embodiment of the present invention. This embodiment repeats the decoding of consecutive special characters according to the decoded result of a present character, to verify the special characters.
Step S502 decodes a present character. Step S503 checks a first preceding character to see if it is one of 1 the special characters El, E2, E7, ES, 01, 02, 07, and 08. If so, step S504 checks a second preceding character to see if it is one of the special characters. If any one of steps S503 and S504 provides a negative answer, step S507 proceeds to the next character.
If the first and second preceding characters are both one of the special character!>, step S505 determines whether or not the present character is not one of the special characters. If the present character is a normal character, step S506 corrects the bar widths of the consecutive special characters according to the bar widths of the present character, decodes the corrected consecutive special characters, and compares the characters before and after the correction with each other. If they agree with each other, step S507 determines that the decoded characters are correct and proceeds to the next character. If they disagree with each other, step S508 determines that the decoded characters are wrong.
If the present character is one of the special characters in step S505, step S507 proceeds to the next character without correcting the bar widths of the preceding special characters.
As explained above, it is possible to decode a bar code in two different directions and compare the decoded results with each other, to determine whether or not the decoded results are correct. This process makes the reliability of decoding a bar code better than that of the prior arts.
The present invention corrects a special character two times according to adjacent characters. Decoded results after the two corrections are compared with each other to verify the corrections.
If a decoded preceding character is one of the special characters, the present invention corrects and again decodes the preceding character according to a present character. The decoded results of the preceding 21 - character before and after the correction are compared with each other to verify the correction and decoded results. Any normal character, that requires no verification, is decoded only in one direction to reduce a decoding time.
If there are consecutive special characters, they are decoded in different directiods, to minimize a propagation of errors in bar width corrections and improve the reliability of bar code decoding.

Claims (4)

  1. CLAIMS is 1. A method of decoding a bar code according to reflected light
    from the bar code, comprising the steps of: detecting bar width data of the bar code in the reflected light; storing the bar width data in storage means; reading the bar width data from the storage means in a first direction and decoding the same into a first character; determining whether or not the bar widths of a second character decoded just before the first character had been corrected according to the widths of a third character decoded just before the second character; if the bar widths of the second character had been corrected according to the bar widths of the third character, correcting the bar widths of the second character according to the bar widths of the first character and again decoding the second character; and determining whether or not the two decoded results of the second character are equal to each other.
  2. 2. A bar code reader comprising:
    a light source; means for emitting light from the light source outside; means for receiving reflected light from a bar code and providing a signal representing bar code data; means for storing the bar code data; means for decoding the bar code data in a first direction into a first character, and if the bar widths of a second character decoded just before the first character had been corrected according to the bar widths of a third character decoded just before the second character, correcting the bar widths of the second character according to the bar widths of the first character, and again decoding the second character; and means for comparing the two decoded results of the second character with each other.
  3. 3. A method of decoding a bar code substantially according to any one of the embodiments hereinbefore described with reference to Figures 15 or 16 of the accompanying drawings.
  4. 4. A bar code reader according to any one of the embodiments hereinbefore described with reference to Figures 9 and 15, or 9 and 16 of the accompanying drawings.
    is
GB9920776A 1995-12-25 1996-12-20 Method of decoding bar codes and bar code reader Expired - Fee Related GB2338102B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP33671195A JP3324374B2 (en) 1995-12-25 1995-12-25 Barcode demodulation method and barcode reader
GB9626621A GB2308710B (en) 1995-12-25 1996-12-20 Method of decoding bar codes and bar code reader

Publications (3)

Publication Number Publication Date
GB9920776D0 GB9920776D0 (en) 1999-11-03
GB2338102A true GB2338102A (en) 1999-12-08
GB2338102B GB2338102B (en) 2000-01-26

Family

ID=26310706

Family Applications (1)

Application Number Title Priority Date Filing Date
GB9920776A Expired - Fee Related GB2338102B (en) 1995-12-25 1996-12-20 Method of decoding bar codes and bar code reader

Country Status (1)

Country Link
GB (1) GB2338102B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0172727A2 (en) * 1984-08-14 1986-02-26 Ncr Canada Ltd - Ncr Canada Ltee Apparatus and method for sensing bar coded data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0172727A2 (en) * 1984-08-14 1986-02-26 Ncr Canada Ltd - Ncr Canada Ltee Apparatus and method for sensing bar coded data

Also Published As

Publication number Publication date
GB9920776D0 (en) 1999-11-03
GB2338102B (en) 2000-01-26

Similar Documents

Publication Publication Date Title
US6095420A (en) Method of decoding bar codes and bar code reader
EP0431264B1 (en) Method and apparatus for decoding bar codes from multiple scans
EP0754328B1 (en) Method and apparatus for decoding bar code images using information from previous scan lines
EP0943132B1 (en) Method and apparatus for decoding bar code symbols using ratio analysis of module size
AU681421B2 (en) Bar code scan stitching
US4414468A (en) Systematic error correction in bar code scanner
EP0304146A2 (en) Method of decoding a binary scan signal
EP0502440B1 (en) Bar-code reading apparatus and method
US6622918B2 (en) Barcode reading apparatus and barcode reading method
US5311000A (en) Bar code scanner and method of scanning
EP0385783A2 (en) Bar code reading apparatus
US5393968A (en) Method and device for reading bar code
US6357660B1 (en) Bar code reading apparatus and a method for the same
JP2500859B2 (en) Bar code reader
GB2338102A (en) Decoding bar codes
US6330972B1 (en) Error correction enhancement for code 93i and other machine-readable symbologies
US5917172A (en) Apparatus and method for bar code reading
US7364080B2 (en) System and method for bar code detection
JPH08235300A (en) Bar code reader
JPH01290092A (en) Bar width discriminating method for bar code
JP2953143B2 (en) Barcode reading device and barcode reading method
JP2761251B2 (en) Barcode reading method
JPH04251394A (en) Bar code reader
JPH06337954A (en) Method for decoding with bar-code decoder
JPH05233866A (en) Bar code demodulator

Legal Events

Date Code Title Description
PCNP Patent ceased through non-payment of renewal fee

Effective date: 20151220