Abstract:
A bar code reading apparatus includes a scanner, and a measuring circuit for measuring a width of each white bar contained in the bar code and a width of each black bar contained therein and for outputting a measurement signal indicative of the width of the each white or black bar. Further, the apparatus includes first, second and third detection circuits. The first detection circuit detects, from the measurement signal, a white bar having a width equal to or greater than a first reference value and outputs a first detection signal indicative of the width of the white bar. The second detection circuit detects, from the measurement signal, a white bar having a width equal to or greater than a second reference value and outputs a second detection signal indicative of the width of the white bar, the second reference being less than the first reference. The third detection circuit detects, from the measurement signal, a black bar having a width equal or greater than a third reference value and outputs a third detection signal indicative of the width of the black bar. A logic circuit receives the first, second and third detection signals and outputs a margin detection signal indicating detection of the margin area on the basis of the first, second and third detection signals.

Description:
BACKGROUND OF THE INVENTION 
     The present invention generally relates to a bar code reading apparatus, and more particularly to a bar code reading apparatus capable of precisely reading a bar code even when it is printed on a wrapper or the like with a positional error so that a margin area preceding or following the bar code is less than a predetermined width. 
     Conventionally, a bar code reading apparatus is used in a point-of-sales system. The bar code reading apparatus reads bar codes attached to wrappers of goods or the like. As is known, it is necessary to precisely recognize margin areas provided before and after the bar code and thereby read the bar code without errors. 
     A conventional bar code reading apparatus scans a bar code by a scanner and determines whether a margin area (normally a &#34;white&#34; area) is equal to or greater than a predetermined width (generally equal to seven modules). Such a bar code reading apparatus is disclosed in U.S. Pat. No. 4,074,852. 
     As shown in FIGS. 1A and 1B there is no problem when the conventional bar code reading apparatus scans a margin area which is equal to or greater than a predetermined width W1. It is noted that the last character bar is followed by guard bars, which are followed by the margin area. A low level of the illustrated signal indicates &#34;white&#34;, and a black level thereof indicates &#34;black&#34;. In contract, the conventional bar code reading apparatus cannot read bar codes precisely in a case where as shown in FIG. 1B, a bar code is printed in a rectangular white area surrounded by a black area (margin defining area or black frame) so that a margin area before or after the bar code is less than the predetermined width W1 (in the illustrated case, a back margin area after the guard bars has a width W2 less than the predetermined width W1). A similar problem may occur in a case where a front portion and/or a back portion itself of a bar code is curved, a bar code label attached on a wrapper is warped due to the presence a good contained therein. 
     SUMMARY OF THE INVENTION 
     It is a general object of the present invention to provide an improved bar code reading apparatus in which the above-mentioned disadvantages are eliminated. 
     A more specific object of the present invention is to provide a bar code reading apparatus capable of correctly margin areas located before and after the bar code so that it can be read precisely. 
     The above objects of the present invention are achieved by a bar code reading apparatus comprising scanning means for scanning a bar code including a character bar and a guard bar facing a margin area surrounded by a margin defining area and for generating a pulse signal corresponding to the bar code; and measuring means coupled to the scanning means, for measuring a width of each white bar contained in the bar code and a width of each black bar contained therein and for outputting a measurement signal indicative of the width of the each white or black bar. Further the apparatus comprises first detection means, operatively coupled to the measuring means, for detecting, from the measurement signal, a white bar having a width equal to or greater than a first reference value and for outputting a first detection signal indicative of the width of the white bar; second detection means, operatively coupled to the measuring means, for detecting, from the measurement signal, a white bar having a width equal to or greater than a second reference value and for outputting a second detection signal indicative of the width of the white bar, the second reference being less than the first reference; third detection means, operatively coupled to the measuring means, for detecting, from the measurement signal, a black bar having a width equal or greater than a third reference value and for outputting a third detection signal indicative of the width of the black bar; and logic means coupled to the first, second and third detection means, for receiving the first, second and third detection signals and outputting a margin detection signal indicating detection of the margin area on the basis of the first, second and third detection signals. 
     The aforementioned objects of the present invention are also achieved by a bar code reading apparatus comprising scanning means for scanning a bar code including a character bar and guard bars facing front and back margin areas surrounded by a margin defining area and for generating a pulse signal corresponding to the bar code; and measuring means coupled to the scanning means, for measuring a width of each white bar contained in the bar code and a width of each black bar contained therein and for outputting a measurement signal indicative of the width of the each white or black bar, the measurement signal includes a time-series of measured value signals T n-1  (n is an integer), T n  and T n+1 . The apparatus further comprises first holding means coupled to the measuring means, for holding one of the measured value signals until a next one of the measured value signals is output from the measuring means so that when the measured value signal T n+1  is applied to the first holding means, the first holding means outputs the measured signal T n  ; second holding means coupled to the first holding means, for holding one of the measured value signals from the first holding means until a next one of the measured value signals is output from the first holding means so that when the measured value signal T n+1  is applied to the second holding means, the second holding means outputs the measured value signal T n-1  ; first multiplying means coupled to the second holding means, for multiplying the measured value signal T n-1  by a first constant A 1  and for outputting a signal A 1  T n-1  ; and first comparing means coupled to the first holding means and the first multiplying means, for determining whether the measured value signal T n  is equal to or greater than A 1  T n-1  and for outputting a first detection signal based on a comparison result. The apparatus further comprises second multiplying means coupled to the second holding means, for multiplying the measured value signal T n-1  by a second constant A 2  and for outputting a signal A 2  T n-1  ; second comparing means coupled to the first holding means and the second multiplying means, for determining whether the measured value signal T n  is equal to A 2  T n-1  and for outputting a second detection signal based on a comparison result; third comparing means coupled to the measuring means and the first multiplying means, for determining whether the measured value signal T n+1  is equal to or greater than the signal A 1  T n-1  and for outputting a third detection signal based on a comparison result; and third multiplying means coupled to the first holding means, for multiplying the measured value signal T n+1  by a third constant A 1  &#39; and for outputting a signal A 1  &#39;T n+1 . The apparatus further comprises fourth comparing means coupled to the measuring means and the third multiplying means, for determining whether the measured value signal T n  is equal to or greater than A 1  &#39;T n+1  and for outputting a fourth detection signal based on a comparison result; fourth multiplying means coupled to the measuring means, for multiplying the measured value signal T n+1  by a fifth constant A 2  &#39; and for outputting a signal A 2  &#39;T n+1  ; fifth comparing means coupled to the first holding means and the fourth multiplying means, for determining whether the measured value signal T n  is equal to A 2  &#39;T n+1  and for outputting a fifth detection signal based on a comparison result; sixth comparing means coupled to the second holding means and the third multiplying means, for determining whether the measured value signal T n-1  is equal to or greater than the signal A 1  &#39;T n+1  and for outputting a sixth detection signal based on a comparison result; and logic means for receiving the first through sixth detection signals and for outputting a margin detection signal indicative of the front and back margins on the basis of the first through sixth detection signal. Alternatively, it is possible to provide multiplier means separately for each of the third and sixth detection means. 
     Further objects, features and advantages of the present invention will become apparent from the following detailed description when read in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1A and 1B is a diagram illustrating a case where an appropriate margin area after a bar code is scanned by a conventional bar code apparatus; 
     FIGS. 1C and 1D is a diagram illustrating a problem caused in the conventional bar code apparatus; 
     FIG. 2 is a block diagram illustrating an outline of a bar code reading apparatus according to the present invention; 
     FIGS. 3A and 3B is a waveform diagrams illustrating the operation of the present invention; 
     FIG. 4 is a block diagram illustrating a detailed configuration of the bar code reading apparatus shown in FIG. 2; 
     FIG. 5 is a block diagram of a bar code reading apparatus according to a preferred embodiment of the present invention; 
     FIG. 6 is a block diagram of a bar code reading apparatus according to a second preferred embodiment of the present invention; 
     FIGS. 7A and 7B is a waveform diagrams illustrating the operation of the second embodiment shown in FIG. 6; 
     FIG. 8 is a circuit diagram of a circuit which is designed to combine a margin detection signal obtained by the first embodiment shown in FIG. 5 and a margin detection signal obtained by the second embodiment shown in FIG. 6; 
     FIG. 9A is a block diagram of a variation of the first embodiment shown in FIG. 5; 
     FIG. 9B is a block diagram of a variation of the second embodiment shown in FIG. 6. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Referring to FIG. 2, there is illustrated a general configuration of a bar code reading apparatus according to the present invention. The bar code reading apparatus in FIG. 2 includes an interval measuring circuit 1, a first detection circuit 2, a second detection circuit 4, a third decision circuit 6, an AND gate 8 and an OR gate 10. 
     The interval measuring circuit 1 measures an interval between the leading edges of two consecutive pulses of a binarized signal applied thereto and generates a measurement signal indicative of the measured interval. Further, the interval measuring circuit 1 measures an interval between the trailing edges of two adjacent pulses thereof and generates a measurement signal indicative of the measured interval. That is, the interval measuring circuit 1 measures the sum of the widths of adjacent white and black (black and white) bars. Such an interval is frequently called a delta distance. Hereinafter, the sum of the widths of the adjacent white and black (black and white) bars which is output from the interval measuring circuit 1 is referred to as a measured interval or width. 
     The first, second and third detection circuits 2, 4 and 6 use a time-series of measured intervals T n-1  (n an integer), T n  and T n+1 . For example, as shown in FIG. 3, T n-1 , T n  and T n+1  relate to a guard bar, a back margin area and a margin defining area (a black frame), respectively. As will be described in detail later, the width of each white or black bar is represented by the sum of the widths of two consecutive white and black or black and white bars. 
     The first detection circuit 2 detects a white bar having a width equal to or greater than a first reference value, which is a multiple of a value equal to one module. For this purpose, the first detection circuit 2 determines whether or not the measured interval Tn relating to the margin area (it can also be said that Tn is the width of the margin area) is equal to or greater than the first reference value. When the margin area has a width equal to seven modules, the first reference value is set equal to or greater than seven modules. In other words, the first reference value is a multiple of the measured interval T n-1 , A 1  T n-1  where A 1  is a coefficient. It is noted that T n-1  corresponds to the sum of the width of the white guard bar and the width of the subsequent black guard bar, i.e., two modules. That is, the first detection circuit 2 determines whether or not the measured interval Tn is equal to or greater than A 1  T n-1 . When the margin area is equal to seven modules, it is preferable that the coefficient A 1  be equal to or greater than 3.5. That is, the first reference value A 1  T n-1  corresponds to a normal width of the margin area. 
     The second detection circuit 4 detects a white bar which is equal to or greater than a second reference less than the aforementioned first reference value. For this purpose, the second detection circuit 4 determines whether or not the measured interval Tn is equal or greater than a second reference value. It is preferable that the second reference value be equal to a multiple of the measured interval T n-1 , A 2  T n-1  where A 2  is a coefficient and is less than the coefficient A 1 . When the margin area is equal to seven modules, it is preferable that the coefficient A 2  be equal to or greater than 1.25 and is equal to or less than 3.5. In this case, the second detection circuit 4 detects a white bar (margin area) having a width between 2.5 times the one-module and 7 times the one-module. That is, the second detection circuit 4 is directed to determining whether or not the margin area has a width equal to or greater than a minimum margin area width (A 2  T n-1 ), which is considered as a margin area. 
     The third detection circuit 6 detects a black bar (margin defining area) having a width equal to or greater than a third reference value. For this purpose, the third detection circuit 6 determines whether or not the measured interval T n+1  relating to the margin defining area is equal to or greater than a third reference value. It is preferable that the third reference value be equal to a multiple of the measured interval T n-1  relating to the guard bar, A 3  T n-1  where A 3  is a coefficient. The third detection circuit 6 is directed to determining whether or not a black area having a sufficient width follows or precedes the white area (margin area) before or after this black area. When the margin area is equal to seven modules, it is preferable that the coefficient A 3  be equal to or greater than 3. In this case, the third detection circuit 6 detects a black bar (margin defining area) having a width equal to or greater than six modules. That is, the third reference value A 3  T n-1  corresponds to a normal width of the margin area. As will be described in detail later, the first, second and third detection circuits 2, 4 and 6 operates in a similar way when the front margin area is detected. 
     Detection signals from the second and third detection circuits 4 and 6 are supplied to the AND gate 8. Outputs from the first detection circuit 2 and the AND gate 10 are supplied to the OR gate, which outputs a margin detection signal. It is noted that the first detection circuit 2 is based on a conventional margin detection algorithm. Thus, there is a possibility that the first detection circuit 2 does not detect margin areas correctly due to a poor positioning precision in printing the bar code in the white area defined by the black frame (margin defining area), for example. Even in such a case, the second and third detection circuits can correctly detect a margin area having a width less than the predetermined width (equal to seven modules, for example). 
     Actually, as shown in FIG. 4, the configuration shown in FIG. 2 includes a first data holding circuit 3 and a second holding circuit 5. The first data holding circuit 3 holds the current measured interval from the interval measuring circuit 1 until a next measured interval is output from the interval measuring circuit 1. An output signal from the first data holding circuit 3 is supplied to the second data holding circuit 5 and the first and second detection circuits 2 and 4. The second holding circuit 5 holds the current measured interval from the first holding circuit 3 until the next data measured interval is output from the first data holding circuit 3. An output signal from the second holding circuit 5 is supplied to the first, second and third detection circuits 2, 4 and 6. With this arrangement of the first and second data holding circuits 3 and 5, the measured intervals T n-1 , T n  and T n+1  are supplied to the first, second and third holding circuits 2, 4 and 6 at the same timing. 
     FIG. 5 is a detailed block diagram of the bar code reading apparatus shown in FIG. 4, in which those parts which are the same as those shown in the previous figures are given the same reference numerals. The configuration shown in FIG. 5 is directed to precisely detecting a back margin area following the bar code. Referring to FIG. 5, a bar code scanner 20 scans a bar code and generates an electrical output signal. A binarization circuit 21 binarizes the output signal from the bar code scanner 21, and supplies the interval measuring circuit 1 with a binarized digital signal. The interval measuring circuit 1 is made up of a bar width counter 11, a data latch circuit 12 and an adder 13. The bar width counter 11 measures the width of each white/black bar. The data latch circuit 12 latches the current bar width until the width of the next bar is output from the bar width counter 11. The adder 13 adds output signals from the bar width counter 11 and the data latch circuit 12. When the signal from the bar width counter 11 relates to a white bar, the signal from the data latch circuit 12 relates to a black bar preceding the white bar. In contract, when the signal from the bar width counter 11 relates to a black bar, the signal from the data latch circuit 12 relates to a white bar preceding the black bar. The adder 13 outputs the sum of the width of the white bar (black bar) and the width of the black bar (white bar). The sum output from the adder 13 corresponds to the aforementioned measured interval. The sum of the width of a white bar and the width of a black bar following this white bar is handled so as to represent the width of the white bar. The sum of the width of a black bar and the width of a white bar following this black bar is handled so as to represent the width of the black bar. 
     The output signal from the adder 13 is supplied to the first data holding circuit 3 and a comparator 6 1 , which is a part of the third detection circuit 6 shown in FIG. 4. The first data holding circuit (latch circuit) 3 holds the current measured interval from the adder 13 until the next output measured interval is output therefrom. The output signal from the first data holding circuit 3 is supplied to the second data holding circuit (latch circuit) 5 and comparators 2 2  and 4 2 . The second data holding circuit 5 holds the current measured interval until the next measured interval is output therefrom. The output signal from the second data holding circuit 5 is supplied to multipliers 2 1  and 4 1 . 
     The first detection circuit 2 shown in FIG. 4 is composed of the multiplier 2 1  and the comparator 2 2 . The second detection circuit 2 shown in FIG. 4 is composed of the multiplier 2 1  and the comparator 4 2 . The third detection circuit 6 shown in FIG. 4 is composed of the multiplier 2 1  and the comparator 6 1 . In the configuration shown in FIG. 5, the aforementioned constant A 1  is set equal to the constant A 3 , and A 1  =A 3  =3.5. Further, the constant A 2  is set equal to 1.5. The multiplier 2 1  multiplies the output signal (measured interval) by 3.5. The multiplier 4 1  multiplies the output signal T n-1  (measured interval) by 1.5. An output signal from the multiplier 2 1  is supplied to the comparators 2 2  and 6 1 . An output signal from the multiplier 4 1  is supplied to the comparator 4 2 . 
     When the adder 13 outputs the measured interval T n+1 , the data holding circuits 3 and 5 output the measured intervals T n  and T n-1 , respectively, and the multipliers 2 1  and 4 1  output 3.5T n-1  and 1.5T n-1 , respectively. The comparator 2 2  determines whether or not the measured interval T n  is equal to or greater than 3.5T n-1  (Tn≧3.5T n-1 ). The comparator 4 2  determines whether or not the measured interval T n  is equal to or greater than 1.5T n-1  (Tn≧1.5Tn). The comparator 6 1   determines whether or not the measured interval T n+1  is equal to or greater than 3.5T n-1  (T n+1  ≧3.5T n-1 ). Detection signals from the comparators 4 2  and 6 1  are supplied to the AND gate 8. Output signals 2 2  and the AND gate 8 are supplied to the OR gate 10, which outputs a back margin detection signal. 
     Referring to FIG. 3A, when T n  ≧3.5T n-1 , the comparator 2 2  outputs a high-level signal, which passes through the OR gate 10 and is output as the back margin detection signal. FIG. 3(B) illustrates a case where the measured interval T n  is less than 3.5T n-1 . In this case, the output of the comparator 2 2  is low. When T n  ≧1.5T n-1  and T n+1  ≧3.5T n-1 , the comparators 4 2  and 6 1  generate high-level outputs. In this case, the AND gate 8 generates a high-level output, which passes through the OR gate 10 and is drawn as the back margin detection signal. Thus, it is possible to detect a bar code which is printed out of the predetermined position in a white area surrounded by a black margin defining area or which is curved so that the margin area before or after the bar code is less in width than the predetermined value. 
     A description is given of a second embodiment of the present invention with reference to FIGS. 6, 7A and 7B, in which those parts which are the same as those shown in FIG. 5 are given the same reference numerals. The second embodiment is directed to precisely detecting a front margin area which precedes the bar code. Referring to FIGS. 6, 7A and 7B, when the measured interval T n-1  relating to the black frame area (margin defining area) is output from the data holding circuit 5, the measured interval T n+1  relating to the guard bar is applied to the data holding circuit 3, and the measured interval T n  relating to the margin area is output from the data holding circuit 3. 
     The measured interval T n+1  is applied to multipliers 2 3  and 4 3 . The multiplier 2 3   multiplies the measured interval T n+1  by 3.5, and the multiplier 4 3  multiplies the measured interval T n+1  by 1.5. An output signal from the multiplier 2 3  is input to comparators 2 4  and 6 2 , and an output signal from the multiplier 4 3  is input to a comparator 4 4 . The first detection circuit 2 shown in FIG. 2 is composed of the multiplier 2 3  and the comparator 2 4 . The second decision circuit 4 shown in FIG. 2 is composed of the multiplier 4 3  and the comparator 4 4 . The third detection circuit 6 shown in FIG. 2 is composed of the multiplier 2 3  and the comparator 6 2 . 
     The comparator 2 4  compares the measured interval T n  with the multiplied interval 3.5T n+1  and determines whether Tn≧3.5T n+1 . The comparator 4 4  compares the measured interval Tn with the multiplied interval 1.5T n+1  and determines whether Tn≧1.5T n+1 . The comparator 6 2  compares the measured interval T n-1  with the multiplied interval 3.5T n+1  and determines whether T n-1  ≧3.5 T n+1 . Detection signals from the comparators 4 4  and 6 2  are input to an AND gate 28. An OR gate 30 is supplied with an output signal of the AND gate 28 and a detection signal from the comparator 2 4 . An output signal from the OR gate 30 is a front margin detection signal. 
     In practical use, it is preferable to use the combination of the configurations shown in FIGS. 5 and 6. In this arrangement, an OR gate 32 shown in FIG. 8 is used. The OR gate 32 is supplied with the back margin detection signal from the OR gate 10 and the front margin detection signal from the OR gate 30. An output signal of the OR gate 32 is a finalized margin detection signal. When the front and back margin areas are correctly detected. The finalized margin detection signal is output from the OR gate 32 twice. 
     In the configuration shown in FIG. 5, the multiplier 2 1  is provided in common to the comparators 2 2  and 6 1 . Alternatively, as shown in FIG. 9A, it is possible to provide two multipliers 2 1a  and 2 1b  having different coefficients A 1  and A 3  for the comparators 2 2  and 6 1 , respectively. As shown in FIG. 9B, a similar arrangement to that shown in FIG. 9A is applicable to the configuration shown in FIG. 6. Two multipliers 2 3a  and 2 3b  are provided having different coefficients A 1  &#39; and A 3  &#39;. The coefficient of the multiplier 4 3  is represented by A 2  &#39;. For example, A 1  =A 3  =A 1  &#39;=A 3  &#39;, and A 2  =A 2  &#39;. 
     The present inVention is not limited to the aforementioned embodiments, and variations and modifications may be made without departing from the scope of the present invention.