Bar code scan stitching

Abstract: A method for combining decoded scan fragments of a bar code symbol composed of a delimited plurality of bar code elements representing an ordered sequence of data characters. The method includes scanning the symbol along a first scan path that includes a delimiter to obtain a first sequence of data characters; scanning the symbol along a second scan path that includes another delimited to obtain a second sequence of data characters; comparing the predetermined length of the lengths of the first and second sequences of data characters; and based on the comparison combining the first and second sequences to produce the ordered sequence of data characters. In a further version of the method, the first and second sequences are loaded into a stitching buffer, and a corresponding reliability or redundancy buffer is also maintained where information on the expected reliability of the individual decoded characters can be stored. The bar code symbol is considered properly decoded only if the information stored in the reliability buffer passes a series of tests.

Description: Background of the Invention This invention relates to bar code scanning, and in particular to techniques for combining, or stitching, partial scans. A bar code symbol is a coded pattern of indicia comprising a series of bars and spaces having different light reflecting characteristics. Bar code scanning systems electro-optically transform the indicia into electrical signals, which are decoded into alphanumerical characters. Characters are typically represented in digital form and are provided as an input to a data processing system far applications, such as point-of-sale processing and inventory control. Scanning systems of this general type have been disclosed, for example, in U.S. Patent Nos. 4,251,798; 4,369,361; 4,387,297; 4,409,470; 4,760,248; and 4,896,026, all of which have been assigned to the same assignee as the instant application. Bar code symbols are formed from a series of bars and spaces, called elements, which have a variety of possible widths. The specific arrangement of elements defines the character represented according to a set of rules and definitions. To encode a desired sequence of characters, groups of elements are concatenated to form a bar code symbol, with each character of the message represented by a corresponding group of elements. In same symbologies a "start" and "stop" character is used to indicate where the bar code begins and ends. There are a number of symbologies in use, for example, UPC/EAN, Code 39, Code 128, Codabar, and Interleaved 2 of 5. In typical scanning systems, a light source, such as a laser or laser diode, produces a beam which is directed by a lens or similar optical components along a light path toward a target that includes a bar code symbol on the surface. The beam produces a spot on the target. To scan with a laser system, the spot may be deflected by a mirror that is moved with an oscillating or rotating motor to produce a line or series of lines or curved paths across the symbol. Alternately, the light may be deflected by holographic or other means. A portion of the light that is reflected off the symbol is detected by a sensor which may be positioned in the scanner. The sensor converts the reflected light into an electrical signal which is converted to a digital representation by electronic circuitry. For example, an analog electrical signal from the photodetector may be converted into a pulse width modulated digital signal, with pulse widths corresponding to the physical widths of the bars and spaces. The decoder receives the pulse width modulated digital signal from the scanner, and attempts to decode the scan. If the start and stop characters and all of the characters between them are decoded successfully, the decoding process is finished. Otherwise, the decoder receives a next scan and attempts to decode it. Each attempt is based on the signal received during a single scan. The process continues until a scan is completely decoded or until no more scans are available. A scan line or series of scan lines may not always entirely cross the bar code symbol. For example, a scanner may be in a fixed position next to a conveyor with containers, each of which has a bar code symbol printed on a label. If the label is skewed with respect to the scan line, there may be no single scan line which includes both the start and stop characters. These incomplete scan lines, called fragments, were discarded until techniques were developed to stitch or combine the fragments together, so that the decoding process can be completed. Several basic techniques have been employed to combined fragments. One technique, known as block decoding, involves combining predefined regions or blocks in a number of scans. For example, a symbology such as UPC has start, stop, and center characters. If one fragment includes a start and a center, and another fragment includes a center and stop, these two "blocks" can be combined to form a complete scan. In another method, a system checks fragments for corresponding portions, and stitches by superimposing. For example, the widths of elements can be measured in clock pulses for two fragments. These widths may be converted to a binary representation of widths or of ratios of widths between successive elements. The pulse count or other representation of the width of an element in one scan is compared to the width of an element in another scan. If these are the same or sufficiently similar, adjacent elements are compared. If a group of elements of a certain length are the same, the two groups of elements are considered to be corresponding, and the two fragments of decoded data characters are stitched by superimposing the common portions. In yet another method, for example shown in U.S. Patent No. 4,488,678, using bar codes of a known number of bars, bar codes are combined at the bar level, that is, at the pre-decoded level, for subsequent decoding. US-A-5 241 164 discloses a method for decoding bar code symbols in which a bar code reader and associated components scan a bar code symbol produce a representation of the symbol, and attempt to decode that representation in order to produce a character message. The method consists of the steps of storing a first representation of the bar code symbol corresponding to a first scan path through a first portion of said symbol smaller than the entire symbol, and storing a second representation of the bar code symbol corresponding to a second scan path through the symbol. The method then processes these representations in the event a successful decode has not taken place by utilizing the signal from a first scan with the signal from a subsequent scan to determine whether the information from successive scans can be concatenated to form a combined signal. The process is repeated with different subsequent scans until successful decoding of the combined signal. Specifically, timing information associated with the flying beam spot as it scans the bar code symbol in successive scan paths is used to determine where the scans will be stitched together. In general the invention features combining two decoded scan fragments of a bar code symbol using a character level technique. The bar code symbol is composed of bar code elements which represent an ordered sequence of data characters delimited by a "start" character on one end and a "stop" character on the other. The bar code is scanned and the fragments are decoded until a fragment with the "start" character and another with the "stop" character are found. Then, the two fragments are combined to form the required ordered sequence of data characters. In some preferred embodiments, the ordered sequence is of a predetermined character length. The character length of the fragments is compared to the predetermined character length, and the fragments are combined if the sum of the lengths of the fragments is equal to the predetermined length. If the sum of the fragment lengths is greater than the predetermined length, then the overlapping portions of the segments are compared, and, if the corresponding data characters of the overlapping portions match, then the fragments are combined by overlapping the matching portions to form the required ordered sequence of data characters. If the sum of the fragment lengths is less than the predetermined length, or if the overlapping portions do not match, then new sequences of characters are scanned and the process is repeated. In another aspect, when overlapping data characters do not match, the data characters from the segment which was scanned the most times (or most recently) are used. In yet another aspect, the predetermined character length is obtained by decoding scans containing full crossings (including the "start" and "stop" characters) of a representative bar code of the predetermined character length, and then storing and saving that character length tor subsequent use. According to the present invention, there is provided a method for combining decoded scan fragments of a bar code symbol composed of a plurality of bar code elements representing an ordered sequence of characters as set forth in claim 1. Preferred embodiments of the present invention may be gathered from the dependent claims. Other features and advantages will become apparent from the following description of the preferred embodiments and from the claims. Brief Description of the Drawings FIG. 1 is a block diagram of a scanning system; FIGS. 2 and 4 are pictorial representations of bar codes and scan fragments; FIG. 3 is a pictorial representation of a portion of a bar code symbol; FIG. 5 is a representation of the data represented by the bar code of FIG. 4; FIGS. 6-8 are flow charts of preferred embodiments. Description of the Preferred Embodiments Referring to FIG. 1, scanning system 10 is used to read and interpret bar code symbols. Light source 12 directs a beam of light 14 at bar code 18 which is printed or affixed on target 16. Bar code symbol 18 reflects diffused light 20 which is received by sensor 22. The sensor produces an analog signal which indicates how much light is received from the reflected beam as the beam scans the bar code. The analog signal is digitized by digitizer 24, and the resulting digital signal is sent to a decoder 26. The digital signal consists of a series of pulse width values, each representative of the time it took for the scan to cross an element. The time is determined by clock 25 which counts cycles beginning on a leading or falling edge of the digital signal. A representation of the time that each element is scanned is stored so that a set of discrete integers represents the pulse widths of elements in the time domain. Decoder 26 converts the digital signal to a series of alphanumeric characters according to algorithms specific to the symbology used. In some cases, the bar code cannot be completely read with a single scan line. Referring to FIG. 2, bar code symbol 38 is printed on label 36. The symbol includes data characters, a start character 42, and a stop character 44. Scan lines 40 are horizontal, but the label is skewed so that no single scan line passes through both start character 42 and stop character 44. Scan lines 40 are therefore all fragments. While no scan has all the elements, each element can be determined from at least one scan line. The sequence of data characters represented in FIG. 5 (the characters "*" on either end of the sequence are the start and stop delimiter characters) can be represented, for example, by bar code symbol 56 shown in FIG. 4(a). (Alternatively, a correct decoding of the bar code symbol in FIG. 4(a) should produce the sequence of data characters represented in FIG. 5.) The examples in FIGS. 4(a)-(c) show three possible outcomes of two partial scans 62 and 64. The two partial scan fragments 62a and 64a in FIG. 4(a) together cross every element of bar code 56. These two scan fragments also partially overlap for some bar code elements (and for some data characters). Scan fragment 62a covers data characters "3933848", and scan fragment 64a covers data characters "848925". These partial scans overlap on data characters "848". It should be noted that while scan 62a covers some elements of the data character "9" at its right-most end, it does not cover enough elements to decode that character. Similarly, while scan 64a covers some elements of the data character "3" at its left-most end, it too does not cover enough elements to decode that character. The two partial scan fragments 62b and 64b in FIG. 4(b) also cross every element of bar code 56, and they also overlap for some elements, but they do not overlap for any data characters. Scan fragment 62b covers data characters "39338", and scan fragment 64b covers data characters "48925". In FIG. 4(c) the two partial scans 62c and 64c do not cover the entire symbol 56 and do not overlap. Scan fragment 62c covers only data characters "39338", and scan fragment 64c covers only data characters "8925". Neither scan covers the data character "4". In one embodiment, referring to FIG. 6, a method for combining or stitching two decoded partial scans begins with setting various global variables, such as the required or expected predetermined length, L p , of the expected scan. Note that the length L p is the expected or required number of data characters encoded by the bar code symbol, and not the number of elements in the symbol itself. Thus, for example, the length of symbol 56 in FIG. 4(a) is ten (excluding delimiter characters). After the initializing step 100, the sequence of data characters, S 1 , corresponding to first decoded partial scan, is obtained at 102. The length of the sequence S 1 is compared at 103 to the expected predetermined length, L p , to determine whether or not a complete scan was achieved. If so, then processing is complete at 120, otherwise a second sequence of data characters, S 2 , corresponding to a second decoded partial scan, is obtained at 104. Note that both S 1 and S 2 are sequences of data characters corresponding to decoded partial scans. The lengths of the sequences S 1 and S 2 , designated L S1 and L S2 respectively, are the number of data characters in the sequences. As was the case with the first scan S 1 , the length of the second data character sequence S 2 is compared at 106 to the expected predetermined length, L p , to determine whether or not a complete scan was achieved. If so, then processing is complete at 120, otherwise processing continues to determine whether the two sequences can be combined. The next step 108 compares the combined lengths, L S1 + L S2 , of the two partial sequences S 1 and S 2 , to the expected length, L p . Since at this point neither sequence is a complete scan, one of the three situations depicted in FIGS. 4(a)-(c) has occurred. If the combined lengths are less than the expected length, corresponding to the case shown in FIG. 4(c), then the system attempts to obtain another first scan at 102. If the combined lengths are the same as the expected length, corresponding to the case shown in FIG. 4(b), then the two sequences are combined at 110, for example, by concatenating them, and processing is completed at 120. In the case where the combined lengths exceed the expected length, corresponding to the case shown in FIG. 4(a), the amount of overlap is determined at 112 and the overlapping portions of the sequences are compared at 114. If the overlapping portions match each other, then the two sequences are combined at 116 and processing is completed at 120, otherwise, the process is restarted. Referring to FIG. 3, there is shown, by way of example, the first four characters of a bar code in the code 39 symbology. A code 39 character has nine elements, five bars and four spaces, each of which is either narrow or wide. Of the nine elements, three are wide and six are narrow. A Code 39 symbol starts and stops with an asterisk, and can be scanned and read in either direction. Between each character is an inter-character space 70 which can be set to some selected width (the width of which is not significant). FIG. 7 shows the steps 102 and 104 of obtaining the first and second scans in greater detail. Referring to FIG. 7 in conjunction with FIG. 3, the decoder initializes the time at 122, loads a scan at 124, and determines the elapsed time at 126. It then determines whether a delimiter character is detected at 128. If not, the decoder resets the time and loads further scans, until a delimiter character is detected. For scan 72, in FIG. 3, the asterisk start/stop character is detected, so the decoder attempts to decode the characters at 130 by loading nine elements at a time, and checking whether these elements represent a valid character. The decoder would load the next nine elements after the asterisk, and successfully decode a numeral "1". But when attempting to decode the next nine elements, the decoder would fail, as it would encounter fewer than nine elements. In alternate embodiments, the decoder determines the expected length at the initialization step 100 by obtaining a complete scan of a representative bar code symbol and determining its length. This length is then used as the expected length for subsequent scans. Clock cycles are counted during the scan, so the elapsed time for the scan to reach a particular element is known. The elapsed time between two scans is also known. In another embodiment, as shown in FIG. 8, if the comparison of the overlapping portions at 114 fails to determine a match, then, instead of restarting (as in the embodiment shown in FIG. 6), the system selects the sequence of data characters that was scanned the most times (or most recently) at 122, and combines it with the non-overlapping part of the other sequence. The size in characters of the overlapping portion, L overlap , can be determined, for example, by the formula: L overlap = (L S1 + L S2 ) - L p Thus, if, for example, S 1 is selected at 122 as the sequence scanned the most times, then the data characters in S 1 are combined with the non-overlapping (L S2 - L overlap ) data characters of S 2 . It will further be understood that many other variations and embodiments will occur to the skilled man and that those variations and embodiments, and others which can fairly be said to be within the scope of the present invention are intended to be comprehended by the following claims.

Claims: A method for combining decoded scan fragments or a bar code symbol composed of a plurality of bar code elements representing an ordered sequence of characters, wherein the ordered sequence is delimited by a first delimiting character and a second delimiting character, and wherein the ordered sequence has a predetermined length (L p ), the method comprising the steps of: scanning (102,104,124) the symbol along a plurality of scan paths and decoding the scanned elements to obtain decoded sequences of characters (S 1 ,S 2 ); determining (102,104,128) whether the decoded sequences of characters include one of the first and second delimiting characters; repeating the scanning and determining steps until at least a first decoded sequence (S 1 ) with the first delimiting character and a second decoded sequence (S 2 ) with the second delimiting character are found, said first and second decoded sequences having respective lengths (L S1 ,L S2 ); characterized by comparing (108) the predetermined length to a sum of lengths of the first and second decoded sequences of characters; and based on the comparison combining (110,116) the first and second sequences to produce the ordered sequence of characters. The method of claim 1 wherein the combining step comprises concatenation (110) of the first and second decoded sequences to produce the ordered sequence if the sum of the character lengths of the first and second sequences is equal to the predetermined length. The method of claim 2 wherein the combining step further comprises, in the event that the sum of the lengths of the first and second sequences of characters is greater than the predetermined length, performing the following steps: comparing (114) overlapping portions of the first and second sequences of characters; and based on the comparison of the overlapping portions, in the event that the overlapping portions of the first and second sequences of characters match, combining (116) the first and second sequences of characters to produce the ordered sequence. The method of claim 2 wherein, in the event that the sum of the lengths of the first and second sequences of characters is less than the predetermined length, repeating the steps of scanning, determining, repeating, and comparing the lengths. The method of claim 3 wherein, in the event that the sum of the lengths of the first and second sequences of characters is less than the predetermined length, repeating the steps of scanning, determining, repeating, and comparing the lengths. The method of claims 3 or 5 wherein, in the event that the overlapping portions of the first and second sequences of characters do not match, repeating the steps of scanning, determining, repeating, and comparing the lengths. The method of claims 3 or 5 wherein, in the event that the overlapping portions of the first and second decoded sequences of characters do not match, combining the first and second sequences of characters to produce the ordered sequence by the steps of: (i) selecting a sequence of the first and second sequences of characters corresponding to the scan path that was scanned the most times or to the most recent scan path, and (ii) combining the selected sequence with a sequence obtained by removing the overlapping portion from the sequence of the first and second sequences of characters not selected. The method of claim 1, comprising the steps of: first, determining the fixed length by the steps of: scanning an entire representative bar code symbol along a scan path which includes the first and second delimiting characters to obtain a representative series of elements; decoding the representative series of elements to obtain a representative sequence of characters; and counting the number of characters in the representative sequence of characters to obtain the fixed length.

Inventors: LEE KUANG-YUU, SAENZ NELSON, SPITZ GLENN, LEE, KUANG-YUU, SAENZ, NELSON, SPITZ, GLENN
Applicants: SYMBOL TECHNOLOGIES INC, SYMBOL TECHNOLOGIES, INC.
Application year: 1994
Main classification: G06K7
IPC codes: G06K7