Background of the Invention
The present invention relates to a bar code reader, and more particularly, to a bar code discriminating apparatus for reading bar codes.
In a conventional bar code reader, it is difficult to extract only a signal corresponding to the bar code (a bar code signal) from a scanned signal which a scanner delivers responsive to scanning a surface containing a bar code label and the area surrounding the bar code label. For code extraction, it is necessary to read only the bar code signal, if the reading time is to be decreased. It is desirable to reduce reading errors and to simplify a reading circuit configuration. It is also desirable to discriminate between the bar code signal and a noise signal corresponding to the surrounding area. In order to discriminate the bar code signal, the invention counts the number of black bars and white bars, which build up the bar code. When the number of the black bars and white bars reaches a predetermined value, the series of the black bars and white bars is regarded as being a complete bar code to be read.
However, in practice, the prior art bar code discriminating technique frequently detects a bar code erroneously because the noise signal delivered from the area surrounding the bar code frequently contains random pulses which satisfy the discriminating condition. In this case, a bar code reader wastefully performs a reading operation and gives an incorrect output, which causes an increase in an error reading rate.
Summary of the Invention
It is, therefore, an object of the present invention to provide a discriminating apparatus for reading bar codes, which is capable of accurately discriminating between a car code signal and a noise signal.
It is another object of the present invention to provide a discriminating apparatus for reading bar codes, which enables a bar code reader to be assembled from simpler circuit configurations and to use a low speed calculation processor.
According to the present invention, a discriminating apparatus for reading bar codes comprises a scanner for scanning a surface containing a bar code, which includes a plurality of characters. A character detection circuit compares the widths of adjacent bars for detecting the existence of characters of the bar code. A bar code discrimination circuit checks the sequence of a plurality of the characters detected by the character detection circuit.
Brief Description of the Drawings
FIG. 1 shows an example of a bar code which is to be discriminated by the present invention;
FIG. 2 is a block diagram of an embodiment of the present invention; and
FIG. 3 indicates a data shifting table for explaining the operation of the embodiment shown in FIG. 2.
Description of the Preferred Embodiment of the Present Invention:
FIG. 1 shows an example of a bar code which is to be discriminated by the present invention. A symbol W.sub.1 identifies a space, and the symbols B.sub.1, W.sub.2 and B.sub.2 identify guard bars. Further, symbols W.sub.3, B.sub.3, W.sub.4 and B.sub.4 correspond to the first character, i.e., a number system character and symbols W.sub.5, B.sub.5, W.sub.6 and B.sub.6 correspond to the second character, i.e., a numeral "1". Similarly, symbols W.sub.7, B.sub.7, W.sub.8 and B.sub.8 correspond to the third character, i.e., a numeral "2", symbols W.sub.9, B.sub.9, W.sub.10 and B.sub.10 correspond to the fourth character, i.e., a numeral "3", and so on. The bar code shown in FIG. 1 is standardized as the Universal Product Code (UPC).
FIG. 2 shows an embodiment of the present invention. The bar code shown in FIG. 1 is scanned by a scanner 1 which delivers an electrical pulse signal containing a high level pulse width corresponding to a space area and a white bar and a low level pulse width corresponding to a black bar. In the bar code of FIG. 1, a width corresponding to one character, which includes two white bars and two black bars, is used as a constant. The electrical pulse signal delivered from the scanner 1 is supplied to a width counter 2 and a transition detector 3. The transition detector 3 detects a transition timing from the high level pulse to the low level pulse or vice versa. The width counter 2 delivers data corresponding to an added width of adjacent white and black bars under the control of the transition timing which is delivered from the transition detector 3. For example, the width counter 2 sequentially delivers a plurality of data corresponding to sums (w.sub.1 +b.sub.1), (b.sub.1 +w.sub.2), (w.sub.2 +b.sub.2), (b.sub.2 +w.sub.3), (w.sub.3 +b.sub.3 ), . . . . The sum of the white bar width and the black bar width is hereinafter represented as a white-black data (w+b), and that of the black bar width and the white bar width as a black-white data (b+w).
The white-black data and the black-white data sequentially delivered from the width counter 2 are stored in a buffer memory 26 and are sequentially shifted in shift registers 4 to 10. The data shifting in the shift registers 4 to 10 are controlled in accordance with the transition timing. Therefore, the white-black data and the black-white data are stored alternately and are shifted in the shift register 4 to 10. The two data delivered from the shift register 4 and the shift register 6 are supplied to an adder 11, while the two data delivered from the shift register 8 and the shift register 10 are applied to an adder 12. Two added data from the adder 11 and 12 are supplied to a character detection circuit 13. The character detection circuit 13 delivers a character detection signal of "1" when the two added data delivered from the adder 11 and 12 are substantially equal with each other, i.e., a difference between the two added data is within a predetermined value, which is predetermined in consideration of a printing quality of the bar code.
However, in practice, the character detection circuit 13 frequently delivers the character detection signal, when the scanner 1 scans the area surrounding the bar code. Therefore, the character detection signal delivered from the character detection circuit 13 is not used as a character discriminating signal.
According to the present invention, the character detection signal delivered from the character detection circuit 13 is further transmitted to shift registers 14 to 22 for preventing an error bar code discrimination. The shift registers 14 to 22 are operated synchronously with the shift registers 4 to 10. In the Universal Product Code (bar code), the number of characters contained in the bar code is varied in accordance with a user's specification. However, at least four characters are usually contained in the bar code. Therefore, four consecutive character detections are checked for discriminating the bar code in the present invention. Accordingly, the picked up signals are shifted into the registers 14, 18 and 22 and then are supplied to an AND gate 23 for checking four consecutive character detections.
FIG. 3 shows a data shifting table which will be used to give a detailed explanation of the invention. At a shift order "11" (left-hand column), the adder 11 (FIG. 2) delivers the data (b.sub.6 +w.sub.6 +b.sub.5 +w.sub.5) representing the character width of the numeral "1" and the adder 12 delivers the data (b.sub.4 +w.sub.4 +b.sub.3 +w.sub.3) representing the character width of the number system character. Since the character width is designed to be constant, the character detection circuit 13 delivers the character detection signal "1". At a shift order 15, the adder 11 delivers the data (b.sub.8 +w.sub.8 +b.sub.3 +w.sub.7) of the numeral "2" and the adder 12 delivers the data (b.sub.6 +w.sub.6 +b.sub.5 +w.sub.5) of the numeral "1". In this case, another character detection signal "1" is delivered. Furthermore, at a shift order 19, a further character detection signal "1" is delivered, similarly, and the AND gate 23 delivers the bar code discriminating signal. At this timing, the bar code discriminating signal indicates the existence of four consecutive characters since each character detection signal "1" shows the existence of two adjacent characters. The bar code discriminating signal delivered from the AND gate 23 is applied through a latch circuit 24 to a bar code reader and a bar code data delivering circuit 28.
On the other hand, the data delivered from the width counter 2 is supplied to a space detection circuit 25, which detects spaces S on the both sides of the bar code shown in FIG. 1, when the data from the counter 2 exceeds a predetermined value which is greater than the maximum value for the white or black bar. The output of the space detection circuit 25 is supplied to a memory address counter 27, which is supplied with the transition timing from the detector 3. The buffer memory 26 stores the white-black data and the black-white data delivered from the width counter 2 under the control of address data from the memory address counter 27.
In detail, when the space detection circuit 25 detects the space S of the surrounding area on the left side of the bar code, the buffer memory 26 begins to store the width data. Then, when the space S on the right side of the bar code is detected after the bar code is read and the discriminating signal has been deliverd, the width data stored in the buffer memory 26 is regarded as a bar code data and is transmitted through the bar code data delivering circuit 28 to the bar code reader. On the contrary, when the space S is detected secondarily but the bar code discriminating signal is not delivered, the buffer memory 26 begins to restore the width data delivered from the width counter 2, i.e., the data previously stored in the memory 26 disappears according to restoring.
As described above, the present invention relates to, not only the detecting condition in which the widths of adjacent characters are substantially the same, but also to the discriminating condition in which at least four consecutive characters should be included in a bar code. Consequently, the inventive bar code discriminating apparatus accurately discriminate a bar code even when the surrounding area of the bar code contains patterns such as numerals, alphabets, etc. other than the bar code. According to the present invention, it is easy to extract only a signal which accurately corresponds to a bar code. The signal is extracted from a scanned signal delivered from an optical scanner. A bar code reader can be constructed by a simple circuit configuration and a low calculation speed processor.
Those who are skilled in the art will readily perceive how to modify the invention. Therefore, the appended claims are to be construed to cover all equivalent structures which fall within the true scope and spirit of the invention.