AU2004242416B2 - Printed Data Storage and Retrieval - Google Patents

Printed Data Storage and Retrieval Download PDF

Info

Publication number
AU2004242416B2
AU2004242416B2 AU2004242416A AU2004242416A AU2004242416B2 AU 2004242416 B2 AU2004242416 B2 AU 2004242416B2 AU 2004242416 A AU2004242416 A AU 2004242416A AU 2004242416 A AU2004242416 A AU 2004242416A AU 2004242416 B2 AU2004242416 B2 AU 2004242416B2
Authority
AU
Australia
Prior art keywords
barcode
data
codels
image
alignment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
AU2004242416A
Other versions
AU2004242416A1 (en
Inventor
Stephen Farrar
Peter Alleine Fletcher
Stephen James Hardy
Kieran Gerard Larkin
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to AU2004242416A priority Critical patent/AU2004242416B2/en
Priority to US11/305,897 priority patent/US20060157574A1/en
Publication of AU2004242416A1 publication Critical patent/AU2004242416A1/en
Application granted granted Critical
Publication of AU2004242416B2 publication Critical patent/AU2004242416B2/en
Ceased legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Editing Of Facsimile Originals (AREA)

Description

S&F Ref: 687865 AUSTRALIA PATENTS ACT 1990 COMPLETE SPECIFICATION FOR A STANDARD PATENT Name and Address Canon Kabushiki Kaisha, of 30-2, Shimomaruko 3-chome, of Applicant : Ohta-ku, Tokyo, 146, Japan Actual Inventor(s): Stephen Farrar Stephen James Hardy Peter Alleine Fletcher Kieran Gerard Larkin Address for Service: Spruson & Ferguson St Martins Tower Level 35 31 Market Street Sydney NSW 2000 (CCN 3710000177) Invention Title: Printed Data Storage and Retrieval The following statement is a full description of this invention, including the best method of performing it known to me/us:- - 1 PRINTED DATA STORAGE AND RETRIEVAL Field of the Invention The present invention relates generally to barcodes and, in particular, to barcodes resistant to global distortions, local distortions and noise. The present invention also 5 relates to a method and apparatus for generating, printing and reading barcodes, and to a computer program product including a computer readable medium having recorded thereon a computer program for creating, printing and reading barcodes. Background While modem computers have significantly enhanced the manner is which data is 10 processed and used, paper is still an important medium for recording and conveying information. Conventionally, paper has been primarily used to record and convey human readable information. This human readable information is typically printed on to the paper. However, computer readable information may also be printed on paper. One conventional method of printing computer readable information on paper is by 15 encoding the information into a one-dimensional barcode. There are a number of different formats of one-dimensional barcodes, including UPC/EAN, Code 39, Code 128, and Interleaved 2 of 5. However, one-dimensional barcodes are limited in the amount of data that they can store, since the data density of one-dimensional barcodes is low and one-dimensional barcodes are usually of a fixed size. 20 In order to increase the data density of a barcode, a two-dimensional barcode can be used. Various two-dimensional barcode formats are known. Most of these two dimensional barcode formats comprise a collection of regions arranged in a grid formation. Each of these regions is typically colored (e.g., either black or white). The color of each region conveys one bit of information. However, even two-dimensional 25 barcodes suffer from a number of problems.
-2 The process of printing a one-dimensional or two-dimensional barcode can introduce distortions into the barcode. When a barcode is printed using an electro-photo graphic engine (i.e., a laser printer) the types of distortions introduced into the barcode may include warping. Warping causes straight lines to be printed as wavy lines. These 5 wavy lines may deviate from being straight by up to a few printer pixels. Noise can also be introduced into a printed barcode. Noise may be caused by splotches of ink in the printed barcode. Color channel mis-registration can also be introduced into a printed barcode. Color channel mis-registration may occur where cyan, magenta, yellow, and black channels, for example, of the printed barcode are not correctly aligned. 10 Warping of a printed barcode may also occur if the barcode is folded or crumpled in between printing and scanning the barcode. Additional noise may be introduced by marks made on a printed barcode. One known method of reading a barcode image is by sampling the barcode at points on a grid formation. The samples may then be used to ascertain the colors of the regions 15 of the barcode, and hence to encode the bits of information represented by the barcode. However, this method is problematic in the presence of warping distortions. If the amount of deviation in the barcode is larger than the size of the barcode regions, then the barcode image may be sampled at points inside a wrong region. In one known method of generating a barcode, instead of coloring each region of 20 the barcode, glyphs are printed in each region of the barcode. Typically, the glyphs that are printed in each region of a barcode are either forward or backward slashes. Upon reading the barcode generated in such a manner, the glyphs can be found by a tracking method. Typically, the tracking method scans along each row of the barcode, locating each successive glyph relative to the location of a previous glyph. Printing glyphs in each 25 region of a barcode increases the resistance of the barcode to warping. However, printing glyphs in such a manner sacrifices data density, since the regions need to be larger.
-3 Additionally, the tracking method described above is not particularly resistant to noise. For example, if a glyph becomes corrupted due to noise and cannot be located, subsequent glyphs may not be able to be located either. Another known method of generating a barcode colors the regions of the barcode 5 either black or white. Tracking may then be performed on the barcode based on detecting edges where color changes from black to white, or vice versa. Coloring the regions of a barcode either black or white can increase the data density of the barcode. However, such barcodes may still be disadvantageously affected by noise. Further, the barcodes described often suffer from color channel mis-registration. In this instance, barcodes 10 printed in color by combining more than one of cyan, magenta, yellow, or black inks, may be impossible to decode. Thus, a need clearly exists for more efficient methods of generating, printing and reading barcodes. Summary 15 It is an object of the present invention to substantially overcome, or at least ameliorate, one or more disadvantages of existing arrangements. According to one aspect of the present invention there is provided a method of generating a barcode representing one or more portions of data, said method comprising the steps of: 20 generating groups of coding elements, each of which has an alignment coding elements and data coding elements, wherein the alignment coding element and each of the data coding elements are a same size; and arranging the groups of coding elements according to a correlatable alignment pattern to generate the barcode so that row and coordinates of the alignment coding 25 elements are both even.
-4 According to still another aspect of the present invention there is provided an apparatus for generating a barcode representing one or more portions of data, said apparatus comprising: pattern generation means for generating groups of coding elements, each of which 5 has an alignment coding element and data coding elements, wherein the alignment coding element and each of the data coding elements are a same size; and data pattern arranging means for arranging the groups of coding elements according to a correlatable alignment pattern to generate the barcode so that row and coordinates of the alignment coding elements are both even.. 10 According to still another aspect of the present invention there is provided a computer readable storage medium having recorded thereon a computer program for generating a barcode representing one or more portions of data, said program comprising: code for generating groups of coding elements, each of which has an alignment coding element and data coding elements, wherein the alignment coding element and each 15 of the data coding elements are a same size; and code for arranging the groups of coding elements according to a correlatable alignment pattern to generate the barcode so that row and coordinates of the alignment coding elements are both even. Other aspects of the invention are also disclosed. 20 Brief Description of the Drawings One or more embodiments of the present invention will now be described with reference to the drawings and appendices, in which: Fig. 1 is a schematic block diagram of a general-purpose computer upon which arrangements described may be practised; 25 Fig. 2A shows a barcode; Fig. 2B shows alignment codels and data codels of the barcode of Fig. 2A; -5 Fig. 3 shows the mapping of coordinates from barcode codels to a coarsely aligned image and a scanned image of the barcode of Fig. 2A; Fig. 4 is a flow diagram showing a method of generating the barcode of Fig. 2A; Fig. 5 is a flow diagram showing a method of reading the barcode of Fig. 2A; 5 Fig. 6 shows a plot of the real part of a Logarithmic Radial Harmonic Function (LRHF); Fig. 7 shows a spiral bitmap; 10 THE NEXT PAGE IS PAGE NO.8 -8 Fig. 8 shows the location of spirals embedded in the barcode of Fig. 2A; Fig. 9 is a flow diagram showing a method of determining a coarse alignment affine transform, as executed in the method of Fig. 5; Fig. 10 shows the barcode of Fig. 2A with its border divided into squares; 5 Fig. 11 is a flow diagram showing a method of storing data in border codels of the barcode of Fig. 2A, as executed in the method of Fig. 4; Fig. 12 is a flow diagram showing a method of extracting salt data from the border of the barcode of Fig. 2A, as executed in the method of Fig. 5; Fig. 13 is a flow diagram showing a method of determining three fine alignment 10 warp maps for a scanned image of the barcode of Fig. 2A, as executed in the method of Fig. 5; Fig. 14 is a flow diagram showing a method of generating an alignment pattern in alignment codels of the barcode of Fig. 2A, as executed in the method of Fig. 4; Fig. 15 is a flow diagram showing a method of generating a reference image for the 15 current color channel, as executed in the method of Fig. 13; Fig. 16A shows a correlation tile of the reference image, which may be used in the method of Fig. 13; Fig. 16B shows a correlation tile in the coarsely-aligned image, corresponding to the correlation tile of the reference image of Fig. 16A; 20 Fig. 17 is a flow diagram showing a method of generating a displacement map for the color channel, as executed in the method of Fig. 13; Fig. 18 shows an example of two overlapping correlation tiles, Fig. 19 is a flow diagram showing an alternative method for determining the Fast Fourier Transform (FFT) of correlation tiles, as executed in the method of Fig. 17; 25 Fig. 20 is a flow diagram showing a method of interpolating a mapping, as executed in the method of Fig. 13; -9 Fig. 21 is a flow diagram showing a method of determining the location of a highest peak in a correlation image to sub-pixel accuracy, as executed in the method of Fig. 17; Fig. 22 shows a codel and it's adjacent (i.e., neighbouring) codels; Fig. 23 is a flow diagram showing a method of encoding data and generating the 5 barcode of Fig. 2A from the encoded data, as executed in the method of Fig. 4; Fig. 24 is a flow diagram showing a method of extracting data from a barcode of Fig. 2A and decoding the extracted data, as executed in the method of Fig. 5; Fig. 25 is a flow diagram showing a method of locating six peaks corresponding to each of the spirals embedded in the barcode of Fig. 2A. 10 Fig. 26 is a flow diagram showing a method of determining the dimensions of the barcode of Fig. 2A, as executed in the method of Fig. 9; Fig. 27 is a flow diagram showing a method of generating a coarsely-aligned image for the cyan color channel of the scanned image, as executed in the method of Fig. 13; Fig. 28 is a flow diagram showing a method of generating a correlation image as 15 executed in the method of Fig. 17; Fig. 29 is a flow diagram showing a method of generating a coarsely-aligned image, as executed in the method of Fig. 13; Fig. 30 is a flow diagram showing a method of determining a warp map for the current color channel, as executed at in the method of Fig. 13; 20 Fig. 31 is a flow diagram showing a method of determining constant vectors as executed in the method of Fig. 21; Fig. 32 is a flow diagram showing a method of determining parameters for a color model for a color channel c; Fig. 33 is a flow diagram showing a method of determining parameters for another 25 color model for the color channel c; and - 10 Fig. 34 is a flow diagram showing a method of determining pixel values from the scanned image of the barcode of Fig. 2A, as executed in the method of Fig. 24. Detailed Description including Best Mode Where reference is made in any one or more of the accompanying drawings to steps 5 and/or features, which have the same reference numerals, those steps and/or features have for the purposes of this description the same function(s) or operation(s), unless the contrary intention appears. It is to be noted that the discussions contained in the "Background" section and that above relating to prior art arrangements relate to discussions of devices which form public 10 knowledge through their respective publication and/or use. Such should not be interpreted as a representation by the present inventor(s) or patent applicant that such devices in any way form part of the common general knowledge in the art. For ease of explanation the following description has been divided into Sections 1.0 to 9.0, each section having associated subsections. 15 1.0 Introduction 1.1 System for generating and reading barcodes The methods described herein may be practiced using a general-purpose computer system 100, such as that shown in Fig. 1 wherein the processes of Figs. 2 to 34 may be implemented as software, such as an application program executing within the computer 20 system 100. In particular, the steps of the described methods may be affected by instructions in the software that are carried out by the computer. The instructions may be formed as one or more code modules, each for performing one or more particular tasks. The software may also be divided into two separate parts, in which a first part performs the described methods and a second part manages a user interface between the first part 25 and the user. The software may be stored in a computer readable medium, including the storage devices described below, for example. The software is loaded into the computer - 11 from the computer readable medium, and then executed by the computer. A computer readable medium having such software or computer program recorded on it is a computer program product. The use of the computer program product in the computer affects an advantageous apparatus for implementing the described methods. 5 The computer system 100 is formed by a computer module 101, input devices such as a keyboard 102, mouse 103 and a scanner 119, output devices including a printer 115, a display device 114 and loudspeakers 117. The printer 115 may be in the form of an electro-photographic printer, an ink jet printer or the like. The printer may be used to print barcodes as described below. The scanner 119 may be in the form of a flatbed 10 scanner, for example, which may be used to scan a barcode in order to generate a scanned image of the barcode. The scanner 119 may be configured within the chassis of a multi function printer. A Modulator-Demodulator (Modem) transceiver device 116 may be used by the computer module 101 for communicating to and from a communications network 120, for 15 example, connectable via a telephone line 121 or other functional medium. The modem 116 may be used to obtain access to the Internet, and other network systems, such as a Local Area Network (LAN) or a Wide Area Network (WAN), and may be incorporated into the computer module 101 in some implementations. In one implementation, the printer 115 and/or scanner 119 may be connected to the computer 20 module 101 via such communication networks. The computer module 101 typically includes at least one processor unit 105, and a memory unit 106, for example formed from semiconductor random access memory (RAM) and read only memory (ROM). The module 101 also includes a number of input/output (1/0) interfaces. These I/O interfaces include an audio-video interface 107 25 that couples to the video display 114 and loudspeakers 117, an I/O interface 113 for the keyboard 102 and mouse 103 and optionally a joystick (not illustrated), and an EDITORIAL NOTE APPLICATION NUMBER - 2004242416 This specification does not contain a page "12" - 13 another computer or networked device, and the Internet or intranets including e-mail transmissions and information recorded on Websites and the like. The methods described below may alternatively be implemented in dedicated hardware such as one or more integrated circuits performing the functions or sub 5 functions of the described methods. Such dedicated hardware may include graphic processors, digital signal processors, or one or more microprocessors and associated memories. The data to be encoded in the barcodes described below may be stored in an electronic file of a file-system configured within the memory 106 or hard disk drive 110 10 of the computer module 101, for example. Similarly, the data to be read from a barcode may also be stored in the hard disk drive 110 or memory 106 upon the barcode being read. Alternatively, the data to be stored in a barcode may be generated on-the-fly by a software application program resident on the hard disk drive 110 and being controlled in its execution by the processor 105. The data read from a barcode may also be processed 15 by such an application program. 1.2 Elements making up a barcode A barcode may comprise a rectangular array of square regions. Each square region may either be printed on the printer 115, for example, using ink, or may be left blank. The presence or absence of ink may be used to store one bit of data. These square regions 20 are elements of the barcode and are used to encode information. These elements may be referred to as coding elements, or "codels". A codel is "on" if the codel has ink printed in the region forming the codel. Conversely, the codel is "off' if there is no ink printed in the region forming the codel. Codels may be printed in a number of different colored inks. For example, many 25 printers use cyan, magenta, and yellow inks. These three inks are referred to as the "primary colors". Some of the codels described below may be printed using cyan ink, - 14 while others are printed using magenta ink. Still other codels may be printed using yellow ink. Thus, the codels described here may be printed in inks of all of the three primary colors. The codels of a barcode may also all be printed using the same color ink (e.g., black 5 ink) to produce monochrome barcodes. Codels that are printed in the same color ink are said to belong to the same "color channel". The dimensions of a barcode may be specified by width (W) and height (H). Codels may be arranged in an array with H rows, W columns, and three (3) color planes (i.e., for the cyan, magenta, and yellow inks). In this instance, the total number of codels 10 of a barcode is equal to W x H x 3. The physical size of a barcode may be determined by the size of the codels in the barcode on a printed page. For example, the codels may be printed at a codel resolution of 150 dots-per-inch. This means that each codel is a square with side-length of one 150th of an inch. However, a person skilled in the relevant art would appreciate that any suitable codel resolution may be used to generate the barcodes 15 described here. Fig. 2A shows a barcode 200. The barcode 200 will be used below as an example barcode to describe the methods of Figs. 3 to 34. The barcode 200 comprises a border 201 and an interior 202. The border 201 of the barcode 200 comprises codels (e.g., 203) of all three color channels (i.e., cyan, magenta, and yellow). The codels of each color 20 channel may be said to form an independent barcode for that particular color channel. Therefore, the barcode 200 may be said to comprise a plurality of independent barcodes where each of the independent barcodes is of a particular colour channel. The border 201 has a width, which may be denoted as 'B'. For example, B may be equal to thirty-two (32) meaning that the barcode 200 has thirty two (32) codels on all four sides of the 25 barcode 200. The codels (e.g., 203) that lie in the border 201 may be referred to as "border codels". The interior 202 of the barcode 200 comprises all codels of the barcode - 15 200 that are not in the border 201. In the interior 202, some of the codels may be referred to as "alignment codels" 205 and the remaining codels may be referred to as "data codels" 206, as shown in Fig. 2B. Data codels 206 may be used to store information (i.e., data). Alignment codels 205 and border codels 203 may be used to perform alignment, which 5 will be described in detail below. As seen in Fig. 2, for the barcode 200, for each group of four codels there is one alignment codel 205 and three data codels 206. These groups of four codels may be arranged symmetrically within the interior of the barcode 200. The alignment codels 205 are the codels whose row and column coordinates are both even, in all three color channels (i.e., cyan, magenta, and yellow). However, the 10 alignment codels 205 may be arranged in any other suitable arrangement. For example, one eighth of the codels in the interior 202 of the barcode 200 may be selected pseudo randomly to be alignment codels (e.g., 205). In order to make it easier to determine the dimensions of the barcode 200 from a scanned image of the barcode 200, the possible values of height (H) and width (W) of the 15 barcode 200 may be restricted. In one example, H and W may be multiples of the border width B. For ease of explanation and in order to allow specific codels in the barcode 200 to be identified, a codel coordinate system will be described. In this codel coordinate system, each codel in the barcode 200 may be uniquely specified by a 3-tuple of 20 coordinates (x, y, c). In this 3-tuple of coordinates (x, y, c), x specifies a column for the codel, where column numbers range from 0 to W - 1; y specifies a row for the codel, where row numbers range from 0 to H - 1); and c specifies a color channel for the codel, where c is one of cyan, magenta, or yellow. The state of the codel with coordinates (x, y, c) may be denoted by a(x, y, c). If a(x, y, c) = 0, the codel at (x, y, c) is in the "off' 25 state. If a(x, y, c) = 1, the codel at (x, y, c) is in the "on" state. 2.0 Two-stage alignment - 16 Determining the location of codels in a scanned image of the barcode 200, produced using the scanner 119 when reading the barcode 200, can be problematic. The barcode 200 may be printed at one resolution (e.g., 150 codels-per-inch) and scanned at a higher resolution (e.g., 600 dpi). This means that a codel in the scanned image is 4-by-4 scanned 5 pixels in size. The location of the centre of the codel in the scanned image is required to be determined accurately. However, due to distortions and warping, the locations of codels in the scanned image may deviate from their expected locations. The location of codels (e.g., 203) in the scanned image of the barcode 200 may be determined using "coarse alignment" and "fine alignment". Coarse alignment represents 10 an approximate mapping between codels and the coordinates of their centres' in the scanned image. Coarse alignment may use an affine transformation. Since the mapping between codels and their location in the scanned image is usually more complicated than an affine transform, coarse alignment may not accurately represent the codel locations. Once the coarse alignment affine transform has been found, the scanned image may be 15 transformed, undoing the effects of the affine transform, and thus producing an image that is approximately the same as the original barcode 200. This image that is approximately the same as the original barcode 200 may be referred to as the coarsely-aligned image. Fig. 3 shows a coarsely-aligned image 302 and a scanned image 303. Each of the images 302 and 303 represent the barcode 200. A representation of a coarse alignment 20 affine transform 311 is also shown. The coarse alignment affine transform 311 takes coordinates in the coarsely-aligned image and maps the coordinates in the coarsely aligned image to coordinates in the scanned image. Fine alignment may be used to determine the mapping between barcode codels 301, as shown in Fig. 3, and the coarsely-aligned image 302, using an array of displacement 25 vectors 310. Such an array of displacement vectors may be referred to as a "displacement map". Since color channels may be mis-registered, a particular displacement map is - 17 configured in accordance with codels of only a single color channel. Thus, three separate displacement maps are generated for the barcode 200, one for each of the cyan, magenta, and yellow color channels. The displacement map 310 and the coarse alignment affine transform 311 together 5 provide a mapping from the barcode codels 301 to coordinates in the scanned image 303. Given the coordinates of a codel 315 in the barcode codels 301, the displacement map 310 may be used to find the coordinates of the centre of that codel 317 in the coarsely aligned image 302. Those coordinates may then be transformed by the coarse alignment affine transform 311, resulting in the coordinates of the centre of the codel 319 in the 10 scanned image 303. Thus the composition of the displacement map 310 and the affine transform 311 results in a mapping from the codel coordinates (e.g., the coordinates 315) to the scanned image coordinates (e.g., the coordinates 319). The composed mapping is called a warp map. A representation of a warp map 312 is also shown in Fig. 3. A warp map 312 is generated, for each of the cyan, magenta, and yellow color channels of the 15 barcode 200. 3.0 Generating and reading barcodes Fig. 4 is a flow diagram showing a method 400 of generating a barcode, such as the barcode 200, for example. The method 400 may be implemented as software resident on the hard disk drive 110 and be controlled in its execution by the processor 105. 20 The method 400 accesses data to be encoded, and produces an array of codels forming the barcode 200 representing the data. This array of codels forming the barcode 200 may then be printed using the printer 115. The method 400 begins at the first step 402, where the processor 105 generates spirals for corners (e.g., 209) of the barcode 200. The processor 105 encodes (or embeds) 25 the spirals into border codels (e.g., 207) of the barcode 200. At the next step 403, the processor 105 generates a border pattern for the barcode 200, storing data in the border - 18 codels of the barcode 200. The processor 105 fills any of the codels that do not contain spirals with a small amount of data as will be described in detail below. The processor 105 may also store random data (i.e., noise) into codels of regions of the barcode border 201 where spirals have been embedded. A method 1100 of storing data in border codels 5 of the barcode 200, as executed at step 403, will be described below with reference to Fig. 11. The method 400 continues at the next step 404, where the processor 105 generates an alignment pattern in the alignment codels (e.g., 205) of the barcode 200, in order to allow fine alignment to be performed when reading the barcode 200. A method 1400 of generating an alignment pattern in the alignment codels (e.g., 205) of the barcode 200, as 10 executed at step 404, will be described in more detail below with reference to Fig. 14. Then at the next step 405, the processor 105 accesses the data, from memory 106 for example, encodes the data, and arranges the encoded data in the barcode 200 as one or more codels (e.g., 203). As will be described in detail below, the codels containing the encoded data are interdispersed in the barcode 200 with the alignment codels. A method 15 2300 of encoding data and arranging the encoded data in the barcode 200, as executed at step 405, will be described below with reference to Fig. 23. Fig. 5 is a flow diagram showing a method 500 of reading a barcode, such as the barcode 200, for example. The method 500 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. 20 The method 500 accesses an image generated by scanning the barcode 200. This image may be referred to as the 'scanned image' of the barcode 200. The scanned image may be accessed from memory 106, for example. The method 500 then produces data encoded in the barcode 200. The method 500 begins at step 502, where the processor 105 determines a coarse 25 alignment affine transform. The coarse-alignment transform is determined based on the dimensions of the barcode 200. At step 502, the processor 105 determines the locations - 19 of spirals in the scanned image of the barcode 200 and uses the detected spirals to locate the barcode 200 on a page. The processor 105 then determines the dimensions of the barcode 200, determines the resolution of the codels and determines the coarse alignment affine transform based on the determined dimensions. A method 900 of determining a 5 coarse alignment affine transform, using the locations of the spirals, as executed at step 502, will be described below with reference to Fig. 9. At the next step 504, the processor 105 reads the border 201 of the barcode 200 and extracts salt data. Salt data is a small amount of data from the border 201 of the barcode 200, as will be described in more detail below. A method 1200 of extracting salt data 10 from the border 201 of the barcode 200, will be described below with reference to Fig. 12. Then at the next step 505, the processor 105 analyses the scanned image of the barcode 200 to determine three fine alignment warp maps. These alignment warp maps describe where codels in the barcode 200 as printed appear in the scanned image of the barcode 200. A method 1300 of determining three fine alignment warp maps for the scanned 15 image of the barcode 200, as executed at step 505, will be described below with reference to Fig. 13. At the next step 506, the processor 105 generates color models that predict how printed colors appear in the scanned image. Then at step 507, the processor 105 uses the fine alignment warp maps and the color models to extract data from the barcode 200 and decode the extracted data. A method 2400 of extracting data from the barcode 200 20 and decoding the extracted data, as executed at step 507, will be described in detail below with reference to Fig. 24. 4.0 Spirals and coarse alignment Step 402 of the method 400 and step 502 of the method 500 will now be described in more detail. 25 As described above, at step 402, the processor 105 generates spirals in the corners (e.g., 209) of the barcode 200 located inside the border region 201. These spirals are -20 generated in the barcode 200 since the spirals have distinctive properties that allow the spirals to be easily detected when the barcode 200 is read. As described above, at step 502, the processor 105 determines a coarse alignment affine transform. The course-alignment transform is determined based on the dimensions 5 of the barcode 200. At step 502, the processor 105 determines the locations of spirals in the scanned image of the barcode 200 and uses the detected spirals to locate the barcode 200 on a page. The processor 105 then determines the dimensions of the barcode 200, determines the resolution of the codels and determines the coarse alignment affine transform. 10 The spirals used in the barcode 200 are bitmapped versions of logarithmic radial harmonic functions (LRHF). Mathematically, LRHF are complex valued functions defined on a plane. LRHF have the properties of scale and rotation invariance, which means that if an LRHF is transformed by scaling or rotation the transformed LRHF is still an LRHF. As an example, Fig. 6 shows a plot of the real part 600 of an LRHF. 15 An LRHF has three parameters that may be adjusted. The first parameter is referred to as the Nyquist radius R, which is the radius at which the frequency of the LRHF becomes greater than 7r radians per pixel. The second parameter is referred to as the spiral angle a, which is the angle that the spiral arms (e.g., 601) make with circles centred at the origin (e.g., 602). The third parameter is referred to as the phase offset <. An LRHF may 20 be expressed in polar coordinates (r, 0), in accordance with Formula (1) as follows: e(r, 0)= e j(me+ninr++) (1) where the values of m and n may be determined in accordance with the following Formulae (2): n = RT cos a (2) m =[Rnsinoj 25 In one example, a = 7r / 6 radians, and R = B / 4, where B represents the width of the -21 barcode border 201, as shown in Fig. 2. The choice of phase 4 varies for different spirals in the same barcode and will be described in more detail below. 4.1 Embedding spirals At step 402 of the method 400, the processor 105 generates six spirals in the 5 barcode 200. The spirals are embedded in the border codels (e.g., 203) in the cyan channel of the barcode 200. Each spiral is generated by generating a spiral bitmap, which samples the LRHF with the Nyquist radius R, the spiral angle a and the phase offset 4. The spiral bitmap has height and width equal to B pixels. Fig. 7 shows a spiral bitmap 700. The polar coordinates in the spiral bitmap 700 10 will now be described. The origin 703 of the coordinate system of the spiral bitmap 700 refers to the centre of the spiral bitmap 700. The radius r 701 of a point in the spiral bitmap 700 is the distance from that point to the origin 703, measured in pixels. The angle 0 702 of a point in the spiral bitmap 700 is the angle of a ray from the origin 703 through the point. In accordance with this definition of radius r and angle 0, the value of 15 a pixel in the spiral bitmap with coordinates (r, 6) may be determined in accordance with Formula (3) as follows: 1ifr > Rand Re(e(r,E))> 0 (3) 0 otherwise Squares (e.g., 705) of the spiral bitmap 700 shown in Fig. 7 are shaded where pixel values of the bitmap 700 are equal to one (1). Squares (e.g., 707) of the bitmap 700 are 20 unshaded where the pixel values of the bitmap 700 are equal to zero (0). Once the spiral bitmap 700 has been generated, the spiral represented by the spiral bitmap 700 may be embedded into the codels of the barcode 200. Pixels of the spiral bitmap 700 equal to zero (0) are encoded into the barcode 200 by setting the state of a corresponding codel to "off'. Pixels of the spiral bitmap 700 equal to one (1) are encoded 25 into the barcode 200 by setting the state of a corresponding codel to "on".
- 22 As seen in Fig. 8, six spirals 801, 802, 803, 804, 805 and 806 may be embedded in the border 201 of the barcode 200. Each of these spirals 801, 802, 803, 804, 805 and 806 is B codels wide, and B codels high. As described above, B may be equal to thirty-two (32) meaning the each of the spirals is thirty-two codels wide and thirty-two codels high. 5 Five of the spirals (i.e., spirals 801, 803, 804, 805 and 806, as seen in Fig. 8) embedded in the barcode 200, have the same value for phase (i.e., # = 0), while the remaining spiral (i.e., spiral 802) has an opposite phase (i.e., # = 7r). The locations of the six spirals 801, 802, 803, 804, 805 and 806 embedded in the border 201 of the barcode 200 will now described with reference to Fig. 8. 10 As seen in Fig. 8, four spirals 801, 803, 804 and 806 of the five spirals (i.e., spirals 801, 803, 804, 805 and 806, as seen in Fig. 8) with phase 4 = 0 are positioned in the four corners (e.g., 205) of the barcode 200. The other spiral 805 with 4=0 is positioned immediately to the left of the spiral 804 in the bottom-right corner 205 of the barcode 200. The spiral 802 with opposite phase 4 = gr is positioned immediately to the right of 15 the spiral in the top-left corner of the barcode. The six spirals 801, 802, 803, 804, 805 and 806 embedded in the border 201 of the barcode 200 are encoded into cyan channel codels of the border 201 of the barcode 200. 4.2 Higher resolution spirals Spirals may be printed by the printer 115, for example, at a higher resolution than 20 the resolution of the codels (i.e., the 'codel resolution') of the associated barcode 200 being printed. This may allow more accurate sampling of an underlying LRHF, and better spiral detect ability when the barcode 200 is scanned by the scanner 119, for example. Alternatively, the spirals of the barcode 200 may print at a 'spiral resolution'. The spiral resolution is equal to the codel resolution multiplied by an integer referred to as 25 a 'spiral factor', F. The spiral resolution is preferably a highest resolution that the printer 115 can print at.
- 23 Each codel (e.g., 205, 206) in the cyan channel, where a spiral is to be added to the barcode 200, is divided into an F x F array of pixels. In one example, the spiral bitmaps (e.g., 700) formed at step 402 have a height H and width W equal to BF rather than B. In this instance, the spiral bitmaps (e.g., 700) are embedded into the pixels arrays. 5 4.3 Detecting spirals As described above, at step 502 of the method 500, the processor 105 detects the locations of spirals in the scanned image of the barcode 200 and then determines a coarse alignment affine transform, using the locations of the spirals. The detection of spiral locations may be achieved by performing a correlation between a spiral template image 10 and the scanned image of the barcode 200. The method 900 of determining a coarse alignment affine transform, as executed at step 502, will now be described with reference to Fig. 9. The method 900 may be implemented as software resident on the hard disk drive 110 and being controlled in its execution by the processor 105. 15 The method 900 begins at an initial step 901, where the processor 105 generates a spiral template image, within memory 106, for example. The generation of the spiral template image at step 901 is similar to the generation of the spiral bitmap in step 402 of the method 400. However, the spiral template image is complex valued and is larger in size than the spiral bitmap. Each pixel value in the spiral template image is stored, in 20 memory 106, as a pair of double-precision floating point numbers representing the real and imaginary parts of the pixel value. The spiral template image has height and width equal to T,, the template size. The template size T, may vary. In one example T, = 256. Polar coordinates (r, 8) in the spiral template are defined, with the origin in the centre of the template. The pixel value at polar coordinates (r, 8) in the spiral template 25 image may be determined in accordance with Formula (4) as follows: - 24 ej(mo+ninr) if r>R (4) 0 otherwise .where m and n are defined by Formulae (2) above; the Nyquist radius R represents the radius at which the frequency of the LRHF becomes greater than 7r radians per pixel; and the spiral angle a represents the angle that the spiral arms of the LRHF make with circles 5 centred at the origin of the LRHF. At the next step 903, the processor 105 performs a correlation between a red channel of the scanned image and the complex spiral template image to generate a correlation image. The correlation of two images I, and I2 is a correlation image I,. The correlation 10 image I, may be determined in accordance with Formula (5) below: Ix (X, Y) = Y 1 (X', y')12(X'+ X, Y'+ Y) (5) The sum of Formula (5) ranges over all x' and y' where I, is defined, and in the image 12, the values of pixels outside the image are considered to be zero. If either of the images I, or 12 is complex-valued, the correlation image I, may be complex-valued too. The reason 15 that the red channel is used in the correlation at step 903 is that red is approximately the opposite color to cyan, and the spirals of the LRHF were embedded in the cyan channel of the barcode 200. Thus, the spirals are detectable in the red channel of the scanned image. The resulting correlation image I, contains peaks (i.e., pixels with large modulus relative to neighbouring pixels), at the locations of spirals in the scanned image of the barcode 20 200. The phase of the pixel value of a peak is related to the phase # of a corresponding spiral (e.g., 801) that was embedded in the barcode 200. The five spirals 801, 803, 804, 805 and 806 that were generated with 4 = 0 at step 402 have peaks with similar phase, while the one spiral 802 that was generated with # = ir at step 402 typically has a peak with opposite phase to the peaks of the other five spirals. Even if the scanned image of -25 the barcode 200 is at a different resolution to the resolution that the barcode 200 was printed at, the spirals 801, 802, 803, 804, 805 and 806, will still be detected by the processor 105 since the underlying LRHF of the spirals is scale-invariant. At the next step 904 of the method 900, the processor 105 examines the correlation 5 image resulting from step 903, and locates the six peaks corresponding to each of the spirals 801 to 806 in accordance with the arrangement of the spirals 801 to 806 seen in Fig. 8. The six peaks corresponding to each of the spirals 801 to 806 may be located in accordance with the resolution at which the barcode 200 was printed (represented as RP) and the resolution at which the barcode 200 was scanned (represented as R,). If either of 10 the resolutions RP and R, is not known, but there are only a few possibilities for the values of the resolutions RP and R,, then the six peaks of the spirals 801 to 806 may be located by trying each of the possible resolutions, and locating six peaks with a layout consistent with the corresponding possible resolution. A method 2500 of locating the six peaks corresponding to each of the spirals 801 to 15 806, as executed at step 904, will now be described with reference to Fig. 25. The method 2500 may be implemented as software resident on the hard disk drive 110 and being controlled in its execution by the processor 105. The method 2500 begins at step 2501, where the correlation image determined at step 903 is searched to locate the spirals 804 and 805 in the bottom-right corner 205 of the 20 barcode 200. The spirals 804 and 805 correspond to a pair of peaks with approximately the same phase and lying approximately B x R, / RP pixels apart in the scanned image of the barcode 200. The coordinates of each the peaks of the spirals 804 and 805 may be denoted by q 4 and q 5 , respectively. At the next step 2503, the correlation image determined at step 903 is searched to 25 locate the spirals 801 and 802 in the top-left corner of the barcode 200. The spirals 801 - 26 and 802 correspond to a pair of peaks lying approximately (B x R, / RP) pixels apart in the scanned image of the barcode 200. The peak of the spiral 801 will have approximately the same phase as the peaks at q 4 and q 5 determined previously. The peak of the spiral 802 will have approximately the opposite phase. The coordinates of the peak 5 corresponding to the spiral 801, in the scanned image, having approximately the same phase as the peaks at q 4 and q 5 may be denoted q 1 . The coordinates of the peak corresponding to the spiral 802, in the scanned image, having approximately the opposite phase as the peaks at q 4 and q 5 may be denoted q 2 . If the peak at q 4 is closer in distance to the peak at q, than the peak at q 5 is, then the peaks at q 4 and q 5 may be swapped. 10 The method 2500 concludes at the next step 2505, where the locations of the top right and bottom-left spirals 803 and 806 may be estimated, and the correlation image of step 903 may be searched to see if peaks with the correct phase are at the locations determined for the spirals 803 and 806. If peaks with the correct phase are found at the locations of the top-right and bottom-left spirals 803 and 806, then a barcode with 15 consistent layout to the barcode 200 has been found. The expected coordinates of the top right spiral 803 may be denoted by q' 3 . The value of the expected coordinates q' 3 may be determined by projecting a point at coordinates q 4 onto a line joining the coordinates q, to the coordinates q 2 . Similarly, the expected coordinates of the bottom-left spiral 806 may be denoted q' 6 . The value of the coordinates q' 6 may be determined by projecting a point 20 at coordinates q, onto the line joining the coordinates q 4 and q 5 . The correlation image may be searched for peaks at coordinates q 3 and q 6 that are close to expected coordinates q' 3 and q' 6 , respectively. Some predetermined tolerance parameters may be used in the method 2500, in order to determine whether peaks are approximately the right distance apart, whether two peaks 25 have approximately the same (or opposite) phase, or whether two peaks are close. For -27 example, the following predetermined tolerances may be used. Two peaks may be considered to be approximately a correct distance apart if the actual distance between the two peaks is within 5% of the correct distance. The peaks at coordinates q 4 and q 5 may be considered to be of the same phase if their phases are within r/3 of each other. The 5 peaks at coordinates q, and q 2 may be considered to be of opposite phase to each other if one phase is within 7r/3 of the other phase plus 7r. The peaks at coordinates q 3 and q 6 may be considered to be close to peaks at the expected coordinates q' 3 and q' 6 if the angles q' 3 qq 3 and q' 6 q 4 q 6 are less than 50 respectively, and the angles qq 3 q 4 and q 4 q 6 q, are within 50 of 900 respectively. 10 More than one pair of peaks may be found at the top-left hand corner of the barcode 200 when searching for either of the peaks with the same or opposite phase. In this instance, different combinations of the peaks may be tried, in order to find a correct combination. Returning to the method 900 of Fig. 9, at the next step 905, the processor 105 15 determines the dimensions of the barcode 200 and generates a coarse-alignment affine transform based on the determined dimensions. The dimensions of the barcode 200 may be determined by examining the position of the peaks 801, 803 and 806 in the scanned image. A method 2600 of determining the dimensions of the barcode 200, as executed at 20 step 905, will now be described with reference to Fig. 26. The method 2600 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 2600 begins at step 2601, where the processor 105 determines the distance between the peaks corresponding to the top-left spiral 801 and top-right spiral 25 803. This distance may be denoted by 11qj - q 3 11. At the next step 2603, the distance -28 determined at step 2601 is converted from scanned pixels to codels by multiplying the distance llq - q3ll by RP/Rs in accordance with Formula (6) below, where Wc represents the distance measured in codels: WC I q, - q3| 11X RP / R, (6) 5 The value of WC is an approximation of the distance between the centres of the two spirals 801 and 803 in the original barcode 200. Wc is equal to the width of the barcode 200, minus half the width of the top-left spiral 801, minus half the width of the top-right spiral 803. Since the width of the spirals 801 and 803 is the border width B, the width W of the barcode 200 is approximately WC + B. At the next step 2605 of the method 2600, the 10 width W is determined by rounding the value of WC + B to the nearest multiple of the border width B, on the basis that the width W and height H of the barcode 200 are both multiples of the border width B. At the next step 2607, the processor 105 determines the barcode height H by rounding the value of HC + B in accordance with Formula (7) as follows: 15 HC + B = 11q, - q 6 1x R / R, + B (7) to the nearest multiple of the border width B. The method 2600 concludes following step 2607. The coarse-alignment affine transform is specified by a matrix A and a vector a. The coarse-alignment affine transform A is determined at step 905 using the width W and 20 height H of the barcode 200 by determining the affine transform that takes the centres of the three spirals 801, 803, and 806, to the positions of the three peaks q,, q 3 , and q 6 in the scanned image. If the elements of the matrix A are denoted as follows: A= ao ao 1 (8) (a 10 all) then the matrix A may be determined Formulae (9) and (10), as follows: - 29 al)=W -2B H,= - 2 B(q6 -q 1 ) (10) Then the vector a may be determined in accordance with Formula (11), as follows: a=qi -B a00 +aO] (11) 5 5.0 Salt and border patterns Steps 403 of the method 400 of Fig. 4 and step 504 of the method 500 of Fig. 5 will now be described in more detail. As described above, at step 403, the processor 105 generates a border pattern for the barcode 200, storing data in the border codels (e.g., 203) of the barcode 200. Further, at the step 504, the processor 105 reads the border 201 of the 10 barcode 200 and extracts data from the border 201 of the barcode 200. Each of steps 403 and 504 stores or reads a small amount of data (i.e., salt data) out of the border 201 of the barcode 200. The salt data may store metadata such as a version value representing the version of the barcode 200. For the purposes of storing and reading the salt data, the barcode border 201 is 15 divided into squares (e.g., 1001, 1002), as shown in Fig. 10. The barcode border 201 has width equal to B, and the barcode 200 has both height H and width W that are multiples of the border width B. Thus, the border 201 of the barcode 200 may be divided evenly into squares (e.g., 1001) with width and height equal to B / 2. The square 1001 may be referred to as a 'salt square'. 20 The cyan codels in the corners (e.g., 1006) of the barcode 200 contain spirals. As such, the salt squares (e.g., 1002) that lie where a spiral has been placed are removed from further consideration and are not considered as being salt squares. Each of the remaining salt squares, such as the square 1001, which have not been removed, may be used to store one bit of salt data.
- 30 For the purposes of storing and reading the salt data, two pseudo-random arrays, ao and a, may be used. These pseudo-random arrays, o and a, represent noise patterns. Both of the arrays a and a 1 , at each triple of codel coordinates (x, y, c), contain a value a,(x, y, c) that is either zero (0) or one (1). Since the as are pseudo-random, the values 5 ai(x, y, c) will appear random, even though the values are predetermined given x, y, and c. Any suitable pseudo-random number generation algorithm may be used to generate the arrays a and a,. For example, the arrays a and a may be generated using the RC4 algorithm, initialized with known seeds. The arrays a and a represent salt patterns, which may occur in the salt squares of the border 201, as will be described in detail 10 below. At step 403 the processor 105 assigns values to the codels in the border 201 of the barcode 200, in accordance with the salt data to be encoded. The number of bits of salt data that may be encoded is equal to the number of salt squares (e.g., 1001) that fit in the border 201 of the barcode 200, given the barcode dimensions (i.e., width W and height 15 H). Thus, barcodes with different dimensions may be able to store different amounts of salt data. The method 1100 of storing data in border codels of the barcode 200, as executed at step 403, will now be described in detail with reference to Fig. 11. The method 1100 may be implemented as software resident in the hard disk drive 110 and being controlled in its 20 execution by the processor 105. The method 1100 begins at step 1102 where the processor 105 iterates through the salt squares (e.g., 1001) of the barcode 200, in a predetermined order. For example, the processor 105 may iterate through the salt squares 1001 in scanline order. In this instance, on the first execution of step 1102, a leftmost salt square 1007 in the top row of 25 salt squares is selected. This leftmost salt square 1007 becomes the currently selected salt -31 square. On subsequent executions of 1102, subsequent salt squares (e.g., 1009 etc) in the topmost row will be selected, and then salt squares in subsequent rows will be selected, row by row. In some rows (e.g., row 1011) the salt squares may not all be adjacent. At a following step 1103, the processor 105 sets the values of codels in a currently 5 selected salt square (e.g., 1007). At step 1103 the processor 105 assigns the values of the codels in the currently selected salt square to corresponding values of og, as follows: a(x, y, c) = oa(x, y, c) for all (x, y, c) in the selected salt square, where n is defined such that the currently selected salt square is the n-th salt square to be processed at step 1103, and i is the value 10 of the n-th bit of the salt data. At the next step 1104, if the processor 105 determines that there are more salt squares in the barcode 200 to be processed then the method 1100 returns to step 1102. Otherwise, the method 1100 proceeds to step 1105. At step 1105, the processor 105 encodes random data into the magenta and yellow 15 channel codels of the regions of the barcode border 201 where the six spirals 801, 802, 803, 804, 805 and 806 were embedded. For codels (x, y, c) in the magenta and yellow channel codels of the regions of the barcode border 201 where the six spirals 801, 802, 803, 804, 805 and 806 were embedded, an assignment is made as follows: x, y, c)= a(x, y, c). 20 The method 1100 concludes following step 1105. 5.2 Reading the salt data The method 1200 of extracting salt data from the border 201 of the barcode 200, as executed at step 504, will now be described with reference to Fig. 12. The method 1200 may be implemented as software resident on the hard disk drive 110 and being controlled 25 in its execution by the processor 105.
- 32 In the method 1200, the processor 105 uses the coarse-alignment affine transform determined at step 905 and the scanned image of the barcode 200 to extract the salt data from the border 201 of the barcode 200. The method 1200 begins at step 1202, where the processor 105 iterates through the 5 salt squares (e.g., 1007) of the barcode 200. For example, the processor 105 may iterate through the salt squares in the same predetermined order used in step 1102 described above. The following steps 1203 to 1206 of the method 1200 determine which of the two salt patterns represented by the pseudo-random arrays ac or a, occur in a selected salt square 1001. This may be achieved by correlating both salt patterns with the selected salt 10 square, and determining which of the salt patterns provides a larger result. Knowing which of the salt patterns correlate with the selected salt square enables the value of the data bit encoded in the selected salt square to be determined. At step 1203, a coarsely-aligned image of the red color channel of the currently selected salt square is generated by the processor 105. The coarsely aligned image may 15 be generated by interpolating the scanned image, in order to determine values for the coarsely aligned image at non-integer coordinates. The scanned image may be interpolated using bicubic interpolation. A vector of RGB values interpolated from the scanned image at the coordinates (x, y) in the scanned image coordinate system may be denoted as s(x, y). 20 The coarsely-aligned image of the red color channel of the currently selected salt square may be denoted by Us. The image Us has both height and width equal to half the border width (i.e., B / 2). As an example, if the currently selected salt square has a top left codel at coordinates (x,, y,, c), then pixels in U, correspond to the codels with x coordinates between x, and x, + B/2 - 1, and y-coordinates between y, and y, + B/2 - 1.
- 33 If the x- and y-coordinates of Us range from 0 to B/2 - 1, then the image U, may be generated in accordance with Formula (12) as follows: Us(x, y) = the red component of s A(x+XS) + a (12) That is, the codel coordinates are transformed using the coarse alignment affine 5 transform, resulting in coordinates in the scanned image. The scanned image may then be interpolated at these coordinates, and the red component may be encoded into the coarsely-aligned image Us. Two images, UO and U,, may also be generated at step 1203. The images UO and U, contain the expected salt patterns in the cyan channel, as represented by the arrays o and 10 a. The images UO and U, may be generated as follows: U(x, y) = o(x + x,, y + y,) U(x, y) = a(x + x, y + yS) (13) The method 1200 continues at the next step 1204, where the processor 105 performs two circular correlations. The circular correlation of two images I1 and I2 with the same 15 dimensions generates a third image I, with the same dimensions, according to Formula (14) below: I(x, y)= Y1 1 (x', y') 2 (x'+ x, y'+ y) (14) The sum of Formula (14) ranges over all x' and y' where I, is defined, and in the image I2, the values of pixels outside the image I, may be obtained by considering I2 to be periodic. 20 Two circular correlations are performed at step 1204 in accordance with the Formula (14). The first of these circular correlations is the correlation of Us and UO, resulting in a correlation image UxO. The second of these correlations is the correlation of Us and U, resulting in a correlation image Ux 1
.
-34 At the next step 1205, the processor 105 determines maximum values in the correlation images Uxo and Uxi. Then at the next step 1206, the processor 105 stores a salt bit in a buffer containing salt data, using the maximum values determined at step 1205. If the maximum value in image UX 0 is greater than the maximum value in image 5 Ux 1 , then the salt bit stored in the buffer is a zero (0). Otherwise, the largest value in Uxi is greater than the largest value in Uxo, and the salt bit stored in the buffer is a one (1). The buffer containing the salt data may be configured within memory 106. At the next step 1207, if the processor 105 determines that there are more salt squares to be processed, then the method 1200 returns to step 1202. Otherwise, the method 1200 10 concludes. 6.0 Fine Alignment The method 1400 of generating an alignment pattern in the alignment codels (e.g., 205) of the barcode 200, as executed at step 404, will now be described in more detail with reference to Fig. 14. The method 1300 of determining three fine alignment warp 15 maps for the scanned image of the barcode 200, as executed at step 505, will also be described. The three fine alignment warp maps are determined in the method 1300 using the alignment pattern generated in accordance with the method 1400. The method 1400 may be implemented as software resident on the hard disk drive 110 and being controlled in its execution by the processor 105. The method 1400 20 comprises one step 1401, where the processor 105 encodes an alignment pattern into the data codels (e.g., 203) of the barcode 200. The alignment pattern used may be represented as a pseudo-random (i.e., noise) array of bits. For example, the pseudo random array of bits a 0 described above may be used at step 1401. At step 1401, the processor 105 sets the value of each alignment codel (x, y, c) (e.g., 205) of the barcode 25 200 to ao(x, y, c). The alignment pattern may be distributed uniformly across the data - 35 codels of the barcode 200. Alternatively, the alignment pattern may be distributed in one or more particular areas of the barcode 200. The method 1300 of determining three fine alignment warp maps for the scanned image of the barcode 200, as executed at step 505, will now be described with reference 5 to Fig. 13. The method 1300 may be implemented as software resident in the hard disk drive and being controlled in its execution by the processor 105. The method 1300 generates three warp maps, one for each of the cyan, magenta, and yellow color channels of the scanned image of the barcode 200. The method 1300 uses the scanned image of the barcode 200, and the coarse alignment affine transform 10 specified by the matrix A and the vector a according to Formula (11) and determines the warp map for the cyan color channel. The warp map for the cyan color channel may then be used to determine the warp maps for the magenta and yellow color channels of the scanned image. The method 1300 uses a variable c that is set to the color channel of a warp map that is currently being generated (i.e., the current color channel). The initial 15 value of c is cyan. The method 1300 begins at step 1302 where the processor 105 generates a coarsely aligned image for the cyan color channel of the scanned image. The coarsely-aligned image is generated from the scanned image using the coarse alignment affine transform specified by the matrix A and the vector a. The dimensions of the coarsely-aligned image 20 are the same as the dimensions of the barcode 200. In generating the coarsely-aligned image at step 1302, the processor 105 performs a color conversion on the scanned image, which extracts the cyan channel from the RGB colors in the scanned image. A linear transform from RGB space may be used to perform the color conversion at step 1302. The cyan component of the scanned image may be generated from the red, 25 green, and blue components of the scanned image in accordance with the following Formula (15): - 36 cyan =-1.13 x red + 0.21 x green + 0.03 x blue (15) A method 2700 of generating a coarsely-aligned image for the cyan color channel of the scanned image, as executed at step 1302, will now be described with reference to Fig. 27. The method 2700 may implemented as software resident in the hard disk drive 110 5 and being controlled in its execution by the processor 105. The method 2700 begins at step 2701, where the processor 105 selects the coordinates for a first pixel position (i.e., a current pixel position) in the coarsely-aligned image. The coarsely-aligned image may be generated in memory 106, for example. At the next step 2703, the processor 105 transforms the selected coordinates in the coarsely 10 aligned image (x, y) using the coarse alignment affine transform, resulting in coordinates A(x, y)T + a for the selected pixel in the scanned image. Then at the next step 2705, the processor 105 interpolates the scanned image at the coordinates A(x, y)' + a, using bicubic interpolation, resulting in a vector of RGB image values. Then at the next step 2707, the processor 105 converts the RGB values to the cyan color channel, using 15 Formula (15). The resulting cyan value is stored in the coarsely-aligned image configured within memory 106 as a pixel value in the cyan color channel at the current pixel position. Then at the next step 2709, if the coarsely aligned image is complete (i.e., all pixel values in the cyan color channel have been generated for the coarsely-aligned image), the method 2700 concludes. Otherwise, the method 2700 returns to step 2701 to select a next 20 pixel position in the coarsely aligned image. Alternatively, the scanned image may first be blurred with a low-pass filter prior to execution of the method 2700. Blurring the scanned image using the low-pass filter may reduce the effects of aliasing introduced when a high-resolution scanned image is transformed to produce a lower-resolution coarsely-aligned image. Any suitable low-pass 25 filter may be used to blur the scanned image. The selection of the low-pass filter may be - 37 based on the ratio between the resolution of the scanned image and the resolution of the barcode 200. Following step 1302 of the method 1300, at the next step 1303, the processor 105 generates a reference image for the current color channel c. A method 1500 for 5 generating a reference image for the current color channel, as executed at step 1303, will now be described with reference to Fig. 15. The method 1500 may be implemented as software resident on the hard disk drive 110 and being controlled in its execution by the processor 105. The method 1500 generates a temporary barcode with the same parameters (i.e., 10 dimensions and salt value) as the barcode 200. The temporary barcode may be configured within memory 106. The temporary barcode may be used to generate the reference image. The barcode dimensions and salt value used in the method 1500 have been determined previously in steps 502 and 504 of the method 500. The method 1500 begins at step 1501, where the processor 105 generates spirals for 15 the corners of the temporary barcode, in a similar manner to the generation of the spirals for the barcode 200 at step 402 of the method 400. At the next step 1503, the processor 105 generates a border pattern for the temporary barcode, storing data in the border codels of the temporary barcode, in a similar manner to the generation of the border pattern for the barcode 200 at step 402 of the method 400. Then at the next step 1504, the processor 20 105 generates an alignment pattern in the alignment codels of the temporary barcode, in a similar manner to the generation of the alignment pattern at step 404 of the method 400 for the barcode 200. Accordingly, at step 1504, all of the codels in the temporary barcode have been assigned values, except for the data codels. The method 1500 continues at the next step 1505 where the processor 105 generates 25 the reference image, within memory 106, using the temporary barcode. Initially the reference image is empty. When the codels in the temporary barcode of the color - 38 channel c are "on", a corresponding pixel in the reference image is set to a value of +1, and when the codels are "off', the corresponding pixel in the reference image is set to a value of -1. For the data codels which have not been assigned values previously, the corresponding pixel in the reference image is given a value of 0. The method 1500 5 concludes following step 1505. At step 1303, where spirals are printed at a higher resolution than the resolution of the codels of the barcode 200 in the cyan channel where the spirals are to be embedded, rather than dividing these codels into F x F pixels, the codels may be left undefined. In this instance, the pixels in the reference image corresponding to undefined codels in the 10 temporary barcode may be assigned the value 0. At the next step 1304 of the method 1300, the processor 105 uses the coarsely aligned image and the reference image to generate a displacement map dc for the color channel c. The displacement map dc stores displacement vectors. Each displacement vector stored is associated with a location in the reference image, and measures the 15 amount of shift between the reference image and the coarsely-aligned image at that location. The displacement map dc may be generated at step 1304 using a tiled correlation method. The generation of the displacement map d, involves selection of a tile size 2Q and a step size P. The tile size and step size may be varied. Larger values of Q give more 20 measurement precision, at the expense of averaging the increased precision over a larger spatial area, and possibly more processing time. Smaller values of step size P give more spatial detail. However, again using smaller values of step size P may increase processing time. As an example, in the cyan color channel, Q = 64, and P = 32. This represents a tile of 128 pixels high by 128 pixels wide, stepped along the reference image -39 and the coarsely-aligned image, in both horizontal and vertical directions, in 32 pixel increments. Fig. 16A shows a correlation tile 1603 of the reference image 1610, which may be used in step 1304. The correlation tile 1603 has a corresponding correlation tile 1604 in 5 the coarsely-aligned image 1620, as seen in Fig. 16B. Both of the correlation tiles 1603 and 1604 have vertical and horizontal dimensions equal to 2Q, shown as 1601. The correlation tiles 1603 and 1604 are stepped in horizontal and vertical increments according to the step size P, shown as 1602. A method 1700 of generating a displacement map dc for the color channel c, as 10 executed at step 1304, will now be described with reference to Fig. 17. The method 1700 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 1700 begins at step 1702, where the processor 105 divides the reference image 1610 and the coarsely-aligned image 1620 into overlapping tiles as 15 described with reference to Fig. 16 and iterates through the tiles in both images 1610 and 1620. On a first execution of step 1702, top-left corner tiles 1603 and 1604 from both the reference image 1610 and the coarsely-aligned image 1620, respectively, are selected. On subsequent executions of step 1702, subsequent pairs of corresponding tiles are selected, from left to right in each row of tiles, starting with a first row of tiles (e.g., 1615), and 20 finishing at a bottom row of tiles. The tile 1603 selected at step 1702 from the reference image may be denoted as T, and the selected tile 1604 from the coarsely-aligned image may be denoted T 2 . Furthermore, the coordinates of the centre of the tiles 1603 and 1604 may be denoted as (x, y). Once the pair of corresponding tiles TI and T2 has been selected at step 1702, at a 25 next step 1703, the selected tiles T, and T 2 are windowed. The tiles T, and T 2 may be -40 windowed at step 1703 by a Hanning window in a vertical direction, and a Hanning window in a horizontal direction. At the next step 1704, the selected tiles T, and T 2 are then circular phase correlated to generate a correlation image for the selected tiles. The correlation image for the selected tiles may be configured within memory 106. The 5 circular phase correlation is performed at step 1704 via the frequency domain. A method 2800 of generating a correlation image for the selected tiles as executed at step 1704 will now be described with reference to Fig. 28. The method 2800 begins at the first step 2801, where the processor 105 transforms the selected tiles T, and T 2 using a Fast Fourier Transform (FFT), to generate tiles T,^ 10 and T 2 ^. At the next step 2803, the processor 105 multiplies the tile TI^ by the complex conjugate of tile T2^ to generate tile T,^. Then at the next step 2805, the processor 105 normalises the coefficients of the tile T , so that each coefficient has unit magnitude. The method 2800 concludes at the next step 2807, where the inverse FFT of the tile T A is determined, to generate the correlation image Tx, for the tiles T, and T 2 selected at step 15 1702. The correlation image T, is an array of dimensions 2Q by 2Q of real values and may be configured within memory 106. Returning to the method 1700, at the next step 1705, the processor 105 processes the correlation image Tx to determine a displacement vector representing the location, denoted (Ax, Ay)l, of a highest peak in the correlation image T, to sub-pixel accuracy. A 20 method 2100 of determining the location of the highest peak in the correlation image Tx to sub-pixel accuracy, as executed at step 1705, will be described below with reference to Fig. 21. The location of the peak represented by the displacement vector (Ax, Ay)T, in the correlation image TX measures the amount of shift between the tiles T, and T2, and hence the displacement, or warping, between the reference image and the coarsely-aligned 25 image in the vicinity of T, and T 2
-
-. 41 The method 1700 continues at the next step 1706, where the processor 105 stores the location of the highest peak (Ax, Ay)T in the displacement map de at the location of the centre of the selected tiles. At step 1706, the processor 105 assigns d(x, y) - (Ax, Ay)T where (x, y) represents the coordinates of the centre of the tiles T, and T2. However, if a 5 peak in the correlation image Tx could not be determined at step 1705, no peak location is stored in the displacement map d(x, y). At the next step 1707, if the processor 105 determines that there are more tiles in the reference image and the coarsely-aligned image to be processed, then the method 1700 returns to step 1702. Otherwise, the method 1700 concludes. 10 The displacement map d, generated in accordance with the method 1700 is defined at some locations (x, y), where the possible locations (x, y) are the centres of correlation tiles. Since the tiles were stepped with a horizontal and vertical increment of step size P, the displacement map dc may be defined at a set of points lying in a regular grid with spacing P. 15 Since the tiles (e.g., 1603, 1604) used for correlations in the method 1700 are overlapping, some of the calculations performed in determining the FFT of previous tiles, may be reused when calculating the FFT of subsequent tiles. This may increase the speed of the fine alignment. An alternative method 1900 for determining the Fast Fourier Transform (FFT) of correlation tiles, as executed at steps 1703 and 1704, will now be 20 described with reference to Figs. 18 and 19. Fig. 18 shows two overlapping tiles 1801 and 1802. The tile 1801 is shaded with north-easterly lines and the tile 1802 is shaded with south-easterly lines. A region 1803 as shown in Fig. 18 represents the overlap of the tiles 1801 and 1802. The amount of overlap of the tiles 1801 and 1802 represented by the region 1803 is equal to 2Q - P -42 columns, where 2Q represents the tile size and P represents the step size as described above. The method 1900 may be implemented as software resident on the hard disk drive 110 and being controlled in its execution by the processor 105. The method 1900 begins 5 at step 1902, where if the processor 105 determines that the tiles T, and T 2 overlap with the tiles TI and T 2 from a previous execution of the loop (i.e., defined by steps 1702 to 1707) of the method 1700, the method 1900 proceeds to step 1904. Otherwise, the method 1900 proceeds to step 1903. At step 1903, each column of the tiles T, and T 2 is windowed vertically, and then a vertical FFT is applied to the tiles T, and T 2 , resulting in 10 processed data for T, and T 2 . At the next step 1906, the method 1900 stores right-most one of the 2Q - P columns of processed data from both of the tiles T, and T 2 in a cache of processed columns configured within memory 106. Any data in the cache may be overwritten at step 1906. The method 1900 concludes at the next step 1907 where the processor 105 windows and applies a horizontal FFT to each row of the processed data 15 for the tiles T, and T 2 . Data resulting from step 1907 represents a two-dimensional windowed FFT of the tiles TI and T 2 . At step 1904, there is no need to determine the leftmost 2Q - P columns of processed data. Rather these columns of data may be copied out of the cache of processed columns configured within memory 106. Then at the next step 1905, the 20 processor 105 applies the window and vertical FFT to each of the remaining P columns of the tiles T, and T 2 . Following step 1905, the method 1900 proceeds to the step 1906 and the method 1900 concludes. Returning to the method 1300 of Fig. 13, following the generation of the displacement map d, for the cyan color channel at step 1304, the following steps of the 25 method 1300 may use the displacement map d, to generate a warp map wc for the cyan -43 color channel. The warp map wC maps each codel in the cyan color channel of the barcode 200 to a location in the coordinate space of the scanned image of the barcode 200. Some parts of the warp map wc may map codels in the barcode 200 to coordinates outside the scanned image, since the scanner 119 may not have scanned the entire barcode 5 200. If (x, y) are the coordinates of a pixel in the reference image, then the displacement map d(x, y) represents the shift to a corresponding location in the coarsely-aligned image. Therefore, the corresponding coordinates in the coarsely-aligned image may be determined as (x, y)T + d(x, y). Applying the coarse alignment affine transform to the 10 reference image provides the coordinates in the scanned image. The warp map wc maps each codel (x, y, c) in the cyan color channel of the barcode 200 to a location in the coordinate space of the scanned image of the barcode 200 in accordance with Formula (16) as follows: 15 wc (x, y) = A((x, y) T + d(x, y)) + a (16) However, the displacement map d(x, y) is only defined at a few places, namely the locations of the centres of some correlation tiles (e.g., 1603 and 1604). In order to determine a value for Formula (16) at the locations of all codels in the cyan color channel 20 of the barcode 200, the displacement map dc is interpolated. The method 1300 continues at the next step 1305, where the processor 105 determines an affine transform defined by a matrix G and vector g. The affine transform determined at step 1305 may be referred to as a gross approximation affine transform. The gross approximation affine transform approximates the warp map w, with an affine - 44 transform. The error function to be minimized in determining the affine transform is the Euclidean norm measure E that may be defined according to Formula (17) as follows: E= G +g -wc(x, Y) 2 (17) (x,y) Formula (17) may be solved using least squares minimisation methods to determine the 5 affine transform in accordance with Formula (18) as follows: ( )(XT(X) (G I g)= LwcX y) y yL y (18) (xIy) , x'y) 1 For both Formulae (17) and (18), the sums are taken over all coordinate pairs (x, y) where 10 the displacement map d,(x, y) is defined, and hence the warp map w,(x, y) is defined, via Formula (16). At the next step 1306 of the method 1300, the processor 105 removes the gross approximation affine transform from the warp map wc to generate a modified warp map in accordance with Formula (19) as follows: 15 we'(x, y)= wc(x, y) - G(x, y) - g (19) where the modified warp map w ' is defined at coordinates (x, y) at which dc(x, y) is defined. Thus, the modified warp map we' is defined at some points (x, y) that lie on the grid formed by the centres of the correlation tiles (e.g., 1603, 1604). The method 1300 continues at the next step 1307, where the processor 105 20 interpolates the modified warp map we', so that the modified warp map wc' is defined at all codel coordinates (x, y, c) in the barcode 200. A method 2000 of interpolating a mapping, as executed at step 1307, will be described in detail below with reference to Fig. 20.
-45 At the next step 1308, the processor 105 then reapplies the previously removed gross approximation affine transform to the modified warp map wc' to generate the warp map wC in accordance with Formula (20) as follows: w(x, y) = w,'(x, y)+ G(x, y)T + g (20) 5 The warp map for the cyan color channel is now defined at all codels in the barcode 200 and may be denoted Wcya,. The warp map wcya for the cyan color channel may be used to determine the warp maps for the magenta wmag,,ta and yellow wyelow color channels of the scanned image of the barcode 200. At the next step 1309, the processor 105 sets the value of the variable c to magenta 10 such that c becomes the current color channel. In the following execution of step 1309, the processor 105 sets the value of c to yellow, as will be described below. The method 1300 continues at the next step 1310, where the processor 105 generates a coarsely aligned image for the current color channel c (i.e., magenta in the first execution of step 1309). The coarsely-aligned image may be generated from the scanned image using the 15 warp map for the cyan channel wcyan The size of the coarsely-aligned image is the same as the dimensions of the barcode 200. In generating the coarsely-aligned image for the current color channel c, the processor 105 performs a color conversion, which extracts the color channel c from the RGB colors in the scanned image. A linear transform from the RGB space may be used to perform the color 20 conversion at step 1310. The magenta or yellow components for the coarsely-aligned images may be generated from the red, green, and blue components in accordance with Formulae (21) and (22) as follows: magenta = 0.79 x red - 1.51 x green + 0.13 x blue (21) 25 yellow = -0.20 x red + 1.24 x green - 1.58 x blue (22) - 46 A method 2900 of generating a coarsely-aligned image, as executed at step 1310, will now be described with reference to Fig. 29. The method 2900 may be implemented as software resident on the hard disk drive 110 and being controlled in its execution by 5 the processor 105. In the method 2900, the processor 105 generates each pixel value in the coarsely-aligned image for the current color channel c. The method 2900 begins at step 2901, where the processor 105 selects a first pixel in the coarsely-aligned image. At the next step 2902, the processor 105 transforms the coordinates of the selected pixel in the coarsely-aligned image (x, y) using the warp map 10 for the cyan channel, wcyan, to generate the coordinates wcyan(x, y) of a corresponding pixel in the scanned image. At the next step 2903, the pixel at the coordinates (x,y) of the scanned image determined at step 2901 is then interpolated, using bicubic interpolation, resulting in a vector of RGB image values. Then at the next step 2905, these RGB values determined at step 2903 are converted to a pixel value for the current color channel c, 15 using Formula (21), or (22), depending on the current color component being determined. At the next step 2907, the pixel value for the current color channel c is stored in the coarsely aligned image in memory 106. Then at step 2909, if the processor 105 determines that there are more pixels in the coarsely aligned image to be generated for the current color channel c, the method 2900 returns to step 2901 to select a next pixel in the 20 coarsely-aligned image. Otherwise, the method 2900 concludes. The method 1300 continues at the next step 1311, where the processor 105 generates a reference image for the current color channel c. The reference image is generated at step 1311, in accordance with the method 1500 described above. The method 1300 continues at the next step 1312, where the processor 105 uses the 25 coarsely-aligned image and the reference image to generate a displacement map d, for the - 47 current color channel c. The displacement map dc is generated for the current color channel c in accordance with the method 1700 described above. In determining the displacement map d, for the current color channel c the following values for tile size Q and step size P may be used, Q = 32 and P = 32, for each of the color channels. These 5 values for Q and P represent a tile of sixty-four (64) pixels high by sixty-four (64) pixels wide, stepped along the reference image and the coarsely-aligned image, in both horizontal and vertical directions, in thirty two (32) pixel increments. Alternatively different values of Q and P may be selected for each of the magenta and yellow color channels. 10 The method 1300 continues at the next step 1313, where the processor 105 interpolates the displacement map d, for the current color channel c to determine a displacement map which is defined at every codel in the barcode 200. The partially defined displacement map d, is interpolated in accordance with the method 2000, which will be described in detail below with reference to Fig. 20. At the next step 1314, the 15 processor 105 determines the warp map wc for the current color channels c. The warp map wC for the current color channel c is equal to the composition of the displacement map dc and the warp map wcyan for the cyan color channel. A method 3000 of determining a warp map wc for the current color channel, as executed at step 1314, will now be described in detail below with reference to Fig. 30. 20 The method 3000 begins at step 3001, where the processor 105 selects a first codel (x, y, c) in the color channel c of the barcode 200. At the next step 3002, the processor 105 determines the coordinates (xi, yi) for -the currently selected codel in accordance with Formula (23) as follows: (xi, y) = (x, y) + d,(x, y) (23) 25 The codel i may be referred to as the current codel. Then at the next step 3003, the -48 processor 105 transforms the coordinates (xi, y) of the current codel using the cyan warp map wcyan to determine the value of wcyan(Xi, yi). However, the values of xi and yj are not integers in general. Therefore, the warp map for the cyan color channel wcyan is interpolated at step 3003. The interpolation may be performed using a low-resolution 5 mapping mL generated in accordance with the method 2000 when interpolating the cyan warp map wcyan The low-resolution mapping mL may be interpolated at (xi, y) using bicubic interpolation. Then, the gross approximation affine transform is added to the low resolution mapping mL(X;, y;) in accordance with Formula (24) as follows: Wcyan (Xi, Y) - ML(xi, y 1 ) + G(xi, y) + g (24) 10 Following the addition of the gross approximation affine transform to the low-resolution mapping mL(X;, y 1 ) at step 3003, at the next step 3005, the value of wyan(xi, y 1 ) is stored in the warp map we configured within memory 106 at wc(x, y). At the next step 3007, if the processor 105 determines that the warp map w, for the current color channel c is defined at all codels in the barcode 200, then the method 3000 concludes. Otherwise, the 15 method 3000 returns to step 3001 to select a next codel in the barcode 200. At the next step 1315 of the method 1300, if the processor 105 determines that warp maps have been determined for each color channel of the barcode 200, then the method 1300 concludes concluding the fine alignment. Otherwise, the method 1300 returns to step 1309. 20 6.1 Map Interpolation The method 2000 of interpolating a mapping, as executed at step 1307 in relation to the modified warp map we', and as executed at step 1313 in relation to the displacement map dC, will be described in detail below with reference to Fig. 20. The method 2000 may be implemented as software resident in the hard disk drive 110 and being controlled 25 in its execution by the processor 105.
- 49 The method 2000 uses a mapping m defined at the centre of one or more correlation tiles (e.g., 1603 and 1604). The mapping m is either the modified warp map w'e as determined at step 1306, or the displacement map de as determined at step 1312. The mapping m is interpolated in accordance with the method 2000 to be defined at 5 coordinates (x, y) for all codels (x, y, c) in the barcode 200. The method 2000 begins at step 2002 where the processor 105 generates a low resolution mapping mL within memory 106 and initializes the values of the mapping mL. At step 2002, the mapping mL is defined at coordinates (x, y) where m is defined, and is assigned the same values as m at those points. Thus, the mapping mL is defined at some 10 of the points at the centres of correlation tiles. The centres of the correlation tiles form a grid with a spacing equal to the tile step size, P. A set of points referred to as "gridpoints" may be defined. The gridpoints comprise the points that are the centres of correlation tiles, and additionally include other points which are not at the centre of a correlation tile. These other points may be obtained by 15 extending the regular grid formed by the tile centres. Gridpoints may be defined as those points (x, y) in the extended grid whose coordinates lie in the range as follows: -2P < x < W + 2P (25) -2P < y < H + 2P (26) With gridpoints defined as above, the coordinates of the gridpoints may be determined in 20 accordance with Formula (27) as follows: (x, y) = (Q + XP, Q + YP) (27) where X and Y are integers, and X and Y lie in the following ranges: - -1 j x s_- +1 (28) -Q_1] s FH-Q +1 (29) - 50 The value of points in the mapping mL at each of the gridpoints (x, y) may be determined in accordance with steps 2003 to 2007 described below. The mapping mL was defined where m is defined in step 2002. At step 2003, the method 2000 begins a loop (i.e., defined by steps 2003 to 2006) that determines the remaining values of the 5 mapping mL. At step 2003, if the processor 105 determines that the mapping mL has been defined at all gridpoints (x, y) then the method 2000 continues at the next step 2007. Otherwise, the method 2000 proceeds to step 2004. At step 2004, the processor 105 determines the coordinates of all undefined gridpoints that are adjacent to (i.e., neighbour) defined gridpoints. Then at step 2005, the processor 105 determines values for each of 10 the gridpoints found in step 2004. The value for adjacent gridpoints is set to the average of the values of the low resolution mapping mL at adjacent defined gridpoints. Then at the next step 2006, the values determined at step 2005 are stored in the low resolution mapping mL configured within memory 106. The method 2000 then returns to step 2003. As described above, at step 2003, if the processor 105 determines that the low 15 resolution mapping mL has been defined at all gridpoints (x, y) then the method 2000 continues at the next step 2007. At step 2007, the low resolution mapping mL has been determined at all gridpoints, and may be used to interpolate the mapping m. At step 2007, the mapping m is interpolated at all codel coordinates (x, y, c) using bi-cubic interpolation on the mapping mL. 20 6.2 Peak detection The method 2100 of determining the location (Ax, Ay) of a highest peak in the correlation image T,, to sub-pixel accuracy, as executed at step 1705, will now be described with reference to Fig. 21. The location (Ax, Ay) of the highest peak in the correlation image Tx represents the shift between the two tiles T, and T 2 being correlated.
-51 The method 2100 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 2100 analyses the correlation image Tx and determines the location (Ax, Ay) of the highest peak in the correlation image T. to sub-pixel accuracy. The 5 method 2100 selects an initial peak height threshold Hi and a peak height ratio H,. The initial peak height threshold Hi and the peak height ratio H, parameters may be varied. Increasing the initial peak height threshold Hi decreases the number of peaks considered acceptable. Decreasing the peak height ratio H, increases the speed of execution of the method 2100 and also increases the chance that a wrong peak will be selection as the 10 highest peak. The initial peak height threshold Hi and the peak height ratio H, parameters may be set to Hi = 0.1 and H,= 4. The method 2100 begins at step 2102, where the processor 105 determines all "peaks" in the correlation image T,. A "peak" is a pixel in the correlation image T, with coordinates (xO, yo), whose pixel value T,(xo, yo) is larger than the values of eight 15 neighbouring pixels of the pixel. This means that pixels on the edges of the correlation image TX may be regarded as having eight neighbours, since the correlation image T, uses periodic boundary conditions. Pixels on the left edge may be regarded as adjacent to the corresponding pixels on the right edge, and similarly the pixels on the top edge may be regarded as adjacent to the corresponding pixels on the bottom edge. The peaks in the 20 correlation image TX may be stored in a list configured within memory 106. The peaks may be stored in the list in decreasing order of peak pixel value. Each peak in the peak list has integer coordinates (xO, yo). These coordinates (xO, yo) provide a good first approximation to the shift between the reference and coarsely-aligned images. However, to obtain sub-pixel accurate coordinates (Ax, Ay) for - 52 the location of the highest peak, the correlation image T, is interpolated in the vicinity of each peak. The method 2100 processes each peak in the peak list, and interpolates the correlation image T, to determine the sub-pixel accurate peak location. Also at step 2102, a variable Ht is initialized to an initial value of the initial peak 5 height threshold Hi. At the next step 2103, the processor 105 iterates over all of the peaks in the peak list. On the first execution of step 2103, a first peak in the peak list is selected. On subsequent executions of step 2103 subsequent peaks in the peak list are selected. At step 2104, the value of the peak pixel T,(xo, yo) selected at step 2103 is analysed by the processor 105 to determine whether the peak pixel value T,(xo, yo) 10 multiplied by the peak height ratio H, is larger than the current peak height threshold Ht. That is, the processor 105 determines whether: T.(xo, yo) x H, > H, (30) If the peak pixel value T,(xo, yo) multiplied by the peak height ratio H, is larger than the current peak height threshold Ht, then the method 2100 proceeds to step 2105. 15 Otherwise, the method 2100 concludes. At step 2105, the processor 105 selects a sub region, h, of the correlation image T,. The sub-region, h, has width and height of 2Z pixels, where Z = 8. The sub-region h is also centred at the coordinates (xo, yo) of the peak selected at step 2103. The value of the sub-region, h, may be determined in accordance with Formula (31) as follows: 20 h(x, y) = T,(x +x Z,yO + y - Z) (31) for x and y in the range 0 to 2Z - 1, where the values of the correlation image Tx outside the image are obtained by again applying periodic boundary conditions to the correlation image TX. That is, the values of the correlation image TX outside the image are obtained by making the correlation image periodic. At step 2105, the selected sub-region, h, is -53 then transformed with the Fast Fourier Transform (FFT) to determine a transformed image h^. The transformed image, h^, is then used at the next step 2106, where the processor 105 interpolates the correlation image T, in the vicinity of the peak (xO, yo) to determine 5 an approximation (x,, y 1 ) of the location of the peak. The correlation image T" may be interpolated at twenty-five (25) points, where x and y coordinates may be determined as follows: x e {x 0 - 0.5, xO - 0.25, xO + 0, x0 + 0.
2 5 , x 0 + 0.5} y E {y 0 - 0.5, yo - 0.25, yo + 0, yo + 0.
2 5 , yo + 0.5 } 10 The interpolation performed at step 2106 is Fourier interpolation and is executed using Formula (32) as follows: C(xo +bx,yo+ by)=h(Z + bx,Z+by) z z (32) h (k,n)pk(Z+xpn(Z+by) k=-Z n=-Z where 0 is defined as follows: einTkx/Z if ke±Z (33) S jeinkx/Z ifk= ±Z 15 A better approximation to the peak location may be found using the value of (xj, y,) at which the interpolated value Tx(x , yj) is largest. At the next step 2107, the processor 105 determines a sub-pixel accurate estimate of the location (x 2 , Y 2 ) of the selected peak. The interpolated correlation image Tx may be approximated by a bi-parabolic function, f, in a region close to (x,, yj). A bi-parabolic 20 function f has a form in accordance with Formula (34) as follows: f(x, y) = a x 2 +aixy + a 2 y 2 +a 3 x+a 4 y +a 5 (34) The coefficients (aO, a1, ..., a 5 ) that make f(x - x , y - yj) approximately equal to the interpolated image T,(x, y) when x and y are close to x, and y,, respectively, may be - 54 determined in order to determine the sub-pixel accurate estimate of the location of the selected peak. Equivalently, the function f(x, y) may be approximated to T,(x + x , y + y) when x and y are small. The coefficients (a5, a 1 ,..., a) may be determined in accordance with Formula (36) below in order to minimize E in accordance 5 with Formula (35) as follows: E= f25 1125 'y)-Tx(x,+x,y,+y)) 2 dxdy (35) aZ Z a32 = h(k,n)expO7jn(kxh +nyh )k,n (6 k=-Zn=-Z a 4 where xh = xI - x 0 + Z and yh = y 1 - yo + Z, and where the Vk,n are constant vectors. The 10 constant vectors vkl may be determined in accordance with a method 3100, which will now be described with reference to Fig. 31. The method 3100 of determining the constant vectors vkn as executed at step 2107 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. 15 The method 3100 begins at step 3101, where the processor 105 determines the matrix V defined in accordance with Formula (37) as follows: X 2 \ 2 T XY xY -0.125 0 125 2 2 -0.125 -0.125 x x Y Y Each element in the matrix V is the integral of a polynomial in x and y, and may be determined analytically. Then at the next step 3103, the processor 105 determines the 20 values of the constant vectors vkfl in accordance with the Formula (38) as follows: - 55 xy v = 1 V_. .
1 2 5
.
12 5 p ( Y 2x dy (38) k,n (2Z) 2 0.125 0.125 x Y Each element in the constant vectors vkn is the integral of an exponential in x and y multiplied by a polynomial in x and y, and may be evaluated analytically. The method 3100 concludes after step 3103. 5 The sub-pixel accurate peak location (x 2 , Y 2 ) may be set to the position of the maximum value of the bi-parabolic function f. The sub-pixel accurate peak location (x 2 , Y 2 ) may be determined in accordance with Formula (39) as follows: C x 2 1 (2a 2 a 3 -aia 4 (39) Y2 Yi) a 4aa2 2a 0 a 4 -ala 3 ) The height of the selected peak, H, in the interpolated correlation image Tx is also 10 determined at step 2107 in accordance with Formula (40) as follows: H = f(x 2 - X 1 , Y 2 - y) (40) The method 2100 continues at the next step 2108, where the processor 105 determines whether the height of the selected peak, H, at the location (x 2 , y 2 ) determined at step 2107 is the largest peak determined in a current execution of the method 2100. If 15 the height of the selected peak, H, at the location (x 2 , Y 2 ) is larger than the current peak height threshold H, then the location (x 2 , Y 2 ) represents the location of the highest peak found in the current execution of the method 2100. In this instance, the current peak height threshold Ht is assigned a new value of the selected peak H, and the sub-pixel accurate coordinates (Ax, Ay) representing the location of the highest peak in the 20 correlation image TX is assigned the value of the location (x 2 , y 2 ) determined at step 2107. Otherwise, if the height of the selected peak H is not larger than the current peak height -56 threshold Ht, no highest peak location was found in the current iteration of the loop defined by steps 2103 to 2108. The method 2100 continues at the next step 2109, where if the processor 105 determines that there are more peaks in the peak list, then the method 2100 returns to step 5 2103. Otherwise, the method 2100 concludes. During the execution of the method 2100, no highest peak may be found. For example, if at every execution of step 2108 the height of the selected peak, H, at the location (x 2 , Y 2 ) is not larger than the current peak height threshold Ht then the sub-pixel accurate coordinates (Ax, Ay) will not be set to any given values. However, if step 2108 10 did find a highest peak, then the values of the sub-pixel accurate coordinates (Ax, Ay) represent the location of the highest peak. 7.0 Color Models As described above, at step 506, the processor 105 generates color models that predict how printed colors appear in the scanned barcode image. At step 506 the 15 processor 105 analyses the scanned image of the barcode 200 in order to determine a color model. The color model described here describes how the printed colors appear in the scanned image of the barcode 200. Barcodes contain cyan, magenta, and yellow codels, which are encoded on a page by the presence or absence of cyan, magenta, and yellow inks (or toners) respectively. 20 Since the inks used in printers can differ considerably, the colors in the barcode 200 printed on different printers may also vary. Furthermore, the color of the barcode 200 depends on other factors apart from ink characteristics. For example, the characteristics of the scanner 119, the type of paper, whether the printed barcode 200 was left sitting around in the sun, and other environmental factors, may affect the color of the barcode 25 200. For these reasons, the color of cyan ink, when represented in an RGB color space in -57 the scanned image of the barcode 200 may vary. Similarly, the color of magenta and yellow inks may also vary for the barcode 200. There are further complications, arising from the fact that cyan, magenta, and yellow inks are printed on top of each other. The combination of two or more inks results 5 in red, green, blue, or black, depending on the combination of primary colors. For example, a cyan codel which is "on" (i.e., in which ink has been printed) may appear cyan, but the codel may also appear blue, green, or black depending on whether magenta and yellow inks were also present. The appearance of magenta and yellow codels varies similarly. 10 A color model is described below which allows the data encoded in codels (e.g., the codels 203 of the barcode 200) to be recovered. The color model may be determined by sampling the colors of codels in the alignment pattern and the border 201 of the barcode 200. Since the state of these codels is known in advance, the typical color of the codels may be determined. Thus, the colors of known codels may be used to build a model that 15 allows the state of unknown codels to be determined. 7.1 Color model parameters Three color models may be determined, one for each of the cyan, magenta, and yellow inks. Consider the color model for color channel c, where c is one of cyan, magenta, or yellow. Codels of color channel c that are "on" are likely to be one of four 20 colors, depending on the presence or absence of the other two color inks. When RGB values of codels where color channel c is "on" are plotted in RGB color space, the RGB values may be modelled by a planar surface. Similarly, the codels where color channel c is "off' are likely to be one of four colors, depending on the presence or absence of the two other color inks. When the RGB values of codels where color channel c is "off' are 25 plotted in RGB color space, the RGB values of the codels also may be modelled by a planar surface.
- 58 For each codel (x, y, c), let the vector x(x, y, c) = s(w,(x, y)). The vector x(x, y, c) represents the RGB value of the interpolated scanned image at the location of the codel (x, y, c). The parameters of the color model for color c are as follows: (i) no and n,: ni represents the normal vector for the plane that best fits the RGB 5 values of codels where color c is in state i, where i = 1 means "on", and i = 0 means "off'; (ii) bj, for i = 0, 1 and j = 0, 1: b represents the mean value of x(x, y, c) - n over all codels (x, y, c) in color channel c that are in state i; and (iii) v , for i = 0, 1 and j = 0, 1: V represents the variance of x(x, y, c) -n over all codels (x, y, c) in color channel c that are in state i. 10 In the following sections, x - n denotes the dot product of the vectors x and nj. 7.2 Determining a color model A method 3200 of determining the parameters for the color model for the color channel c, will now be described with reference to Fig. 32. The method 3200 may be implemented as software resident on the hard disk drive 110 and being controlled in its 15 execution by the processor 105. The method 3200 begins at step 3201, where the processor 105 determines the vectors ni. The vectors ni may be determined by determining the matrix M in accordance with Formula (41) below, where M represents the number of alignment codels and border codels of the color channel c whose state is i. 20 M = x(x, y, c) x(x, y, c)T - x(x, y, c) x(x, y, C(41) (x,yxc) sxly"!c ) (x 1y-c) The sums of Formula (41) range over all codels (x, y, c) in color channel c that is in state i. The matrix M is positive definite, so all eigenvalues of the matrix M are positive and real. The vector ni may be set to the eigenvector of M that has the smallest eigenvalue. At the next step 3203, the values of b and v are determined for each i and j. The values -59 of bij and vii may be determined by determining the values of x(x, y, c) - nj for all codels (x, y, c) in color channel c that are in state i, given i and j, and then determining the mean and variance of the determined values of x(x, y, c) - n for all codels (x, y, c). 7.3 Using the color model 5 Once the color model for a color channel c has been determined in accordance with the method 3200, the color model may be used to determine whether a codel of color channel c is "on" or "off', based on the RGB pixel value of the scanned image at the codel location. A likelihood ratio X for the codel may also be determined. The likelihood ratio X for the codel represents the probability that the codel is "on" divided by the 10 probability that the codel is "off'. The likelihood ratio X for the codel (x, y, c) may be determined in accordance with Formula (42) as follows: x(x,y,c)-n1 -b, C x(x,y,c).no -bo (42) x(x,y,c)-n, -bo, g( x(x,y,c)-no -boo where g(t) = exp(- t 2 / 2). 7.4 Incorporating deconvolution into the color model 15 An alternative color model will now be described. The alternative color model may be determined by incorporating a deconvolution into the likelihood ratio . Deconvolution may reduce the effects of blurring in the scanned image of the barcode 200. As described above, blurring may be introduced in either the printing or scanning of the barcode 200. When using deconvolution, the likelihood ratio X for a codel (x, y, c) 20 depends not only on the RGB pixel value x(x, y, c) = s(wc(x, y)) of the scanned image at the codel location, but also on the RGB pixel values of the scanned image at adjacent codels. For example, Fig. 22 shows a codel 2201 and adjacent (i.e., neighbouring) codels (e.g., codels 2202 and 2203). A six-element vector y(x, y, c) may be defined as follows for the codel 2201. The first three elements of the vector y(x, y, c) represent the sum of -60 the RGB pixel values of the four neighbouring codels (e.g., codel 2202) of the codel 2201. The codel 2202 is one of four neighboring codels of the codel 2201. The first three elements of the vector y(x, y, c) are as follows: s(wc(x - 1, y)) + s(wc(x + 1, y)) + s(w,(x, y - 1)) + s(wc(x, y + 1)) (43) 5 The last three elements of the vector y(x, y, c) are the sum of the RGB pixel values of the four diagonally neighbouring codels. The codel 2203 is one of the four diagonally neighbouring codels. The last three elements of the vector y(x, y, c) may be determined as follows: s(w(x - 1, y - 1) + s(w(x + 1, y - 1)) + s(w(x - 1, y + 1)) + s(w(x + 1, y +1)) 10 (44) In the alternative color model, the likelihood ratio X for the codel at coordinates (x, y, c) depends on the vector x(x, y, c) and the vector y(x, y, c). The parameters of the alternative color model are as follows: (i) po and p,: pi represents a vector of deconvolution weights for codels of 15 color c in state i, where i = 1 means "on", and i = 0 means "off"; (ii) no and n,: n, represents the normal vector for the plane that best fits the RGB values of codels where color c is in state i, where i = 1 means "on", and i = 0 means "'off" (iii) bi , for i = 0, 1 and j = 0, 1: bij represents the mean value of 20 x(x, y, c)- ni + y(x, y, c) - p over all codels (x, y, c) in color channel c that are in state i; and (iv) vij, for i = 0, 1 and j = 0, 1: V is the variance of x(x, y, c) -nj + y(x, y, c)- pj over all codels (x, y, c) in color channel c that are in state i. A method 3300 of determining the parameters for the alternative color model for 25 the color channel c, will now be described with reference to Fig. 33. The method 3300 - 61 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 3300 begins at step 3301, where the processor 105 determines the vectors ni. The parameters (i) to (iv) directly above may be determined by determining 5 the matrices M, B, C, D and E, in accordance with Formulae (45), (46), (47), (48) and (49), below, where M represents the number of alignment codels and border codels of the color channel c whose state is i for the scanned image of the barcode 200.. M = x(x , c) x(x, y, c)T - x(xy, c) E x(xy, c) (45) (x~yc) sx'y'c) n(xIy-c) B= jy(x,y,c)x(x,y,c) -y yyc Exxyc) (6 (x'y-c) s(x-Y-C) x(xY-C) 10 C = I y(x, y,c)y(x,y,c) - V y(x,y, c) Iy(x,yc) (47) (x'y'c) (x'y-c) (x-y-c) D= C 1 B (48) E=M -BTD (49) where the sums range over all codels (x, y, c) of color channel c that are in state i for the scanned image of the barcode 200. The matrix E is positive definite, so all the 15 eigenvalues of the matrix E are positive and real. The vector n, may be set to the eigenvectors of E that has a smallest eigenvalue. The vector pi may be set to the value of the matrix D multiplied by the vector ni. At the next step 3303, the values of b and v are determined for each i and j. The values of bi and vj may be determined by determining the values of x(x, y, c) - n for all 20 codels (x, y, c) in color channel c that are in state i, given i and j, and then determining the mean and variance of the determined values of x(x, y, c) - nj + y(x, y, c) - p for all codels (x, y, c).
- 62 In the alternative color model, the likelihood ratio X of the codel (x, y, c) may be determined in accordance with Formula (50) as follows: (x(,y,c)-n,+y(x,y,c)-pj -bli x(x,y,c)-no, y(x,y,c)-pO--bl() A _ _(_ _ IN _(50) (x(,yxc)-n + yxc)-p, -bo, (x(,y,c)-n,) y(x,y,c)-p(,-bo() where g(t) = exp(- t 2 / 2). 5 8.0 Data encoding and decoding As described above, at step 405 of the method 400, the processor 105 accesses data, encodes the data, and arranges the data in the barcode 200. As also described above, the processor 105 uses the fine alignment warp maps and the color models to extract data from the barcode 200 and decode the extracted data. 10 The data is binary data to be stored in the barcode 200. The data may be pre processed to ensure that the data has a random appearance before the data is stored in the barcode 200. The pre-processed data may be obtained by compressing the data. Any suitable compression algorithm may be used to compress the data. For example, the Lempel-Ziv compression method or bzip2 compression method may be used to compress 15 the data. The data may be compressed before storing the compressed data in the barcode 200, and decompressed after extraction from the barcode 200. Alternatively, the pre-processed data may be obtained by XORing the data with a pseudo-random sequence of binary data. In this instance, when the data is extracted from the barcode 200, the data is again XORed with the pseudo-random sequence of binary 20 data, resulting in the original data. Further, the data may be encrypted. For example, either symmetric key methods (e.g., the Data Encryption Standard (DES), or blowfish), or public key methods (e.g., RSA encryption) may be used to encrypt the data.
-63 Error-correction coding may be applied to the pre-processed data, so that imperfections in the printing and scanning of the barcode 200 do not result in corruption of the data stored in the barcode 200. In this instance, low density parity check (LDPC) coding may be used to apply error-correction coding to the pre-processed data. The 5 publication "Low-density parity-check codes", IRE Transactions on Information Theory, Vol. 8, January 1962, describes one error-correction coding method which may be applied to the pre-processed data. Alternatively, other error-correction coding methods may also be applied to the pre-processed data. For example, Reed-Solomon (RS) coding or Turbo codes may be applied to the pre-processed data. 10 Low density parity check (LDPC) coding is a block coding scheme, in which the pre-processed data is first divided into blocks of length K bits, and each block is encoded to produce encoded blocks of length N bits, where N and K are parameters of the particular LDPC code in use. If the length of the pre-processed data is not a multiple of K bits, the pre-processed data may be padded with arbitrary data to make the length a 15 multiple of K bits. Given the dimensions of the barcode 200, the number of encoded blocks that can be stored in the barcode 200 may be determined. The number of encoded blocks may be determined in accordance with Formula (51). as follows: 9(W -2BXH -2B) (51) 4N J 20 Formula (51) represents the barcode width W less twice the border width, multiplied by the barcode height less twice the border width, multiplied by nine (9), divided by the product of four (4) and the encoded block length N, rounded down to the nearest integer. The dimensions of the barcode 200 in which the data is to be stored are selected such that the number of blocks that can be stored is greater than the number of error 25 corrected blocks. If the length of the pre-processed data is such that the number of error- -64 corrected blocks is less than the number of blocks that can be stored, the pre-processed data may be padded with arbitrary data until the number of error-corrected blocks is equal to the number of blocks that can be stored. As such, given the dimensions of the barcode 200, the number of blocks that have been stored may be determined when reading the 5 barcode 200. The barcode dimensions are determined as described above with reference to step 502. 8.1 Embedding data in a barcode The method 2300 of encoding data and arranging the encoded data in the barcode 200, as executed at step 405 of the method 400, will now be described with reference to 10 Fig. 4. The method 2300 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 2300 accesses the data to be stored in the barcode 200, and encodes codels into the barcode 200. The data may be accessed from memory 105, for example. The method 2300 begins at step 2302, where the processor 105 iterates through blocks of 15 the data. On the first execution of step 2302, a first K bits of the data are selected for processing. On subsequent executions of step 2302, the following K bits of the data are selected. At the next step 2303, the processor 105 performs error correction encoding of the K bits of data selected in step 2302. Step 2303 produces N bits of encoded data. Then at 20 the next step 2304, the processor 105 stores the N bits of encoded data in the codels (e.g., 203) of the barcode 200. Each bit in the encoded data is stored in one data codel in the barcode 200. At step 2304, the N bits of encoded data are mapped to data codels in the barcode 200. A mapping 4 may be defined to map encoded data bits to data codels, based on an 25 ordering idea. An ordering of the encoded data bits may be referred to as a "bit-wise order". In bit-wise ordering, all of the first bits of all blocks come before all the second - 65 bits of all blocks, which come before all the third bits of all blocks, and so on. Within all of the encoded data bits in the same position in their blocks, the bits from the first block come before the bits from the second block, which come before the bits from the third block, and so on. This defines an order in which to consider the encoded data bits. 5 An ordering of the data codels of the barcode 200 may be referred to as "scanline order". In scanline ordering, the data codels in the cyan color plane come before the data codels in the magenta color plane, which come before the data codels in the yellow color plane. Within each color plane, the codels in the top row come before the codels in the second row, which come before the codels in the third row, and so on. Within each row, 10 the data codels are ordered from left to right. This defines an order in which to consider the data codels. In the mapping , between encoded data bits and data codels, the first data bit (i.e., using the bit-wise ordering) is mapped to the first data codel (i.e., using the scanline ordering). The second data bit is mapped to the second data codel and so on. The value 15 of each encoded bit may be stored in the codel that the encoded bit maps to under '. Once the encoded data for each bit in the current block of N encoded data bits has been stored in the data codels of the barcode 200, at the next step 2305, if the processor 105 determines that there are more blocks of data to be processed, the method 2300 returns to step 2302. Otherwise, the method 2300 concludes. 20 Some data codels (e.g., 206) may not have been mapped to by an encoded data bit. These data codels will not have been assigned a value. Values may be assigned at random to these data codels that were not mapped to in order to ensure that all data codels in the barcode 200 have been assigned a value. For example, values from the random array % may be assigned to the data codels that were not mapped to. 25 8.2 Extracting data from a barcode -66 The method 2400 of extracting data from the barcode 200 and decoding the extracted data, as executed at step 507, will now be described with reference to Fig. 24. The method 2400 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 2400 extracts the data 5 from the data codels (e.g., 203) of the barcode 200. The method 2400 begins at step 2402, where the processor 105 iterates through blocks of the encoded data. On a first execution of step 2402, the first block of data is selected for processing. On subsequent executions of step 2402, the following blocks are selected. The number of blocks that are iterated through is equal to a maximum number 10 of blocks that may be stored in the barcode 200 in accordance with the dimensions determined for the barcode 200, as described above. At the next step 2403, for each bit of encoded data for a current block, the processor 105 determines pixel values from the scanned image of the barcode 200 at the centres of the codels in which data for the current block is stored. A method 3400 of determining pixel values from the scanned image of 15 the barcode, as executed at step 2403, will be described in detail below with reference to Fig. 34. The method 3400 may be implemented as software resident in the hard disk drive 110 and being controlled in its execution by the processor 105. The method 3400 begins at step 3403, where the processor 105 uses the mapping ' to determine the codel of the 20 barcode 200 in which the bit is stored. The codel coordinates may be represented as (x, y, c). The method 3400 continues at the next step 3405, where the processor 105 analyses the warp map for the color channel of the codel determined at step 3403, to determine the coordinates we (x, y) of the centre of that codel in the scanned image of the barcode 200. 25 Then at the next step 3407, the processor 105 interpolates the scanned image at the coordinates we (x, y), to determine an RGB pixel value s(we (x, y)) for the current data - 67 bit. If the color model being used in the method 3400 includes deconvolution, the pixel values from the scanned image at the centres of the neighbouring codels to the codel determined at step 3403 are also determined. The method 2400 continues at the next step 2404, where the processor 105 uses the 5 pixel value(s) determined at step 2403, and the color model generated in step 506 of the method 500, to determine likelihood values X for the N bits in the encoded block, in accordance with Formula (43) or Formula (51) above. Then at the next step 2405, the processor 105 performs error-correction decoding, using the N likelihood values X determined at step 2404 to determine K corrected bits. The method 2400 continues at the 10 next step 2406, where the processor 105 stores the corrected K bits in memory 106. At the next step 2407, if the processor 105 determines that there are more blocks of data to be processed, then the method 2400 returns to step 2402. Otherwise, the method 2400 concludes. The aforementioned preferred method(s) comprise a particular control flow. There 15 are many other variants of the preferred method(s) which use different control flows without departing the spirit or scope of the invention. Furthermore one or more of the steps of the preferred method(s) may be performed in parallel rather sequentially. The foregoing describes only some embodiments of the present invention, and modifications and/or changes can be made thereto without departing from the scope and 20 spirit of the invention, the embodiments being illustrative and not restrictive. For example, as described above the codels (e.g., 203) of the barcode 200 are printed in cyan, magenta, and yellow colored inks. However, any suitable colored ink may be used to print the codels of the barcode 200. Further, a different number of different colored inks may be used to print the codels of the barcode 200. Monochrome barcodes may also be 25 generated by using only codels printed with black ink.
-68 As described above, the codels (e.g., 203, 207) are square regions, arranged in a rectangular array. Non-square codels may also be generated. For example, the codels of the barcode 200 may be rectangular in shape. The interpolation of the scanned image using bi-cubic interpolation at steps 1203, 5 1302, 1402, and 2403 may be alternatively performed using any suitable interpolation. For example, bi-linear interpolation may be used at steps 1203, 1302, 1402, and 2403. The interpolation of the mapping in accordance with the method 2000 using bi cubic interpolation may alternatively be executed using any suitable interpolation method. For example, bi-linear interpolation may be used to interpolate the mapping in the method 10 2000. As described above, the color conversion from RGB to cyan, magenta, and yellow in steps 1302 and 1402 is performed using Formulae (15), (21), and (22). However, any suitable color conversion method may be used in the described methods. For example, different linear conversions may be performed by modifying the constants in Formulae 15 (15), (21), and (22). In the method 1300, the warp maps for the three color channels are determined by first producing a coarsely-aligned image using an approximation to an actual warp map, and then tiled correlations are performed to produce a more accurate warp map. In the cyan channel, the coarsely-aligned image may be generated using the coarse-alignment 20 affine transform. In the magenta and yellow channels, the coarsely-aligned image may be generated using the cyan warp map. However, other arrangements are possible. For example, the coarse-alignment affine transform may be used to generate the coarsely aligned images for the magenta and yellow channels. In another example, the cyan warp map may be determined using two stages of tiled correlations, where the warp map 25 resulting from the first tiled correlations may be used to generate the coarsely-aligned image that is used for the second tiled correlations. Determining the cyan warp map - 69 using two stages of tiled correlations may generate a more accurate warp map for the cyan channel. Additional stages of tiled correlations may be more accurate still. Additional stages of tiled correlations may also be used for the magenta and yellow color channels. Further, the peak detection step 1705 uses Fourier interpolation and a bi-parabolic 5 fit to estimate the location of a peak to sub-pixel accuracy. However, any suitable peak finding method may be used in the described methods. For example, a chirp-z transform may be used to interpolate the correlation image at a large number of points, and the point with the largest value may be taken as the peak location. In the context of this specification, the word "comprising" means "including 10 principally but not necessarily solely" or "having" or "including", and not "consisting only of'. Variations of the word "comprising", such as "comprise" and "comprises" have correspondingly varied meanings.

Claims (6)

1. A method of generating a barcode representing one or more portions of data, said method comprising the steps of: 5 generating groups of coding elements, each of which has an alignment coding elements and data coding elements, wherein the alignment coding element and each of the data coding elements are a same size; and arranging the groups of coding elements according to a correlatable alignment pattern to generate the barcode so that row and coordinates of the alignment coding 10 elements are both even.
2. A method according to claim 1, wherein the correlatable alignment pattern is generated based on a correlation image I,, according to the following formula: 15 l.(x, y)= li(x',y')2(x'+x, y'+y) where I, and 12 represent images from which said correlation image is generated, x and x' represent column coordinates and y and y' represent row coordinates. 20 3. A method according to claim 1, wherein the groups of coding elements are distributed within an interior region of the barcode. 25 71
4. A method according to claim 1, wherein each group of coding elements has data coding elements of a different color 5
5. A method according to claim 1, wherein the barcode comprises one or more independent barcodes, each independent barcode being of a particular one of the color channels. 10 6. An apparatus for generating a barcode representing one or more portions of data, said apparatus comprising: pattern generation means for generating groups of coding elements, each of which has an alignment coding element and data coding elements, wherein the alignment coding element and each of the data coding elements are a same size; and 15 data pattern arranging means for arranging the groups of coding elements according to a correlatable alignment pattern to generate the barcode so that row and coordinates of the alignment coding elements are both even.
7. A computer readable storage medium having recorded thereon a computer program 20 for generating a barcode representing one or more portions of data, said program comprising: code for generating groups of coding elements, each of which has an alignment coding element and data coding elements, wherein the alignment coding element and each of the data coding elements are a same size; and 25 code for arranging the groups of coding elements according to a correlatable alignment pattern to generate the barcode so that row and coordinates of the alignment 72 coding elements are both even.8. A method of generating a barcode representing one or more portions of data, said method being substantially as herein before described with reference to any one of the embodiments as that embodiment is shown in the accompanying drawings. 5
9. An apparatus for generating a barcode representing one or more portions of data, said apparatus being substantially as herein before described with reference to any one of the embodiments as that embodiment is shown in the accompanying drawings. 10 10. A computer program for generating a barcode representing one or more portions of data, said program being substantially as herein before described with reference to any one of the embodiments as that embodiment is shown in the accompanying drawings. 15 DATED this the Twenty Eighth Day of July 2009 CANON KABUSHIKI KAISHA Patent Attorneys for the Applicant SPRUSON&FERGUSON
AU2004242416A 2004-12-21 2004-12-21 Printed Data Storage and Retrieval Ceased AU2004242416B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
AU2004242416A AU2004242416B2 (en) 2004-12-21 2004-12-21 Printed Data Storage and Retrieval
US11/305,897 US20060157574A1 (en) 2004-12-21 2005-12-19 Printed data storage and retrieval

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
AU2004242416A AU2004242416B2 (en) 2004-12-21 2004-12-21 Printed Data Storage and Retrieval

Publications (2)

Publication Number Publication Date
AU2004242416A1 AU2004242416A1 (en) 2006-07-06
AU2004242416B2 true AU2004242416B2 (en) 2009-09-03

Family

ID=36660015

Family Applications (1)

Application Number Title Priority Date Filing Date
AU2004242416A Ceased AU2004242416B2 (en) 2004-12-21 2004-12-21 Printed Data Storage and Retrieval

Country Status (1)

Country Link
AU (1) AU2004242416B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6742708B2 (en) * 2001-06-07 2004-06-01 Hewlett-Packard Development Company, L.P. Fiducial mark patterns for graphical bar codes
US6948068B2 (en) * 2000-08-15 2005-09-20 Spectra Systems Corporation Method and apparatus for reading digital watermarks with a hand-held reader device
US7028902B2 (en) * 2002-10-03 2006-04-18 Hewlett-Packard Development Company, L.P. Barcode having enhanced visual quality and systems and methods thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6948068B2 (en) * 2000-08-15 2005-09-20 Spectra Systems Corporation Method and apparatus for reading digital watermarks with a hand-held reader device
US6742708B2 (en) * 2001-06-07 2004-06-01 Hewlett-Packard Development Company, L.P. Fiducial mark patterns for graphical bar codes
US7028902B2 (en) * 2002-10-03 2006-04-18 Hewlett-Packard Development Company, L.P. Barcode having enhanced visual quality and systems and methods thereof

Also Published As

Publication number Publication date
AU2004242416A1 (en) 2006-07-06

Similar Documents

Publication Publication Date Title
US20060157574A1 (en) Printed data storage and retrieval
US8736908B2 (en) Printing and authentication of a security document on a substrate utilizing unique substrate properties
US7711140B2 (en) Secure recorded documents
US7142689B2 (en) Image processing apparatus for determining specific images
JP4218920B2 (en) Image processing apparatus, image processing method, and storage medium
EP1456812B1 (en) Generating graphical codes by halftoning with embedded graphical encoding
KR101159330B1 (en) System and method for encoding high density geometric symbol set
EP1011064B1 (en) Image pattern detection method and apparatus
US5754697A (en) Selective document image data compression technique
EP2102815B1 (en) Method of sharpening using panchromatic pixels
EP0777197A2 (en) Method for embedding digital information in an image
KR101737338B1 (en) System and method for clean document reconstruction from annotated document images
US20010055390A1 (en) Image processor and image processing method
EP2016529A2 (en) Detecting compositing in a previously conpressed image
US6993148B1 (en) Image processing apparatus and method, and storage medium
US20080260200A1 (en) Image Processing Method and Image Processing Device
AU2005209703B2 (en) Grid orientation, scale, translation and modulation estimation
Zhang et al. Document image shadow removal guided by color-aware background
AU2004242416B2 (en) Printed Data Storage and Retrieval
AU2007237274A1 (en) Method for selecting best barcode settings
JP2001313814A (en) Image processor, image-processing method and storage medium
Kise et al. Backgrounds as information carriers for printed documents
JP2001119558A (en) Image processor and method and storage medium
Shaked et al. A visually significant two dimensional barcode
AU2004242417A1 (en) Tamper detection and correction of documents using error correcting codes

Legal Events

Date Code Title Description
FGA Letters patent sealed or granted (standard patent)
MK14 Patent ceased section 143(a) (annual fees not paid) or expired