Combining bar code read data

Abstract: A bar code reading arrangement (apparatus and method) for reading and combining and connecting fragmentary read data. A bar code scanner provides a plurality of one-dimensional images and comprises an image sensor for reading the bar code data. As the scanner is moved relative to the bar code, a plurality of parallel scanning lines are formed from the one-dimensional images. Bar code data segments from the scanning lines area read by the image sensor and are combined in accordance with a pre-processing and combining method. The pre-processing method comprises the steps of: reading information on the image sensor concerning the positions of end points located at or near both ends of the bar code; defining an end point as being fixed or moving, based on the relative positional change of the end point; and reading the data segments as both bar code information, and positional information with respect to the positions of the end points.

Description: The present invention relates to a method and an apparatus for reading bar code data from a bar code. Pen-type readers and stationary readers employing laser light are known as a means for optically reading bar codes. Further, so called one-touch type readers that employ one-dimensional image sensor, herein after referred to as a "line sensor" for improving the operability of scanning cylindrical commodities such as bags having irregular shapes and cans have recently been becoming the mainstream of bar code scanning systems. From DE-A-31 01 827, an optical bar code reader is known, using a scanning laser beam which is capable of recognizing a bar code, the height of which is relatively low. To cover the entire bar code by the laser beam even if there is an inclination between the angle of sweep and the longitudinal extension of the bar code, the laser beam is swept over the bar code in a plurality of parallel lines so that a plurality of fragmentary bar code data are delivered by the bar code reader. The fragments are combined to provide a complete series of bar code data representing the bar code in total. The apparatus makes use of a plurality of memory devices for temporarily storing a plurality of fragmentary bar codes to be combined with each other. The apparatus comprises a rotating drum having a plurality of mirrors effecting the laser beam sweep in parallel lines. This apparatus is not susceptible of being hand held. From Patent Abstracts of Japan, vol. 7, no. 6 (P-167) (1151) a bar code reader is known in which the bar code is scanned optically by a CCD scanner in a plurality of parallel scanning lines. The data delivered by scanning in a plurality of lines are stored, and they are combined, eliminating overlapping parts from the data. From FR-A-2 423 829, a method of reading bar codes is known in which a reading light beam is swept over the bar code in a two-dimensional pattern comparative to the electron beam sweep in a CRT. In case that an inclination is existent between the main scanning direction and the longitudinal extension of the bar code, so that fragmentary data are delivered, a combination of data fragments is effected to attain information on the bar code in total. This method is not susceptible of being performed with a so-called one-touch type reader as described above. When a bar code is scanned with a reader of the type described above, if the angle of inclination of scanning with respect to the bar code is larger than a predetermined angle, a part of the bar code falls out of the field of view of the line sensor, so that only a fragment of the bar code can be read. In such a case, in order to read the entire bar code, the operator must repeat the scanning operation. In order to minimize the difficulty experienced by the operator when repeatedly conducting the bar code read operation, it is conventional practice to set the height of bar codes so as to be greater than a predetermined level. In the case of stationary readers, a bar code may need to be scanned in a multiplicity of directions (e.g., four directions). Since bar codes are printed on media such as price tags, labels, etc. the size of the media is predetermined and the bar code must be sized to fit the media. A special-purpose printer is needed to print the codes on the media. In the case of stationary readers, it is necessary to scan a bar code in multiplicity of directions at the same time, which complicates both the hardware and software arrangements. SUMMARY OF THE INVENTION The above-described problems may be solved by combining fragmentary read data by connecting the fragments together. The present invention provides a bar code reading arrangement (apparatus and method) wherein a bar code reader is provided with a one-dimensional image sensor for reading bar code data. The image sensor and bar code are moved relative to each other to scan and optically read the bar code. To effect combining, certain steps are carried out, as set forth in claim 1. A bar code scanning and data-combining system performing the method 16 set forth in claim 2. Prefered embodiments thereof are subject matter of the dependent claims. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is an illustration of the relationship between the scanning lines and the bar code. Fig. 2a shows a case where both end points of a scanning line initially are fixed end points. Fig. 2b shows a case where one end point of the scanning line is a fixed end point, and the other end point is a moving end point. Fig. 2c shows another case where one end point of the scanning line is a fixed end point, and the other end point is a moving end point. Fig. 2d illustrates a case where the medium of the bar code is deformed. Fig. 3 shows a state diagram of the transition of the end points of the scanning line. Fig. 4 shows the geometric relation between adjacent scanning lines. Fig. 5 shows the geometric relation between two adjacent scanning lines in further detail. Fig. 6 shows the relation between adjacent-scanning lines and a typical bar code. Fig. 7 shows an embodiment of the present invention. Fig. 8 is a block diagram of a controller for executing the functions in the present invention. Fig. 9 shows a series of data registers from the controller in Figure 8. Fig. 10 shows a flowchart of the pre-processing algorithm. Fig. 11 shows a flowchart for the combining algorithm. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT Fig. 1 is an illustration of the relationship between the scanning lines and the bar code. The left-hand end of bar code 10 is denoted by L o , while the right-hand end thereof is denoted by R o . The inclination angle Θ of scanning line 12 of a line sensor includes a positive inclination angle (in the case where scanning line 12 is inclined to extend from the left-bottom corner to the right-top corner as illustrated) and a negative inclination angle (in the case where scanning line 12 is inclined to extend from the left-top corner to the right-bottom corner). When the inclination angle Θ is so small that scanning line 12 extends over from the left-hand end L o to the right-hand end R o of bar code 10 (i.e., when both ends of bar code 10 are within the field of view of line sensor 12), it is unnecessary to effect combining of read data. The inclination angle Θ of scanning line 12, the speed of parallel movement of scanning line 12 and the scanning period are substantially constant. There are cases where either bar code 10 or line sensor 12 move relative to each other. The present invention may be applied to either case. When the inclination angle Θ of scanning line 12 is positive, scanning line 12 is moved parallel from the left-top corner to the right-bottom corner of bar code 10 as shown by the representative example lines X, Y and Z. When the inclination angle Θ is negative, scanning line 12 is moved parallel from the right-top corner to the left-bottom corner of bar code 10. The intersections of scanning line 12 and the left and right-hand ends L o ,R o of bar code 10 are denoted by the reference symbol a, while the intersections of scanning line 12 and the upper and lower sides of bar code 10 are denoted by the reference symbol b. The points a and b show end points of bar code information sensed by line sensor 12. In the case where the position of scanning line 12 moves a predetermined distance from X to X', from Y to Y', or from Z to Z', the movement of points a and b can be expressed by x and y, respectively; if the inclination angle Θ is 45° or less, then x is less than y and the state of both ends of the bar code on the line sensor can be determined by making a judgment with respect to the amount of movement of the read data. In the present invention, a point where scanning line 12 intersects the left-hand end L o or the right-hand end R o of bar code 10, such as the point a, is defined as a fixed end point. A point where the scanning line 12 intersects the upper or lower side of the bar code 10, such as the point b, is defined as a moving end point. Fig. 2a shows a case where both end points L and R of the scanning line are initially fixed end points a (L=a, R=a). Such a condition is herein denoted by the symbol A₁, whereby both ends of bar code 10 are initially within the field of view of the line sensor. Therefore, it suffices to perform reading as usual and decode the read data (shown by the bold line in Fig. 2a). Fig. 2b shows a case where the inclination angle Θ is positive. In this case, in the initial condition B₁, read data is taken in at least once in order to obtain bar code information concerning the position of an end point at or near the left-hand end L o of bar code 10. If the inclination angle Θ of scanning line 12 is relatively small, the condition changes directly to a condition where L=a and R=a (i.e., the above described condition A₁). After the condition A₁ is established, the read data in condition B₁ is renewed to the read data in the condition A₁, and the process proceeds to a subsequent decoding processing. On the other hand, if the inclination angle in condition B₁ becomes relatively large, the condition changes from the condition B₁ to condition B₂ (L=b, R=b). In the condition B₂, bar code information at both end points change on each occasion; therefore, reading is executed for each scanning period to obtain data. When the condition changes to condition B₃ (L=b, R=a), read data is taken in at least once in order to obtain bar code information concerning the position of an end point at or near the right-hand end of bar code 10. Segments of read data obtained in the conditions B₁ to B₃ are fragmentary but overlap each other and therefore include all the information concerning bar code 10 from the left-hand end L to the right-hand end R. Fig. 2c shows a case where the inclination angle Θ is negative. In this case, the condition changes from C₁ to A₁ , or from C1 to C₂ then to C₃ in the same way as in of Fig. 2b except that the inclination angle Θ of scanning line 12 in this case is negative. Fig. 2d shows a case where the bar code bearing medium concerned is defective, for example, the medium is partially deformed as illustrated. In this case, before the above-described condition A₁, B₁ or C₁ . is reached, a condition occurs whereby L-b and R-b appears as shown by the condition D₁, so that no reading is carried out until the condition has changed to condition A₁, B₁ or C₁, at which time the corresponding processing condition is executed. Fig. 3 shows the state transition of both end points at the left-hand end L o and the right-hand end R o , S o denotes an initial condition, while S₁ denotes the condition where bar code 10 appears. The state of the end points at L o and R o changes from the condition S₁ according to the above-described cases. When condition A₁ (L=a, R=a) is directly reached, the process is switched over to decoding processing. Further, when the condition S₁ changes directly to A₁, no combining processing is needed and therefore there is no need for pre-processing. However, if both fixed end points L o and R o for L and R, respectively are reached through the conditions B₂, C₂ then B₃, C₃, the process is switched over to decoding processing after combining processing has been executed. Fig. 4 shows the geometric relation between two adjacent scanning lines, and illustrates-one technique for combining.read data from bar code 20. Addresses of read data on a line sensor are obtained by the n-1 th (n is an integer having a value of 2 or more) and n th scanning lines. The address of the starting (left-hand in this case) end point of the read data where the n th scanning line enters the bar code is L n , while the address of the terminating end point of the read data where said scanning line leaves the bar code (right-hand in this case) is R n . In the case of the n-1 th scanning line, the starting and terminating end point addresses are L n-1 and R n-1 , respectively. The data of R n-1 on the n-1 th scanning line is the terminating end of data which is to be combined and therefore referred to as the "data tail". The space l between scanning lines n and n-1 is equal to a distance through which the scanning line is moved during one scanning period. Assuming that the speed of movement of the scanning line, scanning period and the inclination angle Θ are constant as described above, the address of R n-1 on the n-1 th scanning line is coincident with and corresponds to the address of that position on the n th scanning line where the perpendicular from R n-1 intersects the n th scanning line at right angles. During one scanning period, the position of e.g. a code bar on the scanning line n-1 shifts by an amount corresponding to the distance d (shown in Fig. 4) on the n th scanning line while the scanning line is advanced through the distance l. Accordingly, the top end of the data on line n which is to be combined with the data on line n-1 is at the position R n-1 -d. The data at this position is referred to as "data head". The above-described distance d is geometrically obtained as follows: d= l 2 R n -R n-1 However, when it is difficult to assume l, it is possible to approximate d. Fig. 5 illustrates that so long as the inclination angle Θ is not considerably large, the distance d is approximately equal to the distance of movement (L₂-L₁) of the end point at the left-hand end (or the right-hand end) of the scanning line during one period, i.e. d ≈ L₂-L₁. Combination of data is effected by connecting together the data tail, defined as the termination of data on line n-1 at address R n-1 , and the data head, defined as the beginning of data on line n at the address equal to the expression R n-1 -d. The result is a continuous stream of data. In order to increase the degree of accuracy, however, the following method may be effectively employed. Fig. 6 shows a model of a data tail, data head and their vicinities. A bar code 30 provides a bar at the position of R n-1 on the n-1 th scanning line which is denoted by B n-1,p , while a space which immediately precedes the bar is denoted by W n-1,p-1 : the corresponding n th bar and space are denoted by B n,q and W n,q-1 , respectively. A bar which is at L n on the n th scanning line is denoted by B n,s , while a space which is immediately subsequent to the bar is denoted by W n,s , and the bar and space on the n-1 th scanning line which correspond to them are denoted by B n-1,r and W n-1,r , respectively. As shown in Fig. 6, the n-1 th scanning line barely touches the upper end of the bar B n-1,p , while the n th scanning line barely touches the lower end of the bar B n,s . If scanning is effected in this state, bar data becomes shorter than the actual length; therefore, if such data is employed, the result of combining is incomplete. For this reason, at the n-1 th scanning line, a space W n-1,p-1 which immediately precedes B n-1,p is preferably employed as a data tail and at the n th scanning line, W n,q-1 is correspondingly employed as a data head. Although the combining accuracy is increased by connecting together the above-described data tail W n-1,p-1 and data head W n,q-1 , it is also possible to further check data in the vicinities of the data tail and head with each other and judge the degree of coincidence between the data.. Referring to Fig. 6, pieces of data which are present in the section on the n-1 th scanning line from W n-1,p-1 to W n-1,r and pieces of data which are present in the corresponding section on the n th scanning line up to W n,s are compared, and if the degree of coincidence is high, the pieces of data concerning the corresponding positions are connected together. In this case, it may be considered that a data tail and a data head which are to be combined together are respectively provided with certain ranges. If the degree of the above-described coincidence is low, the n th data is shifted either forward or backward by one bar or space and then a similar comparison is repeated. Fig. 7 is a block diagram of a bar code reader provided with a bar code combining section according to the present invention. A one-touch type scanner 32 provides the above-described line sensor. Scanner 32 projects a plurality of one-dimensional images 34 which form scanning lines 12 as scanner 32 is moved across bar code 10. Fragmentary pieces of data which are optically read through scanner 32 are pre-processed in pre-processing section 36, then combined together in a combining section 38. The combined bar code information is recognized in a decoding section 40 and further checked in a format check section 42 as to whether or not the combined bar code information satisfies a predetermined condition. If it is judged that the predetermined condition is satisfied, the bar code information is output through an interface section 44. If decoding section 40 and format check section 42 determine that no combining can be effected, or that the combined bar code information does not satisfy a predetermined condition because of considerable deformation of the medium, the process is executed over again from the combining processing. Fig. 8 is a block diagram of a microcomputer for executing the functions shown in the above-described block diagram. The reference numeral 50 denotes a one-touch type scanner, 52 a CPU, 54 a ROM, 56 a RAM, and 58 an interface. Bar code information 60 and synchronizing signal 62 are input to CPU 52 from scanner 50. The contents of ROM 54 include pre-processing algorithm, combining algorithm, bar code decoder, format check, interface control, etc. The contents of the RAM 56 include a buffer for executing various programs, read data register, etc. Fig. 9 shows a model of the data register incorporated in the RAM 56. Data obtained by each scanning from the first line to the n th line (n is positive integer) is stored in the register. Generally, the address of a black bar at the left-hand end of the x th line is stored in "LxADD Reg", whereas the address of a white space at the right-hand end of the x th line is stored in "RxAdd Reg." The length of the y th black bar on the x the line is stored in register Bxy, whereas the length of the y th white space on the x th line is stored in register Wxy. Fig. 10 shows one example of a flowchart of the pre-processing for the bar code combining process. The flowchart will first be explained in order with respect to the case shown in Fig. 2b. After the flow is started at Step 1, initialization is effected at Step 2. Then, if bars appear at Step 3, the addresses of bars L and R in Step 4 are stored at predetermined addresses for the first line in the above-described data register. Next, it is judged whether or not L is fixed (Step 7). It is judged whether L and R are fixed end points a or moving end points b on the basis of the amount of change of the addresses of the bars L and R, (i.e., if d≈ L₁-L₂ exceeds a predetermined value, L is a moving end point). However, since the judgment does not need a large amount of positional information, when the amount of movement is relatively small, unnecessary information is discarded by appropriately thinning out the positional information (Steps 5 and 6). If it is judged that L is fixed (Step 7), the processing of L=a is executed and the flag LF=1 is set (Step 8). Next, it is judged whether or not R is moving (Step 9). If YES, the processing of R=b is executed (Step 10), and the data at this time is read (Step 11). Reading of data is repeated until the flag RF=1 (Step 12) is set. Data in this case is renewed One after another. If it is judged that L is not fixed in the course of executing the above-described repetitive routine, the processing of L=b (Step 13) is executed, and it is judged whether or not R is moving (Step 14). If YES, that is, if R is judged to be moving, the processing of R=b is executed- (Step 15). If in this case LF=1 (Step 16), then data is repeatedly read-until the flag RF=1 is set (Step 25). Data which is read in this case is stored one by one in predetermined lines in the data register. If it is judged that R is not moving in the course of executing the above-described repetitive routine, the processing of R=a (Step 18) is executed. Then, the flag RF=1 is set, and data is further read (Step 19). Thereafter, it is judged whether or not LF=1 (Step 20). If YES, the addresses of L and R are cleared and the flags are restored to the initial state where LF=0 and RF=O (Step 21). Then, the process proceeds to combining processing (Step 22). After completion of the combining processing, decoding is effected (Step 23), thus completing the process (Step 24). It should be noted that, if it is judged in Step 9 that R is not moving, the processing of R=a (RF=1) is executed (Step 25), and data at that time is read (Step 26). Since, in this case, combining of data is not needed, the addresses of L and R are cleared, and the flags are restored to the initial state where LF=0 and RF=0. Then, the process proceeds to decoding. Fig. 11 shows a flowchart of the combining Step 22. After the flow is started (Step 1), initialization is effected (Step 2). Then, it is judged whether or not L is fixed (Step 3). If YES, the difference between L (L₁) of the first line and L (L₂) of the second line is calculated to obtain d (Step 4). Then, pre-processing is carried out according to the above-described procedure in Fig. 10. Thereafter, it is judged whether or not W n,q-1 of the n th line and W n-1,p-1 on the n-1 th line are substantially equal to each other (Step 6). One reason why it is judged whether or not the two pieces of data are "substantially equal to each other" is that it is impossible to expect the two pieces of data to exactly coincide with each other due to the approximate calculation performed to obtain d. Instead, for areas on the two lines which are assumed to be overlapping each other, a similar judgment is made with respect to a bar and a space sequentially toward the starting end. When it is judged that all the corresponding pieces of data in the areas are approximate to each other, pieces of data on the n-1 th line from W n-1,r to W n-1,p-1 and pieces of data on the n th line from W n,s to W n,q-1 are laid one upon another for each coincident position to thereby combine data (Step 10). When the degree of the above-described coincidence is low, a space W n,q-2 on the n th line which immediately precedes the data to be checked and W n-1,p-1 are judged as to the degree of coincidence therebetween. Thereafter, the degree of coincidence is similarly judged up to W n,s and W n-1,r-1 (Steps 11 to 13). When the degree of coincidence is still low, a space W n,q on the n th line which is immediately subsequent to the data to be checked and W n-1,P-1 are judged as to the degree of coincidence; thereafter, the degree of coincidence is similarly judged up to W n,s and W n-1,r-1 (Steps 14 to 16). When no coincidence is found even if these judgments are made, processing for incapability of combining is executed (Step 17), thus completing the flow. As has been described above, the present invention provides the following effects. Even when the angle of inclination of the sensor is larger than a predetermined angle so that read data is fragmentary, a period from the time when either one of the end points of bar code information is a fixed end portion, and the other is a moving end point, to the time when the moving end point changes to a fixed end point can be judged. The time judgment is made on the basis of information concerning the positions of the end points of the bar code information which change sequentially, and information concerning the positions of the end points on the line sensor obtained during the judged period are read as data; a data tail and a data head of respective pieces of data are then connected together to thereby combine the pieces of data. Therefore, it is possible to reconstruct even fragmentary data. Accordingly, it is possible to reduce the height of bar codes as compared with those which have heretofore been employed.

Claims: A method for reading and combining fragmentary bar code data from a bar code (10) having a leading and a trailing edge (L,R), comprising the steps of: emitting a plurality of one-dimensional images from a scanner one after the other, each of said images corresponding to a scanning line; moving said scanner relative to said bar code (10) once in a single direction over a duration of time sufficient for forming a plurality of scanning lines, said scanning lines being parallel to each other and eachline comprising a sequence of points corresponding to a sequence of adresses : reading a bar code data segment from each said scanning line, each said bar code data segment having a location corresponding to a part of said address sequence; determining for each of said bar code data segments the addresses of the start and end points of intersection of the respective scanning line with the bar code; characterised in that said method further comprises the steps of : determining whether a first intersection of a scanning line (n-1) with the leading edge (L O ) of the bar code (10) has occurred by comparing the addresses of the start points of intersection of each successive pair of adjacent scanning lines (n-1,n); determining whether a first intersection of a scanning line with the trailing edge (R o ) of the bar code (10) has occurred by comparing the addresses of the end points of intersection of each successive pair of adjacent scanning line; determining the address difference (d) between the address (R n-1 ) of the data tail of the scanning line (n-1) which coincider with the leading edge (L o ) of said bar code (10), said data tail being defined as the data at the end point of intersection of said scanning line (n-1) with the bar code and the address (R n-1 -d) of the data head of the next adjacent scanning line (n), said data head being defined as the data at the point on said next adjacent scanning line (n) corresponding to the same data as that of the said data tail of scanning line (n-1) ; comparing the bar code data segment of said scanning line (n-1) with the bar code data segment located at addresses before the start address (R n-1 -d) of the data head of said next adjacent scanning line (n); connecting said data head of said next adjacent scanning line (n) to said data tail of said scanning line (n-1) if said comparison falls within a predetermined range of similarity, and repeating said connecting step until said coincidence of a data tail with the trailing edge (R o ) of the bar code (10) has occurred. A bar code scanning and data-combining system comprising: a scanner (32), capable of being moved relative to a bar code (10) having a leading and a trailing edge (L,R), comprising: means for emitting a plurality of one-dimensional images, said plurality of one-dimensional images thereby forming a plurality of parallel scanning lines (12) as said scanner (32) is moved once across said bar code (10) in a single direction, and means for reading a plurality of bar code data segments from adjacent parallel scanning lines (12) , said bar code data segments being formed by an incidence of said scanning lines (12) upon said bar code (10) ; means for determining for each of said bar code data segments the addresses of the start and end points of intersection of the respective scanning line with the bar code; characterised in that said system further comprises : means for determining whether a first intersection of a scanning line (n-1) with the leading edge (L o ) of the bar code (10) has occurred by comparing the addresses of the start points of intersection of each successive pair of adjacent scanning lines (n-1,n); means for determining whether a first intersection of a scanning line with the trailing edge (R o ) of the bar code (10) has occurred by comparing the addresses of the end points of intersection of each successive pair of adjacent scanning line; calculating means for determining the address difference (d) between the address (R n-1 ) of the data tail of the scanning line (n-1) which coincides with the leading edge (L o ) of said bar code (10), said data tail being defined as the data at the end point of intersection of said scanning line (n-1) with the bar code and the address (R n-1 -d) of the data head of the next adjacent scanning line (n), said data head being defined as the data at the point on said next adjacent scanning line (n) corresponding to the same data as that of the said data tail of scanning line (n-1) ; comparison means for comparing the bar code data segment of said scanning line (n-1) with the bar code data segment located at addresses before the start address (R n-1 -d) of the data head of said next adjacent scanning line (n); means for connecting said data head of said next adjacent scanning line (n) to said data tail of said scanning line (n-1) if said comparison falls within a predetermined range of similarity, and means for repeating said connecting step until said coincidence of a data tail with the trailing edge (R o ) of the bar code (10) has occurred. A bar code scanning and data-combining system as recited in claim 2, wherein said emitting means (32) includes address generating means for sequentially generating an address for each of the sequence of points comprising each of said plurality of one-dimensional images at a corresponding point in time, so that each of said plurality of scanning lines (12) has a corresponding sequence of addresses. A bar code scanning and data-combining system as recited in claim 2 or 3, wherein said reading means (32) comprises: pre-processing means (36) for determining a first occurence (a) of a fixed edge at said leading edge (L) of said bar code (10) and a second occurrence (a) of a fixed edge at said trailing edge (R) of said bar code (10); logic means (52) for determining a third occurence (a) of said fixed edge at said leading and trailing edge (L,R) along one of said plurality of scanning lines (12), and receiving means for sequentially reading said plurality of bar code data segments until said first and second occurrences (a) have both occurred, or unless said third occurrence (a) has occurred.

Inventors: OKAMURA HIDEKI OSAKA WORKS OF, OKAMURA, HIDEKI OSAKA WORKS OF SUMITOMO
Applicants: SUMITOMO ELECTRIC INDUSTRIES, SUMITOMO ELECTRIC INDUSTRIES LIMITED
Application year: 1988
Main classification: G06K7
IPC codes: G06K7