Anda di halaman 1dari 24
«y United States Patent Yang et al. {USO06360948B1 US 6,360,948 BL Mar. 26, 2002 (10) Patent No.: (45) Date of Patent: (54) METHOD OF READING ‘TWO-DIMENSIONAL CODE AND STORAGE MEDIUM THEREOF (75) Inventors: Xuhua Yang, Chiryu; Hisashi Shigekusa, Okazaki, both of (JP) (73) Assignee: Denso Corporation, Kariya GP) (®). Notice: Subject to any disclaimer, the term of this patent is extended or adjusted under 35 USC. 154) by 0 days. C21) Appl, Nos 09/447,885 (22) Filed: Nov. 24, 1999 (80) Foreign Application Priority Data Now. 27, 1998 GP) G1) Incl? GO6K 7/10 (2) US. cL 235/462.1; 235/375; 235/385; 285/462.09; 235/462.14; 235/462.19; 295/462.25 (58) Field of Search 235/462.1, 375, 235/385, 461, 462.09, 463.11, 462.12, 460.14, 462.17, 462.19, 462.24, 462.25, 462.31 10337773 (0) References Cited U.S. PATENT DOCUMENTS ‘S07395$ A+ 12/1901 Van Tyne ct a, 2351436 SAD4O3 A= 4/1995. Smith 235/462 SAS7US A > 1/1096 Su “0s id02 Xx Si612 524 A“ WI997 Sant"Anselmo ct alo 235/408 S686,718 A 11/1907 Iwai eta 235408 501527 A 1/1007 Hara etal, 235/456 S726435 A 3/1998 Hara eta 235204, S750.981 A * 5/1008 Roustel a a 235/462 (6098219 A> 7/2000 Ma et. 6.201901 BL * 3/2001 Zhow ot al FOREIGN PATENT DOCUMENTS 235/462.1 382.5065, we ao61ti02 A + 4004 w 7254037 10/1995 S1s02s T1906 S1ssi20 7/1996 we ww20s01 BIL cited by examiner Primary Examiner—Michael G. Lee “Assistant Examiner—Daniel 1 Walsh (7A) Attorney, Agent, o Firm—Pillsbury Winthrop LLP 6 ABSTRACT ‘Armethod of reading information out of a 1wo-dimensional feode macle up of a matrix of cells having 2 given optical pltemn is provided. The two-dimensional code bas location Symbols used to locate the two-dimensional code and aliga- ment symbols used to locate the cells. The method first calculaies a central position of each of tbe alignment sym- bols in an image of the two-dimensional code using a predetermined! positional relation to the location symbols and selects one of reference patterns which matches up with tn optical pattern formed with a pixel lying a the eslculated central position of the alignment symbol and surrounding pixels. The method specifies an actual central position of ‘each of the alignment symbols in the image of the two- ‘dimensional code using the matched reference pattern. This ‘compensates for a locational error between the calculated ‘central position and the actual ceatral position of each of the ‘alignment symbols due to deformation of the image takiog place, for example, when the two-dimensional code is printed on 4 round object. 16 Claims, 12 Drawing Sheets Bay: iy 4 SG [eer yom conel ak op eeu U.S. Patent Mar. 26,2002 Sheet 1 of 12 US 6,360,948 B1 a2 Control KT Fia.1 U.S. Patent Mar. 26,2002 Sheet 2 of 12 US 6,360,948 B1 52 53 80a { s4a 70 (60a / 56 | 548 FIG.2 /548.54B,54C f 55a e 55b— | 55c L FIG.3 U.S. Patent Mar. 26,2002 Sheet 3 of 12 US 6,360,948 B1 (b) (c) ® ULIU 5: 11 3 41 55b (>) “| J LI @— ~ 11 38 a7 ai © ULI vA 113 11 544,54B,54C FIG.3@) FIG, 306) U.S. Patent Mar. 26,2002 Sheet 4 of 12 US 6,360,948 B1 ~SOF y bia Z KZ, 6 1b Cae Z = K FIG. S LPI VV FIG. &(a) riezy 9 JULDIPULAL U.S. Patent Mar. 26,2002 Sheet 5 of 12 US 6,360,948 BL Code v's yew ope ? YES Depermine geomethy Ind position $130 CRIT in ne LZ 8140 \ Detece format. code Lfeece Aerie ot [] Determine central position $150 of ahgnnent symbs) i $160 Determine cent] psaititn and Size of each coll vf algament symbof| | Crememar cere gerermoz7 |S 170 | each date cell Determine [epic valet oF Veo each data cell Lormect 2 YES $200 De pereal She naey Tito t tonmandapraT 1o an Sonnoe 3% $210 U.S. Patent Mar. 26,2002 Sheet 6 of 12 US 6,360,948 B1 /Dererminatlon oF ( ei eset ot \ Dhignmont ee — Determine Lecater_ of aligrm [DeJine brightness Cheek doe Decerminé bright ntss of brightness checle dot [Compare opbeal pattern with reference patterns no]s1620 a Shift caleolared central position of alignment symbol a Determine central position ef central cell FIG.9 US 6,360,948 BL Sheet 7 of 12 Mar, 26, 2002 U.S, Patent FIG. /0 JL FIG. 13(a) FIG. 13 (4) U.S. Patent Mar. 26,2002 Sheet 8 of 12 US 6,360,948 B1 60A~60F ee ee : yi ~6 1 Frnt) FRinb-2) Gre) vp ga, ceo FA Fg (o-4) — Fglo$) Fy. 6-8 ) FIG. l(a . Bae a7 Fig.u (b-2) Paubee) Pu b-4) 1 rr FIG. (2a) FIG. /2(6) -Lpit it _| im teehee: th t oa H reeee SERRE EEE FIG. /2¢) FIG./2(¢) FIG. 222) U.S. Patent Mar. 26,2002 Sheet 9 of 12 US 6,360,948 B1 yo BOA ~60F 61b a HT) P O|®@ L oy Z Ze $ | Li , YA Lads | Bic he — FIG. 140) FIG. i4(b) bib FIG. /4(¢) U.S. Patent Mar. 26,2002 Sheet 10 of 12 US 6,360,948 B1 a2 ai . - FIG. U.S. Patent Mar. 26,2002 Sheet 11 of 12 US 6,360,948 B1 MNT) FIG.16c@) PRIOR ART a De) ea FIG./(s) PRIOR ART reall —, FIG./7 PRIOR ART U.S. Patent Mar. 26,2002 Sheet 12 of 12 US 6,360,948 B1 a fr 3100 Se FIG./® (6) PRIOR ART US 6,360,948 BI 1 METHOD OF READING ‘TWO-DIMENSIONAL CODE AND STORAGE MEDIUM THEREOF BACKGROUND OF THE INVENTION 1, Technical Field of the Invention ‘The present invention relates generally to a method of reading information optically out of a two-dimensional code ‘made up of a matrix of data cells ina decreased time and & storage medium storing a program used to implement such method, 2. Background Art US. Pat. No. 5,726,435 filed Mar. 10, 1998, assigned 10 the same assignee as that of this application teaches & two-dimensional code used ia inputting coded information into a computer, for example, ‘Typical two-dimensional codes have a wwo-dimensional spread, as shown in FIG. 16(b), which can carry a large amount of information in a narrow area as compared with & bar code, as shown in FIG. 16(a), but the structure thereof is complex, FIG. 17 shows one example of two-dimensional codes. ‘The two-dimensional code 300 includes three location sym~ bols 3102, 3106, and 310¢ and arrays of timing cells 3202 °° sand 320b. The location symbols 3100 to 310 are used in locating the two-dimensional code 300 and each consist geometrically of «plurality of squares different in size. The frrays of timing cells 3202 and 320b are each disposed between adjacent two of the location symbols 3104 to 310 and consist of a plurality of white and black cells arranged in a reference pattern that are used as indices of data cells arranged in a data field 330. The two-dimensional code 300 is made up of a square matrix of oxn cells. Each of the location symbols 310 to 310¢ consists of a square frame 312 formed with four sides ‘each consisting of 7 cel, a while square frame 314 formed ‘with four sides each consisting ofS cells, and a black square 316 consisting of 3x3 cells formed on the central portion of | the white square frame 314, ‘When each of the location symbols 3102 10 310 is scanned through an optical reader along any line passing through the center thereol, an optical signal pattern which has a brightness” component ratio of, black:white-blackwhite-black=I:1:3:1:1 is detected. Thus, ‘when an optical sigoal pattern having that brightness com: ponent ratio is detected during scanning of the 0wo- ‘mensional code 300, it may be determined as a candidate paltern for any one of the location symbols 310¢ to 310, Specifically, when three optical sigaal patterns each having 4 brighiness component ratio of 1:l:3:1:1 are detected, it ‘may be determined that the two-dimensional code 300 lies (on a square area defined by the three optical signal patterns, The data filed 330 consists of data cells (not shown forthe brevity of illustation) each formed with a black or white square indicating logical 0 or 1 of a binary-coded di ‘Two-dimensional coordinates of each data cell se geome! cally calculated in a known algorithm by using the centers of the location symbols 310¢ to 310e aad the timing cells 3204 and 320 as indices of the coordinates. ‘When the two-dimensional code 300 is scanned optically from a slant direction undesirably or when the two- dimensional code 300 printed on a curved surface of an object is scanned optically, it will cause a deformed image of the two-dimensional code 300, as shown in FIG. 18(a), to be captured. Additionally, when the two-dimensional code 0 6 2 300 is printed on the surface of a round bottle, for example, it will cause, as shown in FIG, 18(6), both sides of the two-dimensional code 300 to be deformed greatly. ‘The deformation of the image of the two-dimensional code 300 ‘will result in shift between the actual center and the center ‘of each dala cell geometrically calculated in the above manner. Ifthe shift is greater than half a size of each data call, it produces an error in reading the two-dimensional ‘code 300, The degree of the deformation producing such an fertor increases a8 the size of the two-dimensional code 300 's increased for carrying more information, In order to avoid the above problem, Japanese Patent Fiest Publication No, 10-208001 assigned to the same assignee as that of this application teaches a method of reading infor: mation out of a two-dimensional code correctly even if a ige of the two-dimensional code is deformed. jensional code has location symbols used in locating a data field and alignment symbols (also called auxiliary symbols) each arranged in a predetermined posi tional relation tothe location symbols. The position of each data cel in the data field in the image of the two-dimensional ‘code is specified by determining the central positions, shapes, and arrangement of the location symbols and the alignment symbols. The central position of each of the ‘alignment symbols is determined by mathematically esti= mating a central position based on the shape of cells of the location symbols and the central positions of the location symbols and scanning an image of the alignment symbot near the estimated central position to find an actual center of the aligament symbol. One example of such a method of determining the actual center of exch aligament symbol is also taught in Japanese Patent First Publication No. 8-185429, however it has the drawback in that many pixels should be scanned, thus taking 2 large amount of time to locate each alignment symbol, which will result in an increase in time required for reading information out of the ‘wo-dimensional code, SUMMARY OF THE INVENTION is therefore a principal object of the present invention to avoid the disadvantages of the prior at Is another object of the present invention to provide a method of reading information out of a two-dimensional code in 8 decreased time. ‘According to one aspect of the invention, there is pro= vided a method of reading information out of a 1Wo- dimensional cedle made up of a matrix of eells having & _given optical pattern. The two-dimensional code has atleast ‘one location symbol used to locate the two-dimensional ‘code and at least one alignment symbol used to locate the cells. The method comprises steps of: (a) capturing an image ‘round the two-dimensional code in a bit mapped pattern; (©) detecting a position ofthe location symbol to determine 4 position of the two-dimensional code in the captured image; (C) calculating a central position of the alignment symbol in the eaptured image mathematically using a pre= determined positional elation of the aligament symbol 10 the location symbol; (d)selecting.a dot in the captured image lying at the calculated central position of the aligament symbol asa reference brightness check dot and dots lying in some of the cells around one of the cells of the captured image in which the reference brightness cheek dot exis as surrounding brightness check dots to define an aligament symbol optical pattern with a combination of the reference brightness check dot and the surrounding brightness check dots; (€) comparing the alignment symbol optical pattern US 6,360,948 BI 3 with 2 plurality of reference optical paterns each formed with one of possible combinations of one ofthe cells lying, atan actual cenral position of the alignment symibol and as ‘many cells arranged adjacent the one of the cells as the Surrounding brighiness check dots to select one of the reference oplical paleras matching up with the aigamment Symbol optical pattern; (f)cogreting the calculated exateal positon othe alignment symbol based on a position of one OF the surrounding brightness check dots inthe captured Jmage corresponding othe one ofthe eels of the matched reference optical pattern at the actual central positon ofthe alignment symbol and a geometry ofthe alignment symbol to determine an actual cental poston of the alignment symbol in the captured image; (g) determining positions of the cells of the two-dimensional cade inthe captured image bused on af least one ofthe position of the location symbol and the actual entel positon of the aligameat symbol inthe captured image: and (b) reading the cells of the Wo- ‘made up of eight cells a,b, ¢, dy 5, by and i In practice, the positional errors ofthe calculated central positions ofthe alignment symbols 60A to 60C are found (0 almost fall Within the above ares. The correction of each of the ealeu- lated central positions ofthe alignment symbols 60A to 60F is, as described later in detail, achieved by selecting one of | refercnce patterns, as shown in FIGS. 1(b-1) to 1-9) Which matches up with an optical paltern formed with a reference brightness check dot delined at the center of one of te alignment symbols 604 to 60F calculated in step 1810 and eight brightness check dots defined at loca rounding the reference brightness check dot at fone cell away from the reference brightness check dot and specifying one of cells of the matched reference pattern corresponding tothe central cell ofthe one of the aligament symbols 60A to 6OF. ‘Steps 1520 to 1620 will he described below in detail In step 152, the brightness of the center of the firs one of the alignment symbols 60A to 60F calculated in step 1S10 is determined. In this embodiment, each cell in the two- climensional image captured by the area sensor 12 is made up ofa matrix of 6x6 pixels, as shown in FIG, 13(6), and the determination of brightness of a portion of the two- «dimensional image is made in units of a pixel. Therefore, if 6 14 4 dark stain is over the center of one of the aligoment symbols 60A to 60F, the brightness ofthe center thereof may fail to be determined. In order to avoid this problem, this ‘embodiment makes a determination of the brightness of the ‘center of each of the alignment symbols 6DA to 6OF based ‘on not only the centeal pixel of an image of a corresponding ‘one ofthe alignment symbols 60A to 60F, but also a plurality of pixels surrounding the contra pixel. For instance, the brightness levels of four surrounding pixels, as represented in “0” in FIG, 12(a), ae also checked in addition to that of 4 pixel, as epresented in “®”, lying atthe calculated center ‘of one of the aligament symbols 60A to 60F. Alternatively, the brightness levels of cight sutrounding pixels, as repre= sented in “CJ” in FIG. 12(6), lying at intervals of one pixel ‘way from the central pixel, as represented in“@", may also be checked. Ifthe number of light pixels of aa image of one ‘of the alignment symbols 6DA to 60B is greater than that of| dark pixels, it may be determined that the center ofthe one of the aljgnment symbols 60A to 60F is light (Le., white) ‘This enables accurate determination ofthe brightness of the center of the alignment symbols 60A to 60B even ia litle dark stain “@", as shown in FIG, 12(a) or 12(b, is on the ‘center of one of the alignment symbols 60A 10 60B. The determination of the brighness of the calculated center of each of the alignment symbols 60A to 60F in the manner as shown in FIG. 12(@) may, however, have the problem in that ia pixel, as represented ino" in FIG. 12(0), atthe calculated center of one of the alignment symbols 60A, {o 6OF lies next to a collection of pixels, 2s represented in hatched lines, whose brightness is different from that of the central pixel, the determination of whether the number of light pixels is ereater than that of dark pixels or not or view versa depends only upon the brightness of the central pixel o Ihis, therefore, advisable that the brightness levels of | surrounding pixels, esshown in FIGS, 12(@ and 12(e), lying intervals of at least one pixcl away from the central pixel "" may also be checked, In the case shown in FIG. 12(¢), the brightness levels of 12 surrounding pixels are also ‘checked. The number of light surrounding pixels, as repre sented in “Cy” is seven (7). Thus, if the central pixel “2” is light, the aumber of light pixels Will be eight (8) as a whole “Alternatively if the central pixel “>” is dark, the number of | light pixels will be seven (7) a8 a whole. In either case, it may be determined correctly that the pixel of each of the alignment symbols 60A to 60F lying st the central position calculated in step 1510 is light "The above manner may also be used in step 180 of FIG, 7 determine whether each data cell of the woe dimensional code 82 is light of dark for obtaining the optical information carried by the two-dimensional code 52. Returning bick to FIG. 9, alter step 1520, the routine proceeds o step 1530 where its determined whether light ‘and dark pixels ate mixed or notin a given area (¢.8. 555 pixels, as shown in FIGS. 12(6), 12(@), and 12(@)) of an image of one of the alignment symbols 6DA to 6OF around the central position calculated in step 1810. Specifically if 4 mix of light and dark pixels has been found in step 1200 around the calculated center of one ofthe alignment symbols ‘60, to GF in determining the brightness of the center of the fone of the alignment symbols 60A to 60F based on the hnumber of light nd dark pixels, a YES answer is obtained, ‘and the routine proceeds to step 1600, Alteenatively, ifthe mix of light and dark pixels has not been Found! instep 1520, 4 NO answer is obtained, and the routine proveeds to step 140, ‘The determination in step 1520 is, as ean be seen from the sbove, used in step 1830 only for determining whether light US 6,360,948 BI 15 aun dark pixels are mixed around the ealeulated center of one of the alignment symbols 60A to 60. Therefore, step 1520 is not always required to determine the brightness of the calculated center of each of the alignment symbols 60A to 60F accurately, but may produce data only cequized ia sep 1530, “The subprogram in FIG. 9 is, as described above, executed foreach of the alignment symbols 0A to 608. The following discussion will refer ony tothe alignment symbol {0A forthe simplicity of disclosure Ia NO answer is ctaind in step 1530, ten the routine proceeds 19 step 1840 wherein pixel of an image of the Alignment symbol 604 Tying atthe central postion thereat Calculated in step 1510 is defined as the reference brightness check dot, as described above, and eight pixels which are located a intervals equivalent to one cel (.e.6 pixel inthis embodiment) away from the reference brighiness check dot face selected as the brightness chock dots. For instance, ifthe calculated central pixel is represented in black circle in FIGS. 13(a) and 13(, eight pixels, s represented in white cles, located six pixels away from the calculated centcal pixel are selected as the brighiness check dots The bright- ness check dots coincide wih the centers of eight cells surrounding the reference brightness check dot respectively. ‘The routine proceeds to step 1850 wherein the brightness. 25 of each of the brighiness check dots selected in sep 1540 is determined in the sime manner as described above wherein the brightness of one pixel is determined based on the raumber of light or dark pixels within an asea extending over given number of pixels surrounding the one pixel. The routine proceeds to step 1360 wherein an optical pattern formed with a total of nine pixels: the colerence brightness check dot plus the eight brightness check dots is compared with nine reference patterns, as shown in FIG. AGI) to 110-9), ‘The routine proceeds to step 1870 wherein it is deter- ‘mined whether the optical pattern matches up with any ofthe reference paltesns or not. If the optical pattern is the one shown in FIG. 13(a), it matches up with the reference pattern shown in FIG, (3). Ia YES answer is obtained in step 1870, then the routine proceeds to step 1580 wherein which cell of the matched reference pattern corresponds fo the actual central cell © of | the image of the alignment symbol 60A, as shown in FIG 11(a), is found to determine which of the eight brightness check pixels forming the optical pattern defined in step 1560 lies within the actual central celle, thereby finding which cell of the image of the alignment symbol 60A isthe actual central cel Each reference pattern is, as clearly shown in FIGS. 11(6-1) to 1-9), formed with one of all possible combi nations of 33 cells containing the cental celle of the image of each ofthe alignment symbols 60. to 60F. For instance, the reference pattern in FIG. 11(b-1) is formed with 33 cells Iying at upper teft portion of the alignment symbol shown in FIG. 11(a). Thus, if there is a matched reference pattern, itis found that the optical pattern defined in step 1560 corresponds to which part of the alignment symbol (604, that is, that which cel of the matched reference pattern corresponds to the central cell ¢ of the aligament symbol 0A. For instance, the reference pattern ia FIG. 11(6-1) is selected as matching the optical pattem defined in this program cycle, it is determined that a cell lying at a lower Fight comer of the reference patter corresponds to the central cell © of the alignment symbol 60A, that is, that & lower right one of the brightness check dos lies within the central cel eof the alignment symbol 60A, thereby finding 0 6 s 16 which cell of the image of the aligament symbol 60A is the actual central cell ¢ ofthe alignment symbol 60A. Subsequently, the routine proceeds to step 1890 wherein the central position of one of cells of the image of the alignment symbol 60A found ia step 1580 to be the actual ‘central cell ofthe alignment symbol 60A is determined by measuring a horizontal width a and a vertical width b, a8 shown in FIG. 14(6), of the cell found tobe the actual central cell ¢ of the alignment symbol 60A to determine central positions of the horizontal width a and the vertical width b as x and y coordinates of the central position of the cell found to be the central celle of the alignment symbol 6A, ‘or measuring a horizontal width A and a vertical width B of the white squire frame 615 of the aligament symbol 60A formed with eight white cells surrounding the central cell, Sle in the image of the alignment symbol 60A to determine ‘central positions of the horizontal width A and the vertical ‘width B as the x and y coordinates of the central position of| ‘the ell found to be the central cell eof the alignment symbol 604, For use of the horizontal and vertical widths A and B of the square frame 61b, if it i Foune! in step 1880 that one of | the eight brightness check dots, as indicated by Pin FIG. 14a, ies within the actual central cell of the aligament symbol 60A, the number of pixels is counted from the brightness check dot P to each of four sides of the square frame 61b where changes in brightness from light to dark pixels are taken place to determine, as shown in FIG, 14(0), ‘distance AL from the brighiness check dot Pto the left side ‘of the square frame 61b, & distance A2 from the brigbiness check dot P to the right side of the square frame 610, 3 distance BI from the brightness check dot Pto the upperside ff the square frame 61D, and a distance B2 from the brightness check dot Po the lower side of the square frame 615, thereby determining the horizontal and vertical widths ‘Aaand B of the square frame 616 of the alignment symbol ‘60, inthe deformed image of the two-dimensional code $2 ‘and positions ofthe four sides ofthe square frame 61b. Note that ALSA2~A, and BL+E2~B. Next, the horizontal and vertical widths A and B are each divided by two (2) to determine distances from adjaceat ovo of the sides of the square frame 615 (eg. the upper and right sides of the square frame 616) to the venter ofthe square frame 61D (ic. the center of the alignment symbol 6OA in the image of the two-dimensional code 82). Fipaly, the position ofthe center fof the square frame 61b is calculated based on the deer- mined distances and the positions of the four sides of the square frame 615, ‘Returning back to FIG. 9, if « YES answer is obtained in step 1830 meaning that dark and light pixels are mixed ‘round the central position calculated in step 1810, then the routine proceeds to step 1600 wherein a parameter 0 is incremented by one (1). The parameter n is initialized to 2er0 (©) upon start of the main program in FIG. 7. ‘The routine proceeds to step 1610 wherein it is deter- mined whether the parameter n is greater than eight (8) oF not. If a NO answer is obtained (a8), then the routine proceeds to slep 1620 wherein the central position of the image ofthe aligament symbol 60A calculated ia step 1810 is shifted by half a cell (e.,% cell) in a given direction, The routine then returns back to step 1830 theough step 1520 10 determine whether light and dark pixels are mixed of not around the shified central position ofthe alignment symbot {60A. These operations are repeated until there is no mix of | light and dark pixels around the shifted central position of the alignment symbol 60A. A maximum number of shifts of the calculated central position ofthe alignment symbol 60, US 6,360,948 BI 17 is eight (8). This is because an optical pattern formed with pixel lying a the shifted central position and surrounding pixels usually match with any oF the reference patterns as shown in FIGS. 11(b-1) to 11(b-9) before the number of Shifts of the calculated central position reaches eight (8). “The direction in which the ealeulated central position of the alignment symbol 60A is shified may be any one of (1) 4 direction toward a place where the aumber of light pixels around the calculated central position is greater than that of | dark pixels o vice versa and (2) a direction toward a collection of light pixels in the given area around the calculated central position which forms part of the white square frame 61 of the alignment symbol 60A because each Of the reference patterns in FIGS. 11(6-1) to 11(-9) contains some of cells of the square frame 614, and the possibilty that ae optical pattern formed with a pixel lying atthe shifted central position and surrounding pixels matebes with any of | the reference patterns becomes high. For example, if the central position of the alignment symbol 60 calculated in step ISI0 lies, as indicated by « in FIG, 18, adjaceot the boundary of an array of light pixels and an array of dark pixels, then step 1830 determines that there is a mix of light, and dark pixels around the central position c. In this case, shifting the central position «in either ofthe above direc= tions (1) and (2) will cause the central position @ to be 25 moved toward a collection of light pixels and reach a pixel, as indicated by fi. Therefore, there will be no mix of light dnd dark pixels within an optical pattern formed with a matrix of, for example, 5x3 pixels around the pixel 6 thereby resulting in a NO answer in step 1530, ‘Alternatively, if the central position of the alignment symbol 60A calculated in step 1510 les, as indicated by ctl in FIG. 18, at an upper right corner of the square frame 61 and is shifted by half a cell (ce, three pixels) to a pixel, as indicated by @2, in the left direction like the above, the central position c2 sill exists in a mix of light and dark pixels. In this ease, the central position a2 of the aligament symbol 60A is, therefore, further shifted in either of the directions (1) and (2), so that it eaches the pixel 1. The central position a may also be first shifted to the pixel « and then t0 the pixel ‘The amount of shift of the ealeulated central position of cach ofthe alignment symbols 60A to 60F is no limited to one-half of a cell and may be a fraction of a cell such as one-third or one-fourth of a eell. The amount of shift by ‘one-half ofa cell i, however, preferable. This is hecause the determination in step 1880 that light and dack pixels exist around the calculated central postion of one of the align- ‘meat symbols 60A to 60F means that the brightness check pixels exist near a boundary of an array of light pixels and fan array of dark pixels, and shifting the calculated central position by one-half a cell (i.e. three pixels in this embodiment) increases the possibilty thatthe shifted central position will exist around! an actual center. ‘The amount of shift of the calculated position of each of the alignment symbols 6A to 60F may also be determined regardless of the size of a cell. Each of the alignment symbols 60A to 60 is aot limited to abit mapped pattern as shown in FIG. S. For example, the square frames 61a and 61 and the centeal square 6c each ‘may have the width greater than or equal to two cells, Each of the alignment symbols 60A to 60F may be of any shape other than square as a whole, Each cell of the two-dimensional code $2 may alterna tively be reversed in brightness. ‘While in the above embodiments, each of the location symbols S44 to S4C is formed with double black squares to 6 s 18 show an optical pattern, whose frequency component ratio of darkslightdarklightidarke1:1:3:1:1, captured along a scanning line passing through the center thereof, it may have a geometrical pattern defined by similar figures arranged ‘couxially such as circles or hexagons, Additionally, a geo- metrical pattera defined by more than two similar figures faranged coaxially may be used if it exhibits the same frequency component ratio in every direction Further, an external form of the two-dimensional code $2 may be rectangular. Each of the location symbols S4A 10 ‘SAC is arranged at one of corners of the 1to-dimensional cove $2, however, it may be provided al any location. Four ‘or more location symbots may also be arranged in any locations in the two-dimensional code $2. Alternatively, 660 location symbols may be printed on the two-dimensional ‘code 52. In this ease, the data fel 56 may be located by ‘arranging the location symbols ether at Wo oppesed corners ‘or at two adjacent corners of the two-dimensional code $2 ‘and detecting positions of the alignment symbols 60A to {60F. Further, a single location symbol may be printed at aay location in the two-timensional code 52. In this ease, the location of cach data cell may be specified by using a positional relation between the location symbol and the alignment symbols 60A to 60F. ‘While the present invention has been disclosed in terms of the preferred embodiments in order o facilitate better under- standing thereof, it should be appreciated thatthe invention can be embodied in various ways without departing from the principle of the invention. Therefore, the inveation should bbe undersicod to include all possible embodiments and modifications 10 the shown embodiments which can be ‘embodied without departing from the principle of the inven- tion as set forth in the appended claims. ‘What is claimed iss 1A method of reading information out of two dimensional code made up of a matrix of cells having a ‘given optical pattern the two-dimensional code having at least one location symbol used 1o locate the two-dimensional ‘code and at least one alignment symbol used to locate the cells, comprising the steps of: capturing an image around the two-dimensional code in a bit mapped pattern; detecting a position ofthe location symbol to determine & position of the two-dimensional code in the captured image: calculating a central position of the aligament symbol in the captured image mathematically using. predeter- ‘mined positional relation of the aligament symbol to the location symbol; selecting a dot in the eaptured image lying at the calcu Tated central position of the alignment symbol as refeconce brighiness check dot and dots lying in some of the cells around one of the cells of the captured image in hich the reference brightness check dot ‘exists as surrounding brightness check dots to define an alignment symbol optical pattern with a combination of the relerence brightness check dot and the surrounding brightness check dots; comparing the aligament symbol optical pattern with plurality of eference optical patteras each formed with ‘one of possible combinations of one of the cells lying at an actual central position of the alignment symbol and as many cells arranged adjacent the one ofthe ells, as the surrounding brightness check dots to select one of the reference optical patteras matching up with the alignment symbol optical pattern; US 6,360,948 BI 19 correcting the calculated central postion ofthe alignment ‘symbol based on a position of one of the surrounding, brightness check dots in the captured image corre sponding tothe one ofthe cells. ofthe selected matching, up reference optical pattern at the actual central posi tion of the alignment symbol and a geometry of the alignment symbol to determine an actual central posi- tion of the alignment symbol in the captured image; determining positions of the cells ofthe two-dimensional ‘code in the captured image based on atleast one of the position of the location symbol and the actual centeal position ofthe alignment symbol ia the eaptured image; and reading the cells of the two-dimensional code in the ‘captured image optically to decode the information carried by the two-dimensional code 2. Amethod as set forth in claim 1, wherein the aligament symbol has one of: a pattern formed with a central dark cell, fan intermediate squate frame which surrounds the centeal dark cell, consists of an array of light pixels, and has a width equivalent to one cell, and an outer square frame which surrounds the intermediate square frame, consists ofan array of dark cells, and has a width equivalent to one cell; and a pattern formed with a central light cell, an intermediate square frame which surrounds the central dark cell, consists 25 fan array of dark pixels and has a width equivalent to one cell, and an outer square frame which surrounds the inter- ‘mediate square feame, consisis of an array of light cells and has a Width equivaleat to one cell, and wherein each of said reference optical patterns consists of a matrix of 3x3 cells, ‘and nine of said reference optical patterns 3. A method as set forth in claim 2, wherein each of the ceils of the two-dimensional code is represented in the captured image by a matrix of a plurality of pixels, wherein teach ofthe reference brightness check dot and the surround= ing brightness check dots is represented by ome pixel, and ‘wherein the alignment symbol optical pattem is formed with 4 combination of brightness levels of pixels representing the reference brightness cheek dot and the surrounding bright- ness check dots, and wherein the brightness level of each of | the pixels is deteemined by considering brightness levels of| surrounding pixels 4. A method as set forth in claim 3, wherein each of the pixels representing the captured image of the two- dimensional code is one of light and dark pixels, and ‘wherein the brightness level of each ofthe pixels represent- ing the selerence brighiness check dot and the surrounding brightness check dots is determined based on which of the number of light pixels and the mumber of dark pixels is ‘greater in an area suerounding the each of the pixels, ‘5. Amethod as set forth in claim 4, further comprising the step of determining whether light and dark pixels are mixed in a given area around the reference brighiness check dot or not, and wherein if it is determined that the light and dark pixels are mixed in the given area, the reference brightness check dot is shifted by a given distance in a given direction determined based on a geometry and a brightness pattern of | said alignment symbol to a place of the captured image of | the tWo-dimensional code where there i no mix of light and dark pixels, after which the brightness level of each of the pixels representing the reference brightness check dot and the surrounding brightness check dois is determined. ‘6. A method as set forth in claim 8, wherein the given direction in which the reference brightness check dot is shifted is a dirvetion where the aumber of either of light pixels and dark pixels in the given area around the shifted reference brightness check dot is expected to increase. Py 6 s 20 7. A method as set forth in claim 8, wherein the given direction in which the reference brightness check dot is shifled is a direction toward one of a collection of light pixels and a collection of dark pixels in a given area around the reference brightness check dot which forms a portion of| the intermediate square frame of the Wwo-dimensional cod. ‘8. A method as set forth in claim 5, wherein the given distance by which the reference brightness check dot is shifted is equivalent to a given number of pixels that is identical with a given frection of one cel, 9, A method 3 sot forth in claim 5, wherein the given distance by which the reference brightness check dot is shifled is equivalent to a given umber of pixels that identical with half a cell, 10. A method as set forth in claim §, wherein the given distance by which the reference brightness check dot is shifted is equivalent to a given number of pixels regardless (of a size of the cells LL. A method of reading information out of 4 two- dimensional code which is male up of & mateix of cells having a given optical pattem and which has location ‘symbols used to locate the two-dimensional code and align- ment symbols used to locate the cells, a first one of the alignment symbols being. provided at’ position on the two-dimensional code which is specified in a given posi tional relation tothe location symbols, comprising the steps of, ‘capturing an image around the two-dimensional code in & Dit mapped pattern; detecting postions ofthe location symbols to determine a position of the two-dimensional code in the captured images calculating a central position ofthe first alignment symbol in the captured image mathematically using the given positional relation to the location symbols; calculating central position of « second one of the alignment symbols in the captured image mathemati- cally using 4 positional relation to the first ligament symbol und the location symbols; selecting a dot in the eaptured image lying at the calcu lated central position of each of the alignment symbols asa reference brightness check dot and dots ly some of the cells of the eaptured image located around ‘one ofthe cells in which the reference brightness check dot exists as surrounding brightness check dots to define an alignment symbol optical pattern with a ‘combination of the reference brightness check dot and the surrounding brightness check dots; ‘comparing said alignment symbol optical pattera of each ‘of the alignment symbols with a plurality of reference ‘optical patterns each formed with one of possible combinations of one of the cells lying at an actual ‘central position of each of the aligament symbols and 4s many cells arranged adjacent the one ofthe cells as the surrounding brightness chock dots to select one of the reference optical patterns matching up with a cor- responding one of the alignment symbol optical pat= terns; determining a contral position of each of the aligament ‘symbols in the captured image based oa a position of fone of the surrounding brightness check dots corte sponding tothe one ofthe cells ofthe selected matching, up reference optical pattera at the actual central posi= tion of a corresponding one of the alignment symbols and a geometry of the corresponding one of the align- ment symbols; US 6,360,948 BI 21 determining a position of each of the cells of the twor dimensional code in the captured image based on the position of one of the location symbols or the actual central position of one of the alignment symbols located near a corresponding one of the cells in the ‘captured images and reading the cells of the two-dimensional code in the ‘captured image optically to decode the information carried by the two-dimensional code 12, Amethod 4s set fort in claim 11, furber comprising, the step of calculating « central postion ofa thied one of the alignment symbols in the captured image mathematically Using a positional relation to the fist andl second aligament symbols 13. A method as set forth in claim LL, wherein the two-dimensional code also bas a format code which is located io & given positional relation 10 one of the location symbols and which carries information about an arrange~ ‘ment ofthe alignment symbols in the two-dimensional coe, and! further comprising the steps of, alter the positon of the two-dimensional code is determined, detecting the format code based on the positions of the detected location symbols 22 ‘and reading the information out of the format code about the faraagement of the ligament symbols, and wherein the central positions of the alignment symbols are calculated based on the information read out of the format code. 5 14. A method as set forth in claim 13, wherein the format ‘code also carries information about the number of the cells in the two-dimensional code, and further comprising. the steps of, aller the position of the two-dimensional code is determined, detecting the format code based on the positions ‘of the deecied location symbols and reading the information fut ofthe format cece about the umber of the cells in the ‘two-dimensional code, and wherein the positions of the eells fare determined based about the read information on the number of the cols, 15 15. A storage medium storing a computer-implemented program for reading information out of a two-dimensional fede in 8 method as set forth in claim 11 16, A storage mediuin storing a computersimplemented program for reading information out of = two-dimensional 20 code in a method as set forth in claim 1 0

Anda mungkin juga menyukai