AU2007254663A1 - Efficient shuffling - Google Patents

Efficient shuffling Download PDF

Info

Publication number
AU2007254663A1
AU2007254663A1 AU2007254663A AU2007254663A AU2007254663A1 AU 2007254663 A1 AU2007254663 A1 AU 2007254663A1 AU 2007254663 A AU2007254663 A AU 2007254663A AU 2007254663 A AU2007254663 A AU 2007254663A AU 2007254663 A1 AU2007254663 A1 AU 2007254663A1
Authority
AU
Australia
Prior art keywords
barcode
codels
codel
pages
array
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.)
Abandoned
Application number
AU2007254663A
Inventor
Thomas Renard Djunaedi
Paul Joseph Ellis
Stephen Farrah
Filip VELICKOVSKI
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 AU2007254663A priority Critical patent/AU2007254663A1/en
Publication of AU2007254663A1 publication Critical patent/AU2007254663A1/en
Abandoned legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1491Methods for optical code recognition the method including quality enhancement steps the method including a reconstruction step, e.g. stitching two pieces of bar code together to derive the full bar code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/10861Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices sensing of data fields affixed to objects or articles, e.g. coded labels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/1093Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices sensing, after transfer of the image of the data-field to an intermediate store, e.g. storage with cathode ray tube

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Editing Of Facsimile Originals (AREA)

Description

S&F Ref: 834365 AUSTRALIA PATENTS ACT 1990 COMPLETE SPECIFICATION FOR A STANDARD PATENT Name and Address Canon Kabushiki Kaisha, of 30-2, Shimomaruko 3 of Applicant: chome, Ohta-ku, Tokyo, 146, Japan Actual Inventor(s): Thomas Renard Djunaedi, Paul Joseph Ellis, Filip Velickovski, Stephen Farrar Address for Service: Spruson & Ferguson St Martins Tower Level 35 31 Market Street Sydney NSW 2000 (CCN 3710000177) Invention Title: Efficient shuffling The following statement is a full description of this invention, including the best method of performing it known to me/us: 5845c(1073922_1) EFFICIENT SHUFFLING Cross-reference to Related Patent Applications Australian Patent Application No. 2004242416, filed 21 December, 2004 in the name of Canon Kabushiki Kaisha and entitled "Printed Data Storage and Retrieval" is incorporated by reference herein in its entirety, as if fully set forth herein, and shall be 5 referred to as IR-I. United States Patent Application No. 11/305,897 (Publication No. 20060157574), filed 19 December, 2005 in the names of Stephen Farrar et al. and assigned to Canon Kabushiki Kaisha and entitled "Printed Data Storage and Retrieval" is incorporated by reference herein in its entirety, as if fully set forth herein, and shall be referred to as t0 IR-2. Field of the Invention The present invention relates generally to barcodes and, in particular, to a method of determining dimensions of barcodes, wherein the method is resistant to global distortions, local distortions and noise. The present invention also relates to a method for estimating is the likelihood that a given barcode pixel is in a particular state. The present invention further relates to rapid permutation or shuffling of large arrays of elements in a paged memory environment. Background Barcodes in various shapes and forms are commonplace and are widely used to 20 encode computer readable information on printed materials. Traditionally, the term barcode refers to a series of machine readable marks in the form of bars which are printed in parallel and adjacent to each other. 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 25 that they can store, since the data density of one-dimensional barcodes is low and one-dimensional barcodes are usually of a fixed size. In order to improve 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 -2 formation. Each of these regions is typically coloured (e.g., either black or white). The colour of each region conveys one bit of information. Herein, the term barcode will generally be used to refer to a two-dimensional barcode of the format described above. The process of printing a one-dimensional or two-dimensional barcode can introduce 5 distortions into the barcode. When a barcode is printed using an electro-photographic engine, such as a laser printer, the types of distortions that can be introduced into the barcode may include warping. Warping causes straight lines to be printed as wavy lines. These 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 10 printed barcode. Colour channel mis-registration can also be introduced into a printed barcode. Colour channel mis-registration may occur where cyan, magenta, yellow and black channels, for example, of the printed barcode are not correctly aligned. Furthermore, barcodes can also be deformed due to normal handling of the physical media on which they are printed. For example, it is expected that paper-based media could 15 be folded or crumpled. Such treatments can result in barcodes that are warped, smudged or have several of data elements erased. This may occur, for example, at the crease of a folded paper. During the decoding process, typically it is necessary first to determine accurately the dimensions of such barcodes to allow the subsequent decoding steps to decode correctly 20 the information contained in said barcodes. The method commonly employed by some known barcode formats is to include a reference pattern known as the "clocking pattern" within the barcode or along the perimeters of the barcode. This clocking pattern is typically comprised of regular arrangements of barcode elements with machine readable contrasting optical properties. 25 Since the clocking pattern is arranged regularly, dimensions of the barcode can be ascertained by counting the number of transitions between the contrasting optical properties. However, a significant drawback of such methods is that they require barcode elements that are of relatively large size to allow transitions between contrasting optical properties to be detected correctly, limiting the achievable data density. Furthermore, such 30 techniques are particularly prone to warping which causes the clock detection algorithm to lose track of the clocking pattern because the pattern is displaced. Another disadvantage of -3 the clock counting technique is its lack of robustness. Due to deformations such as those described above, it is conceivable that certain data elements in the barcode could be damaged. If the damage occurs to members of the clocking pattern, then it is highly unlikely that the barcode dimensions can be accurately recovered. 5 Finder patterns are also present in most two-dimensional barcode formats to indicate the presence, location, and orientation of a barcode. Finder patterns are special patterns, including concentric circles, concentric squares, intersecting solid lines and spirals with special properties, to allow the patterns to be located to a high degree of accuracy. Another known method of determining the dimensions of a barcode containing said 10 finder pattern(s) is first to encode the barcode dimensions in a machine-readable format and then place the encoded information in close proximity to said finder pattern(s) in the barcode. Decoding barcodes of this format firstly requires the finder pattern(s) to be located, followed by a step in which the encoded dimensions are retrieved and decoded. Once the barcode dimensions are known, normal decoding of the barcode can be 15 performed. Since encoded dimension information is located close to the finder pattern(s), this method is more tolerant to warping than the clocking pattern method, as the effect of warping over a small distance from the finder pattern(s) is often negligible. However, such barcodes are still particularly vulnerable to damage due to deformations in the area where the encoded dimension information is located. 20 Thus, a need exists to provide a method to determine barcode dimension which is resistant to global distortions, local distortions and noise. Another need exists to provide an empirical method of estimating the desired likelihood values. A further need exists to provide a method that is both efficient in a paged memory 25 environment and reasonably unbiased.
-4 Summary According to a first aspect of the present disclosure, there is provided a method of determining dimensions of a barcode containing a correlatable alignment pattern, the method including the steps of: 5 estimating at least one initial barcode dimension; generating at least one correction value through correlation of the correlatable alignment pattern with the barcode; and refining the initial barcode dimension using the generated correction values to generate final barcode dimensions. 10 According to a second aspect of the present disclosure, there is provided a method of estimating a likelihood that a barcode codel is "on", the method including the steps of: creating a mapping of a number of known "on" codels as a function of a corresponding observed pixel and neighbouring pixel values; creating a mapping of a number of known "off' codels as a function of a 15 corresponding observed pixel and neighbouring pixel values; and calculating a likelihood value using the numbers of known "on" and "off' codels in the region of the mappings corresponding to the respective "on" and "off' codels. According to a third aspect of the present disclosure, there is provided a method of permuting an ordered set, the method including the steps of: 20 dividing the set into pages of a given size; arranging the pages as a compact array of two or more dimensions and a one-dimensional array of remainder pages; for each array dimension successively, shuffle the elements of the sets formed by grouping pages differing only in array location with respect to the given dimension; and 25 shuffling the remainder pages into the compact array. According to another aspect of the present disclosure, there is provided an apparatus for implementing any one of the aforementioned methods. According to another aspect of the present disclosure, there is provided a computer program product including a computer readable medium having recorded thereon a 30 computer program for implementing any one of the methods described above. Other aspects of the present disclosure are also disclosed. 1 I n ID M.QIA- 1 -5 Brief Description of the Drawings One or more embodiments of the invention will now be described with reference to the following drawings, in which: Fig. I is a schematic flow diagram illustrating the method of determining the 5 dimension of a barcode as a further extension of the method of Fig. 26 of IR-1; Fig. 2 is a diagram illustrating the reference image tile used in the method of Fig. 1; Fig. 3 is a diagram illustrating the coarsely aligned image tile used in the method 1 o of Fig. 4; Fig. 4 is a schematic flow diagram describing the correlation operation performed in the method of Fig. 1; Fig. 5 is a schematic flow diagram describing the peak detection operation performed in the method of Fig. 4; is Fig. 6 is a schematic flow diagram describing the dimension determination operation performed in the method of Fig. 1; Fig. 7 is a schematic flow diagram illustrating a method of mapping a barcode codel to an (i, j) colour model index, as executed in the methods of Figs 8 and 9, below; 20 Fig. 8 is a schematic flow diagram illustrating a method of generating an empirical colour model, as executed in the method of FIG. 7; Fig. 9 is a schematic flow diagram illustrating a method of using the empirical colour model to calculate a likelihood value, as executed in the method of FIG. 7; 25 Fig. 10 is a schematic flow diagram illustrating a method of modifying an empirical colour model by integration; Fig. 11 is a flow chart diagram illustrating generally the mains steps of the shuffling method according to one embodiment of the present disclosure; Fig. 12 is a flow chart diagram illustrating a factorizing method that can be used to 30 perform step 1120 of Fig. 11; -6 Fig. 13 is a flow chart diagram illustrating an implementation of the Knuth-shuffle method of shuffling a list of elements; Fig. 14 illustrates the forming and shuffling of the multidimensional array of pages in accordance to the method outlined in Fig. 13 in one embodiment of the 5 present disclosure; Fig. 15 illustrates an application of an embodiment of the present disclosure in conjunction with 2 dimensional barcodes in accordance to one embodiment of the present disclosure; Fig. 16 is a flow chart diagram outlining the main steps to encoding a barcode such 1o as 1510 and 1530 of Fig. 15; and Fig. 17 is a flow chart diagram outlining the main steps to decoding a barcode such as 1510 and 1530 of Fig. 15. Fig. 18 is a schematic block diagram of a general purpose computer upon which arrangements described can be practised. is Detailed Description Where reference is made in any one or more of the accompanying drawings to steps and/or features that 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. 20 Computer Implementation System for generating and reading barcodes The methods described herein may be practised using a general-purpose computer system 1800, such as that shown in Fig. 18, wherein the processes of Figs I to 17 may be implemented as software, such as one or more application programs executable within the 25 computer system 1800. In particular, the steps of the described methods may be effected by instructions in the software that are carried out within the computer system 1800. 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 and the corresponding code modules perform the described methods and a second part 30 and the corresponding code modules manage a user interface between the first part and the -7 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 system 1800 from the computer readable medium, and then executed by the computer system 1800. A computer readable medium having such software or computer program 5 recorded on it is a computer program product. The use of the computer program product in the computer system 180 preferably effects an advantageous apparatus for implementing the described methods. As seen in Fig. 18, the computer system 1800 is formed by a computer module 1801, input devices such as a keyboard 1802, a mouse pointer device 1803 and a scanner 1819, 10 and output devices including a printer 1815, a display device 1814 and loudspeakers 1817. The printer 1815 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 1819 may be in the form of a flatbed scanner, for example, which may be used to scan a barcode in order to generate a scanned image of the barcode. The scanner 1819 may be configured is within the chassis of a multi-function printer. An external Modulator-Demodulator (Modem) transceiver device 1816 may be used by the computer module 1801 for communicating to and from a communications network 1820, for example, via a connection 1821 The network 1820 may be a wide-area network (WAN), such as the Internet or a private WAN. When the connection 1821 is a 20 telephone line, the modem 1816 may be a traditional "dial-up" modem. Alternatively, where the connection 1821 is a high capacity (e.g., cable) connection, the modem 1816 may be a broadband modem. A wireless modem may also be used for wireless connection to the network 1820. The modem 1816 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 25 (WAN), and may be incorporated into the computer module 1801 in some implementations. In one implementation, the printer 1815 and/or scanner 1819 may be connected to the computer module 1801 via such communication networks. The computer module 1801 typically includes at least one processor unit 1805, and a memory unit 1806, for example formed from semiconductor random access memory 30 (RAM) and read only memory (ROM). The module 1801 also includes a number of input/output (1/0) interfaces including an audio-video interface 1807 that couples to the -8 video display 1814 and loudspeakers 1817, an 1/0 interface 1813 for the keyboard 1802 and mouse 1803 and optionally a joystick (not illustrated), and an interface 1808 for the external modem 1816, printer 1815 and scanner 1819. In some implementations, the modem 1816 may be incorporated within the computer module 1801, for example within s the interface 1808. The computer module 1801 also has a local network interface 1811 which, via a connection 1823, permits coupling of the computer system 1800 to a local computer network 1822, known as a Local Area Network (LAN). As also illustrated, the local network 1822 may also couple to the wide network 1820 via a connection 1824, which would typically include a so-called "firewall" device or similar functionality. The 1o interface 1811 may be formed by an Ethernet circuit card, a wireless BluetoothTM or an IEEE 802.11 wireless arrangement. The interfaces 1808 and 1813 may afford both serial and parallel connectivity, the former typically being implemented according to the Universal Serial Bus (USB) standards and having corresponding USB connectors (not illustrated). Storage devices 1809 are 15 provided and typically include a hard disk drive (HDD) 1810. Other devices such as a floppy disk drive and a magnetic tape drive (not illustrated) may also be used. An optical disk drive 1812 is typically provided to act as a non-volatile source of data. Portable memory devices, such optical disks (e.g., CD-ROM, DVD), USB-RAM, and floppy disks for example may then be used as appropriate sources of data to the system 1800. 20 The components 1805 to 1813 of the computer module 1801 typically communicate via an interconnected bus 1804 and in a manner that results in a conventional mode of operation of the computer system 1800 known to those in the relevant art. Examples of computers on which the described arrangements can be practised include IBM-PCs and compatibles, Sun Sparcstations, or alike computer systems evolved therefrom. 25 Typically, the application programs discussed above are resident on the hard disk drive 1810 and read and controlled in its execution by the processor 1805. Intermediate storage of such programs and any data fetched from the networks 1820 and 1822 may be accomplished using the semiconductor memory 1806, possibly in concert with the hard disk drive 1810. In some instances, the application programs may be supplied to the user 30 encoded on one or more CD-ROMs and read via the corresponding drive 1812, or alternatively may be read by the user from the networks 1820 or 1822. Still further, the -9 software can also be loaded into the computer system 1800 from other computer readable media. Computer readable media refers to any storage medium that participates in providing instructions and/or data to the computer system 1800 for execution and/or processing. Examples of such media include floppy disks, magnetic tape, CD-ROM, a 5 hard disk drive, a ROM or integrated circuit, a magneto-optical disk, or a computer readable card such as a PCMCIA card and the like, whether or not such devices are internal or external of the computer module 1801. Examples of computer readable transmission media that may also participate in the provision of instructions and/or data include radio or infra-red transmission channels as well as a network connection to another computer or 10 networked device, and the Internet or Intranets including e-mail transmissions and information recorded on Websites and the like. The second part of the application programs and the corresponding code modules mentioned above may be executed to implement one or more graphical user interfaces (GUIs) to be rendered or otherwise represented upon the display 1814. Through i5 manipulation of the keyboard 1802 and the mouse 1803, a user of the computer system 1800 and the application may manipulate the interface to provide controlling commands and/or input to the applications associated with the GUI(s). The methods described below may alternatively be implemented in dedicated hardware such as one or more integrated circuits performing the functions or sub functions 20 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 1806 or hard disk drive 1810 of the computer module 1801, for example. Similarly, the data to be read from a barcode 25 may also be stored in the hard disk drive 1810 or memory 1806 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 1810 and being controlled in its execution by the processor 1805. The data read from a barcode may also be processed by such an application program. I - 1DXMQ 1A f -10 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 1815, 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 5 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 to 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, 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. is The codels of a barcode may also all be printed using the same color ink (e.g., black 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 20 the cyan, magenta, and yellow inks). In this instance, the total number of codels 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 25 appreciate that any suitable codel resolution may be used to generate the barcodes described here. Dimension Finding Although the method described as process 2600 in IR-1, with reference to Fig. 26 of IR-1, is fairly reliable in determining the dimensions of a barcode, the robustness of that 30 process to the warping effect is limited to 0.5B, where B is the width of the border region. Specifically, the process is only robust to warping if the barcode region is stretched or - 11 shrunk by less than 0.5B, since in this case the rounding operations in steps 2605 and 2607 of process 2600 still return the correct dimensions. However, it has been observed that particularly severe warping, especially in large barcodes, could exceed the 0.5B tolerance value. To address this limitation, an improvement to the dimension finding process in s method 2600 has been developed and is described with in method 1000 of Fig. 1. Disclosed herein is a method of determining dimensions of a barcode containing a correlatable alignment pattern. The method includes the step of estimating at least one initial barcode dimension and then generating at least one correction value through correlation of the correlatable alignment pattern with the barcode. The method then refines 10 the initial barcode dimension using the generated correction values to generate final barcode dimensions. The method 1000 of Fig. 1 will now be described with reference to the general purpose computer of Fig. 18, the barcode 200 of Fig. 2 of IR-1, and Fig. 9 of IR-1, which relates to a method of determining a coarse alignment affine transform. Is The method 1000 starts at a Start step and proceeds to step 1001, in which the processor 1805 generates an initial coarse alignment affine transform. The coarse alignment affine transform is comprised of a matrix A and a vector a, calculated using the operation described in step 905 of process 900 of IR-1, based on the initial width Wini, and height Hiit generated by process 2600 of Fig. 26 of IR-1. At a next step 1002, a set P 20 comprising of starting codel positions p with the coordinate (xp, yp, c) is populated. In the current embodiment, xp and yp represent the column and row positions of the code, respectively, while c represents the colour channel (e.g., cyan, magenta, yellow, or black). The coordinate components x, and yp are determined relative to an origin (0, 0) located at the top left corner of the barcode 200 of Fig. 2 of IR-1. Since all operations in the method 25 1000 are performed on codels in one particular colour channel, the colour channel component c is a constant and shall herein be omitted. In one embodiment, the particular colour channel is predefined. In an alternate embodiment, the particular colour channel is predetermined, depending on the particular application. Although there are numerous strategies that could be employed to select the starting 30 codel positions, for the purpose of describing an embodiment of the present disclosure, the set P is comprised of codels located on a diagonal line between (0, 0) and (Winit -1, Hinit -1) -12 in equally sized steps. The step size between each chosen codels in the set P is determined empirically and represents a compromise between accuracy and processing time. It can be appreciated that smaller step sizes yield higher accuracy, while requiring a longer amount of time to process and vice versa. Alternatively, codel positions can be selected from the 5 diagonal line between (0, 0) and (Winit -1, Hi 1 it -1) in exponentially increasing steps. Another alternative method selects two starting codels to determine independently the horizontal and vertical dimensions of a barcode. In this method, the set P comprises two codels from the vicinity of the coordinates (Wini, -1, 0) and (0, Hinit -1), which will be used to determine the horizontal and vertical dimensions respectively. These two 10 coordinates are of special importance, because the presence of finder patterns allows their positions to be determined accurately. Subsequently, the positions of these coordinate points imply that displacement errors due to warping relative to the origin are maximised along one coordinate axis and minimised along the other. In the case of the codel p in the vicinity of the coordinate (Winit -1, 0), displacement error would be maximised along the is horizontal axis while the error is minimised along the vertical axis and vice versa for the codel in the vicinity of (0, Hinit -1). Then, by correcting the displacement errors at these two locations, the true barcode dimensions are able to be determined. However, for barcodes with particularly severe warping this method might not be able to yield usable peaks in step 1005 (described below), which will prevent the barcode dimensions to be 20 determined. In this case, a fallback method employing an alternative method for selecting the codels p in the set P could be implemented. At step 1003, a starting codel position p from the set P is selected. In one embodiment of the present disclosure, p is selected in order of increasing distance from the origin (0, 0), with the closest codel selected in the first iteration. In this method, 25 displacement error due to warping relative to the origin generally increases with increasing distance away from the origin. Therefore, processing codels in order of increasing distances from the origin improves the likelihood for peaks to be detected in step 1005, which is described below. At a next step 1004, a coarsely-aligned image tile Tc 3000 of Fig. 3 and a reference 30 image tile Tr 2000 of Fig. 2 are generated in memory 1806, starting from the codel position p selected in 1003. The size of the reference image tile 2000 in Fig. 2 may be defined - 13 arbitrarily, considering the fact that a larger tile size gives more measurement precision, at the expense of averaging the increased precision over a larger spatial area, and possibly more processing time. In one implementation, a square tile where the dimension of each side is 64 codels is selected. 5 For the purpose of describing an embodiment of the present disclosure, a reference image tile of Hr (2001) codels high and Wr (2002) codels wide is used. Each codel r in the tile 2000 may be defined by the coordinate (x,, yr), where the value of xr ranges from 0 to Wr - 1 and the value of yr ranges from 0 to Hr - 1. In essence, the tile 2000 is a rectangular subsection of the barcode 200 of Fig. 2 of IR-1, bounded by the four points 1o described by 2003, 2004, 2005 and 2006 with the coordinates (xp, yp), (x, + Wr - 1, yp), (xp + Wr - 1, y, + Hr - 1) and (xp, y, + Hr - 1), respectively. Subsequently, all the alignment codels 2007 within the reference image tile 2000 are populated in a similar manner to the generation of the alignment pattern at step 404 of the method 400 of Fig. 4 of IR-1. All non alignment codels in the reference image tile are treated as blank codels 2008 and are is assigned the value 0. The process of generating the coarsely aligned image tile 3000 will now be explained with reference to Fig. 3. The coarsely aligned image tile 3000 is defined as a rectangular tile of the barcode 200 of IR-1, with dimensions Hc (3001) and Wc (3002) defined with relation to Hr (2001) and Wr (2002) according to the following formula: 20 Hc= Hr + 2Hd Wc =Wr + 2Wd In the above formula, Hd (3007) and Wd (3008) are defined respectively as half the height and width of the displacement map which will be described in step 1005 below. In one embodiment of the present disclosure, the value of Hd and Wd is 8. Each codel c in the 25 coarsely aligned image tile 3000 is defined by the coordinate (xe, ye), where the value of xc ranges from 0 to Wc - I and the value of yc ranges from 0 to Hc - 1. The tile 3000 is therefore bounded by the four points 3003, 3004, 3005 and 3006 with the coordinates (xp -Wd, yp-Hd), (xp +Wr+ Wd- 1, yp-Hd), (xp+Wr+ Wd- 1, yp+Hr+Hd- 1) and (x, - Wd, yp + Hr + Hd - 1), respectively. It should now become apparent that the codel 30 position p (3009) selected in step 1003 is located at offset (Wd, Hd) within the coarsely aligned image tile 3000. Each of the codels c defined by (xe, ye) in the coarsely aligned -14 image tile is subsequently populated with the value of the pixel at (u, v) in the scanned image according to the following formula: ()=Axx )+ a Returning to Fig. 1, the method 1000 continues with step 1005, in which a 5 displacement vector dpeak of the highest correlation peak with components (Xpcak, peak) is determined by correlating the coarsely aligned image tile 3000 with the reference image tile 2000. Although frequency domain correlation techniques similar to method 1700 of Fig. 17 could be used, this example utilises spatial domain correlation techniques for step 1005, due to the higher tolerance to noise of the spatial domain correlation techniques. The io operation performed in determining the peak displacement position using spatial correlation techniques will be described in more detail below with respect to method 4000 of Fig. 4. In the process described by method 4000 of Fig. 4, it is possible that a valid peak is not detected at all. Such an occurrence is possible if warping of the barcode is particularly is severe, so that the peak lies outside the search area defined by the tile of size (2Wd + 1) by (2Hd +1) centred at p. Another possibility is that the barcode has sustained extensive damage in the immediate area surrounding p, preventing a correlation peak from being detected. When a peak is not found, there exist at least two techniques to recover from a failure of this type. The first is simply to ignore the result from the current position p, and 20 repeat method 1000 starting at step 1003 with a different starting coordinate p. The second technique is to repeat the method 1000 starting from step 1002 and choosing a different set of starting codel positions in the set P. Following step 1005, the method 1000 continues with step 1006, in which the coarse alignment affine transform matrix A is refined using the peak displacement vector dpeak 25 obtained in step 1005. The peak displacement vector dpeak signifies the displacement due to warping or other deformations between the assumed position of the coarsely aligned image tile 3000 and its actual position within the barcode 200 of Fig. 2 of IR-1. In order to correct the discrepancy, the refined affine transform matrix A' is calculated in step 1006 according to the following formula: - 15 A'= [a'00 a' 01 1 [a' 10 a' I ao=+XPa 00 a' 1 0 = + XPk xa 1 o a'tI= 1+ eak xa,, At a following step 1007, the processor 1805 performs a check as to whether all members of the set P have been processed through steps 1003 to 1006 to produce the final refined coarse alignment affine transform matrix A'. If all members of the set P have been 5 processed and no more refinement steps are required, No, the method continues with step 1008, otherwise more refinement steps are required, Yes, and control returns to step 1003 such that steps 1003 to 1006 are repeated for each of the remaining unprocessed members of the set P. In step 1008 of method 1000, true dimensions of the barcode 200 are determined. 10 The method of determining the true dimensions will be explained in further detail below with reference to a method 6000 of Fig. 6, wherein the method 6000 is based on the refined coarse alignment affine transform matrix A'. The method 1000 then concludes. The method 4000 will now be described in detail with reference to Fig. 4. The method 4000 begins at step 4001, in which the processor 1805 generates a displacement 15 map in memory 1806 as a tile with dimensions of (2Wd + 1) wide and (2Hd + 1) high. Each member d of the displacement map is defined with a coordinate (Xd, yd), where the value of xd ranges from (-Wd) to Wd and the value of yd ranges from (-Hd) to Hd. Members of the displacement map may also be initialised to zero as an extension to step 4001. Method 4000 continues with step 4002, in which a member d with coordinate 20 (xd, yd) is selected from the displacement map. In a next step 4003, spatial correlation is calculated between the reference image tile 2000 and a particular subset of the coarsely aligned image tile 3000 starting at offset (Wd + xd, Hd + yd). More specifically, each alignment codel r (x,, yr) in the reference image tile 2000 is correlated with the corresponding codel c (xe, ye) in the coarsely aligned 25 image tile 3000, where the mapping between r and c is defined as follow: -16 xe = Wd + Xd + X, ye = Hd + yd + yr It should be noted that the spatial correlation calculation should only be performed between members of the reference image tile 2000 which are alignment codels and the 5 corresponding codels in the coarsely aligned image tile 3000. While acknowledging the existence of other formulas for calculating spatial correlation, the formula used in one embodiment of the present disclosure is stated below: (v, )2_ (nlxiyi -,jx;iyj 2 n 2 xi - 2 n y yi )2 In the correlation formula above, xi represents the value of the alignment codel at to coordinate r, yj represents the value of the codel at coordinate c, while n represents the number of alignment codels within the tile 2000 and (v"y) 2 represents the correlation score between the two tiles. The correlation score obtained from step 4003 is then stored at step 4004 in the displacement map at the coordinate (Xd, yd). The method 4000 continues with step 4005, in which a decision is made whether correlation values have been calculated for is all members of the displacement map. If the displacement map is incomplete, No, control returns to step 4002 and method 4000 retraces steps 4002 to 4004 to complete the map. Otherwise, if it is determined in step 4005 that the displacement map is complete, Yes, method 4000 proceeds with step 4006, in which the displacement of the peak correlation value dpeak at coordinate peaka, peak) is determined according to method 5000 of Fig. 5, 20 which will be described in detail below. Method 4000 concludes after step 4006 is executed. The method 5000 of finding the peak displacement position dpeak will now be detailed with reference to Fig. 5. Method 5000 begins with step 5001, in which the processor 1805 sets in memory 106 a peak valid flag to "off' and a current peak correlation score variable 25 is set to 0. At a next step 5002, a position d at the coordinate (xd, yd) is selected from the displacement map. In a following step 5003, the correlation score (strength) at displacement position d is compared against a predetermined or predefined threshold value. The check against a threshold value is required to ensure that only potential peaks with scores that are significantly higher than the noise level are recognised. If the correlation - 17 score at displacement position d is greater than the threshold value, Yes, the method 5000 continues with step 5004, otherwise, No, control passes to step 5006. In step 5004, the correlation score at position d is compared against the correlation score of the previous highest peak in the current peak correlation score variable. If the current peak at d has a 5 greater correlation score, Yes, then method 5000 continues with step 5005, otherwise, No, control passes to step 5006. At step 5005, the peak valid flag is updated to the "on" value, the displacement position d is stored in the variable dpeak, and the correlation score of the peak at d replaces the previous value in the current peak correlation score variable. Step 5006 checks whether all displacement points in the displacement map has been checked for to potential peaks. If all points have been checked, Yes, the method 5000 continues with step 5007, otherwise, No, control passes to step 5002 and steps 5002 to 5006 are repeated with a different displacement position d. In step 5007, the peak valid flag is checked by the processor 1805. If the flag is "on", the displacement position dpeak is returned, otherwise an indication that a peak has not been located is returned. The method 5000 then concludes. is The method 6000 used in determining the true dimensions of the barcode 200 of Fig. 2 of IR-1 will now be described in detail with reference to Fig. 6. Method 6000 begins with step 6001, in which A'~', the inverse to the refined coarse alignment affine transform matrix A', is calculated. With the inverse matrix A'~', the corresponding codel coordinate (x, y) of a scanned pixel with coordinate (u, v) can be determined based on the following 20 inverse affine formula: = A'-'x - a At a next step 6002, the barcode dimensions are determined by firstly placing (uq3, vq3) the scanned pixel coordinate of the bottom right spiral 803 of Fig. 8 of IR-1 into the inverse affine formula to produce the corresponding codel coordinate (xq3, yq3). Since 25 the resulting codel coordinate is for the centre of the spiral 803, the coordinate components need to be adjusted by half the width of the border region to produce the barcode width W and height H in terms of codels according to the following: W = Xq3 + 0.5B H = Yq3 + 0.5B - 18 Finally in step 6003, the barcode dimensions W and H are rounded to the nearest multiple of the border width B to yield the true dimensions of the barcode 200. The method 6000 concludes following step 6003. Likelihood Estimation 5 Likelihood overview While modem computers have significantly enhanced the manner is which data is 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 10 the paper. However, computer readable information may also be printed on paper. One conventional method of printing computer readable information on paper is by 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 is that they can store, since the data density of one-dimensional barcodes is low and one-dimensional barcodes are usually of a fixed size. 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 20 formation. Each of these regions is typically coloured (e.g., either black or white). The colour of each region typically conveys one bit of information. However, even two-dimensional barcodes suffer from a number of problems. The process of printing a one-dimensional or two-dimensional barcode can introduce distortions into the barcode. The types of distortions introduced into the barcode may 25 include warping. As described above, warping causes straight lines to be printed as wavy lines. Noise can also be caused by splotches of ink or marks made on the printed barcode. Colour channel mis-registration can also be introduced into a printed barcode. Colour channel mis-registration may occur where cyan, magenta, yellow, and black channels, for example, of the printed barcode are not correctly aligned. 30 Furthermore, barcodes can also be damaged by handling of the physical media on which they are printed. For example, it is expected that paper based media could be folded - 19 or crumpled. Such treatment can result in barcodes that are warped, smudged, or have some data elements erased (e.g., at the crease of a folded paper). Another common distortion in barcodes is known as 'dot gain' or 'tone value increase' whereby regions of ink, or 'dots', appear larger or smaller than intended. This 5 effect often depends on the neighbourhood of the region, so that dots not in the vicinity of other dots may appear to be different from dots that are close to other dots. One method of reading a barcode image is by sampling the barcode at points on a grid formation. The samples can then be used to ascertain the colours of the regions of the barcode, and hence to decode the bits of information represented by the barcode. 10 The scanning and processing apparatus used to sample a barcode can introduce additional distortions, including blurring from limited optical resolution and electronic frequency response. These and other limitations in printing and sampling often result in a sampled barcode in which the colour value measured for a given region is affected by the colours of is neighbouring regions. This effect reduces the ability to distinguish the colour of the regions comprising the barcode and impairs the decoding process. In order to increase the robustness of the stored information, barcode systems often incorporate some means of error correction, such as Reed-Solomon codes, low-density parity-check (LDPC) codes or "turbo" codes. Reed-Solomon codes operate on a vector of 20 bits, some of which may be in error. In contrast, LDPC codes and turbo codes have greater error-correcting power. Each element of the vector upon which these latter codes operate is not a simple bit value, but rather the likelihood that the corresponding bit has a given value. One known method of estimating a likelihood value for a given set of barcode regions is to use a predefined mathematical model encapsulating some theoretical 25 understanding of the relationship between the scanned barcode region colours and the original printed region colours. In the case where some of the barcode regions have known printed colour, the parameters of such a model may be obtained using the known printed colour and the corresponding sampled colour of each such barcode region, together with the sampled colours of neighbouring barcode regions. Once such a mathematical model 30 has been obtained, the desired likelihoods may be obtained by applying the model with the scanned barcode region colours as input. IDXI.QIA If - 20 Likelihood method Disclosed herein is a method of estimating a likelihood that a barcode codel is "on". The method includes the steps of creating a mapping of a number of known "on" codels as a function of a corresponding observed pixel and neighbouring pixel values and creating a 5 mapping of a number of known "off' codels as a function of a corresponding observed pixel and neighbouring pixel values. The method then calculates a likelihood value using the numbers of known "on" and "off' codels in the region of said mappings corresponding to the respective "on" and "off' codels. Empirical colour model 1o As described in IR-i with reference to Figs 1, 2, and 5, at step 506 the processor 105 analyses the scanned image of the barcode 200 in order to determine colour models that describe how printed colours appear in the scanned barcode image. An 'empirical' colour model is described below which allows a likelihood to be assigned to each possible state for each codel (e.g., the codels 203 of the barcode 200 of is Fig. 2 of IR-1) and hence enables the data encoded in codels to be recovered. The colour model may be determined by sampling the colours of codels in the alignment pattern 205 and neighboring codels of the barcode 200. Since the state of the alignment codels is known in advance, the typical appearance of the codels may be determined. Thus, known codels may be used to build a model that allows the state of unknown codels to be 20 determined. As in the alternative colour model described previously, this colour model incorporates deconvolution into the likelihood calculation. 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, handling, scanning, or processing of the barcode 25 200. Using deconvolution, the assigned probabilities for a codel (x, y, c) depend not only on the pixel value of the sampled image at the codel location, but also on the pixel values of the sampled image at adjacent codels. For example, Fig. 22 of IR-i shows a codel 2201 and adjacent (i.e., neighbouring) codels (e.g., codels 2202 and 2203). The colour model described herein comprises two two-dimensional maps. One 30 coordinate of each map corresponds to the value of colour channel c at the codel and the other corresponds to an average of the values of colour channel c at neighbouring codels.
- 21 Each codel (x, y, c) of the barcode may thus be projected to a point in each map. The two maps comprising the colour model represent a count of known "on" and "off' codels, respectively. The required likelihood for a given codel (x, y, c) may be calculated from the number of known "off' and "on" pixels in the corresponding regions of the two maps. 5 For the purposes of the following description, let the "on" state of a codel be labelled state a and the "off' state be labelled state f. Mapping a code to an empirical colour model index A method 7000 of mapping a codel (x, y, c) to a pair of integers (i(x, y, c), j(x, y, c)), representing a location in a discrete two-dimensional map, will now be described with 1o reference to Fig. 22 of IR 1 and Fig. 7. For the purposes of the following discussion, for each codel (x. y, c), let the scalar x(x, y, c) represent the value of the interpolated monochrome scanned image at the location of the codel (x, y, c). Further, let xmin(c) and xma(c) define an interval containing the values of codels x(x, y, c) according to Formula (75) below: Is V (x, y, c) : Xmin(c) 5 x(x, y, c) < xmax(C) (75) Finally, let C and N represent two positive integers defining the dimensions of the two maps. In one example, C=32 and N=16. Given a codel (x, y, c), 2201, the method 7000 begins at step 7001, in which the processor 1805 obtains the scalar value x(x, y, c), representing the value of the interpolated 20 scanned image at the location of the codel (x, y, c). At step 7002, the integer value i(x, y, c) is calculated from x(x, y, c) according to Formula (76) below: i(x, y, c) = LC x (x(x, y, c) - xmin(c)) / (xmax(c) - xmin(c))] (76) At the following step 7003, the processor 1805 calculates a scalar value y(x, y, c) 25 representing the average of the pixel values of the four nearest neighbouring codels (e.g., codel 2202) of the codel 2201. y(x, y, c) may be calculated according to Formula (77) as follows: y(x, y, c) = (x(x-1, y, c)+ x(x, y+1, c)+ x(x+1, y, c)+ x(x, y-1, c)) / 4 (77) - 22 Finally, at step 7004 the processor 1805 calculates the integer value j(x, y, c) according to Formula (78): j(x, y, c) = [N x (y(x, y, c) - xmin(c)) / (Xmax(c) - xmin(c))] (78) Following step 7004, the method 7000 concludes. 5 Determinin g the empirical colour model A method 8000 of determining the parameters of the empirical colour model for the colour channel c, will now be described with reference to Fig. 8. The method 8000 begins at step 8001, in which the processor 1805 creates two CxN arrays, A and B, and initializes all elements of the arrays to 0. 10 At a next step 8002, the processor 1805 iterates over all of the codels in the barcode. On the first execution of step 8002, a first codel is selected. On subsequent executions of step 8002, subsequent codels are selected. At a next step 8003, the neighbourhood of the codel is mapped to a pair of integers (i(x, y, c), j(x, y, c)) according to the method 7000 of Fig. 7 described above. 15 At a next step 8004, if the processor determines that the current codel (x, y, c) is known to be in state a, Yes, then the method 8000 proceeds to step 8005. Otherwise, if the processor determines that the current codel (x, y, c) is not known to be in state a, No, the method 8000 proceeds to step 8006. At step 8005, the value of array A at the location calculated in step 8003 is 20 incremented according to Formula (79) below. A[i(x, y, c), j(x, y, c)] = Aji(x, y, c), j(x, y, c)] + 1 (79) Following this, step 8005 proceeds to step 8008. At step 8006, if the processor 1805 determines that the current codel (x, y, c) is known to be in state fl, Yes, then the method 8000 proceeds to step 8007. Otherwise, No, 25 the method 8000 proceeds to step 8008. At step 8007, the value of array B at the location calculated in step 8003 is incremented according to Formula (80) below. B[i(x, y, c), j(x, y, c)] = B[i(x, y, c), j(x, y, c)] + 1 (80) - 23 At the next step 8008, if the processor 1805 determines that there are more codels in the barcode to be processed, Yes, then the method 8000 returns to step 8002. Otherwise, No, the method 8000 concludes. Following the conclusion of method 8000, the array A contains a map of the number 5 of pixels known to be in state c as a function of codel value and average neighbouring codel value and the array B contains a similar map of the number of pixels known to be in state 3. Usin2 the empirical colour model A method 9000 of calculating the likelihood that a codel of colour channel c is "on", 10 once the empirical colour model for a colour channel c has been determined in accordance with the method 8000, will now be described with reference to Fig. 9. The method 9000 begins at step 9001, in which the processor 1805 maps the codel (x, y, c) to the pair of integers (i(x, y, c), j(x, y, c)) according to the method 7000 described above with reference to Fig. 7. is At a next step 9002, the likelihood ratio X of the codel (x, y, c) may be calculated according to Formula (81) below. X = (A[i(x, y, c), j(x, y, c)] + 1) / (B[i(x, y, c), j(x, y, c)] + 1) (81) Modifying the empirical colour model by integration It sometimes happens that a data codel maps to a region of the A and B arrays 20 containing few counts. In this case, the corresponding likelihood ratio calculated according to method 9000 will be based on relatively few observations. It may thus be desirable to increase the effective number of observations by adding counts from adjacent regions of the A and B arrays. For the purposes of this discussion, this process will be called 'integration'. 25 There are many methods by which integration may be accomplished. In one example, a method of integration is based on the assumption that if the "on" state corresponds to a higher codel value than the "off' state, then codels with the same average neighbour value but higher scanned codel value are more likely to be "on". --- 111. . --- - .O0 1CC4 - 24 In the case where the "off" state corresponds to the higher codel value, this relationship is reversed. In the following discussion, it is assumed that the first-mentioned case applies. A method 10000 of modifying the arrays A and B determined in accordance with the 5 method 8000, will now be described with reference to Fig. 10. The method 10000 begins at step 10001, in which the processor 1805 creates two arrays, A' and B', the same size as arrays A and B. At a next step 10002, the processor 1805 iterates over all locations (i, j) in the arrays. At a next step 10003, the entry A'(i, j) is calculated from the array A by summing all 10 entries corresponding to the same average neighbour value as entry (i, j), but with codel values less than or equal to entry (i, j), according to Formula (82) below: A'(i, j) = A(x, j) (82) x=0 At the next step 10004, the entry B'(i, j) is calculated from the array B by summing all entries corresponding to the same average neighbour value as entry (i, j), but with codel is values greater than or equal to entry (i, j), according to Formula (83) below: C-I B'(i, j) = I B(x, j) (83) X=i where C is the size of the first dimension of the arrays, as defined previously. At the next step 10005, if the processor 1805 determines that there are more array locations (i, j) to be processed, Yes, then the method 10000 returns to step 10002. 20 Otherwise, No, the method 10000 proceeds to step 10006. At step 10006, the contents of arrays A and B are replaced by the contents of arrays A' and B', respectively, by copying all corresponding elements. Following step 10006, the method 10000 concludes. The method 10000 is a very simple way of accomplishing the integration step. Many 25 more sophisticated methods of applying the aforementioned assumption, such as Bayesian inference, exist in the art and may be substituted for the version described here.
-25 An additional assumption that could also be exploited in this context is that if the "on" state corresponds to a higher codel value than the "off' state, then codels with the same scanned value but lower average neighbour value are more likely to be "on". It is the experience of the present inventors that applying this assumption as an extension of method 5 10000 in some applications does not significantly improve the results obtained. Efficient Shuffling Efficient shuffling overview A digital signal may take form in a number of ways, for example as a digital video or audio signal, or may even be thought of as a two-dimensional barcode where transmission 1o is analogous to encoding and printing the barcode then later scanning and decoding the barcode. In each case, data loss may occur due to random errors during transmission. Fortunately, there are numerous techniques that exist for recovering lost data due to random error. Such techniques are known as Forward Error Correction Codes, abbreviated to ECC codes herein. The majority of ECC codes work by breaking down the data into is blocks and appending to each block some extra redundant information, so that if certain symbols of a block are incorrectly received over a transmission channel, the correct values can still be recovered. Transmission errors clustered in a contiguous run of symbols can potentially render ECC blocks unrecoverable if the bit error rate in the single block is too high, even though 20 the overall bit error rate is low. By shuffling or rearranging the ECC encoded symbols of data before transmission, such errors would be distributed between multiple ECC blocks, because contiguous symbols after shuffling would belong to different ECC blocks. A classic random permutation algorithm is the Knuth-shuffle, which was first publish by Fisher and Yates in 1938, and later popularised in Computer Science by Donald Knuth 25 in 1969. The Knuth-shuffle has been commonly used, as it requires no extra storage space and produces an unbiased shuffle. This algorithm has a major drawback in paged memory environments where there is a large amount of slow memory and a limited amount of fast memory that operates as a cache. In such an environment, page accesses are expensive because the pages need to be loaded from the slow memory into the cache before being 30 accessed if the required pages are not already in the cache. Virtual memory where the fast memory is physical memory and the slow memory is external storage is one example of a - 26 paged memory environment. Also, the relationship between a central processing unit (CPU) cache and physical memory is another example. The physical memory is the slow memory and CPU cache is the fast memory. In such environments, the Knuth-shuffle may not be efficient enough when operating on a large array of data that cannot fit into the faster s cache. This inefficiency arises because the Knuth-shuffle performs a swap between two elements for every element in the list to be shuffled. More often than not, the two elements to be swapped belong to different pages in memory and it requires an expensive operation of copying one of the pages to cache and back when performing the swap. Other shuffling techniques rearrange the data in a non-contiguous way by displacing 10 each element according to positions based on a fixed repeating pattern, or equation. One technique of this kind is interleaving used in Compact Discs. Although such techniques can be implemented efficiently in a paged memory environment, these techniques have the problem of producing extremely biased shuffles. Although these methods are effective for small burst errors, the problem of biased shuffles arises when digital signal transmission 15 errors occur at repeating intervals. The frequency at which the error occurs can match the frequency at which the bits of the same block are positioned, which can lead to an undecodable block, even though the overall bit error rate for the entire data is low and correctable by the ECC code. Shuffle method 20 Disclosed herein is a method of permuting an ordered set. The method includes the steps of dividing the set into pages of a given size and arranging the pages as a compact array of two or more dimensions and a one-dimensional array of remainder pages. For each array dimension successively, the method shuffles the elements of the sets formed by grouping pages differing only in array location with respect to the given dimension. The 25 method then shuffles the remainder pages into the compact array. Shuffle method description The present disclosure provides an efficient data shuffling method for permuting a large set of elements. The method is herein referred to as N Dimensional Shuffle and is abbreviated to ND-Shuffle. The main steps of the ND-Shuffle method are illustrated in the 30 flow diagram 1100 of Fig. 11 and illustrated visually in Fig. 14. The method 1100 takes an ordered set of K elements and produces a randomly permuted set of said K elements. The -27 method 1100 begins with step 1110 dividing the elements into M pages, shown by 1410. Each page contains E = K / M elements, and in this embodiment E = 1024. To illustrate this further, elements inside the second page are shown by 1405. Next in step 1120 the M pages are factorised: 5 M=A*B*C+DwithA,B,C<=R So that it is easier to visualise, in this embodiment 3 factors A, B, and C will be used. However, any amount N factors is also possible. The pages can now be envisaged as items of a compact multidimensional array 1420 in which each item 1421 of the array 1420 represents a single page. The sizes of each dimension correspond to the factors A, B and 10 C. Often M is not perfectly factorisable and a remainder of D pages is present, as illustrated by 1425. Factors should be chosen so that D is minimised and all factors (in this example A, B, C ) are smaller than or equal to a size R. In one embodiment, the factorisation required can be performed by the method described below with reference to Fig. 12. In the flowchart of Fig. 11, M refers to the 15 amount of pages needed to be factorised, R refers the maximum size that a factor can be and MAX-FACTORS refers to the maximum amount of factors to be used. At completion, thefactorsArray array contains the factors and D is set to the number of remainder pages. This method ensures that D is minimised by attempting first to factorize all pages, by setting variable s = M so that there are no remainders, then slowly decreasing 20 s in steps of 1 until it is possible for s to be factorized perfectly. Factorization of s is done using a brute force approach. All possible factors starting from largest R are tried; if one successfully divides s it is added to the factorArray, the next factor searched for must divide (s / product of the factorArray). When the product of thefactorsArray and variable s are equal then the factorization process finishes. 25 In step 1130, each dimension of the multidimensional array 1420 is processed by successive Knuth-shuffles, which will be described in greater details below with reference to method 1300 of Fig 13. Each shuffle operates on the elements of the sets formed by grouping pages, differing only in array location with respect to the given dimension. In other words, each group of pages that is shuffled will have all array indexes the same 30 except for one which corresponds to the dimension that is currently being processed.
- 28 Representation 1430 shows how groups of A pages or A * E elements are Knuth-shuffled along a first dimension. After the whole array has been processed, groups of B * E elements are Knuth-shuffled along a second dimensions as shown in 1440, and finally groups of C * E elements are Knuth-shuffled in the last dimension as shown in 1450. Note 5 that 1430, 1440 and 1450 can be performed in any order. In the last step 1140 of method 1100, the small amount of leftover D pages 1425 are shuffled into the rest of the array 1460 (which itself was shuffled by the previous step 1130). In one implementation, step 1140 is performed by joining the 1125 D pages at the beginning of a now flattened version of the multidimensional array 1420 to form again a list of M * E elements. A Knuth-shuffle is io performed on this list so that the shuffling terminates after processing the first D * E elements rather than the whole list. The result at the conclusion of the method is a flat list of M pages 1470, each page containing E elements shown by 1480, which have come from a random location in the original list 1410 as exemplified by the random indices the elements are marked with. is It is important to note that the pages can be always stored as a flat list and conversion from the multidimensional representation 1420 to the flat representation of the pages shown in 1410 and 1470 is done by an indexation formula such as the one below: i= a index + b index * A + c index * A * B where i is an index into the flat list of pages, and aindex, b_index, and cindex 20 index the pages of the multidimensional array representation 1420. ND-Shuffle randomness: A perfect unbiased shuffle on an ordered set of K elements, has K! possible permutations, where each permutation can occur with equal probability. The ND-Shuffle method does not produce a perfect shuffle, as certain permutations are not possible. 25 However, the strength of the ND-Shuffle method is that each element has an equal chance in being placed in any position in the resultant permuted set 1470, and 2 elements residing in the same page have a probability of approximately 1 / M of both still ending up in the same page in the resultant permuted set 1470. This property spreads any contiguous blocks in the original ordered set evenly and randomly throughout the resultant permuted set 1470. -~'IJ - -llf JO M 01 Al C - 29 Efficient hardware implementation To improve the performance of the shuffling method described above, the method 1100 may be implemented by use of custom hardware such as a field programmable gate array (FPGA) board containing fast memory (i.e., a cached buffer). In 5 method 1100, the bulk of the shuffling is done in step 1130. Each Knuth-shuffle process operates on a data set containing at most R pages or R * E elements, as all the dimensions of 1420 have size A, B, C <= R. Due to this size restriction, the groups of pages to be Knuth-shuffled can be copied into a cached buffer, and the custom hardware which performs the Knuth-shuffle method 1300 on the elements in the cached buffer can be 10 implemented. In a paged memory environment, where opening pages is expensive, through this implementation each page is read and written to exactly N = 3 times (once per dimension). Unshuffling In many situations where there is a benefit to shuffling or permuting a data set, it is is always necessary at a later stage to unshuffle the data back to an original order. In one embodiment, unshuffling a data set shuffled by the ND-Shuffle method can be done by first shuffling an ordered set of indices using the said method, and then using the resulting shuffled index set to place the shuffled data set back to their original position: Method XUOO: 20 FORI=OtoK- 1: unshuffled-array[shuffled_indexes[I]] = shuffled array[I] where K is the size of the data set, unshuffledarray will contain the elements with the original order restored, shuffled-array contains the data shuffled by the ND-Shuffle method 1100, and shuffledindexes contains the indexes shuffled by the ND-Shuffle 25 method 1100. This method can be further illustrated by the following example. For the purposes of this example, allow the original data set to consist of elements [U,V,W,X,Y] and after processing those elements through the ND-Shuffle method say the resultant shuffledarray produced is [W,U,Y,V,X]. To unshuffle the array, an array of indices [0,1,2,3,4] is 30 shuffled with the same method to produce shuffledindexes = [2,0,4,1,3], then the original 1-1-CI 1 _ _ll D~ .. OIAl C - 30 data set is recovered by placing each item in the shuffled-array at the index position indicated by the corresponding element in the shuffledindexes (i.e., W goes to index 2, U goes to index 0, X goes to index 4, and so on). Note that if the original data is processed using the unshuffle method first, it may be restored to the original order by applying the s shuffle method afterwards, so either method can be used to permute then un-permute the data in original order. Barcode embodiment A further embodiment of the present disclosure is illustrated by Fig. 15. 1510 is a two-dimensional barcode formed of codels 1511, (black or white dots), representing the 10 data bits. 1 out of every 9 codels are used for alignment purposes. The barcode also consists of 6 alignment spirals 1512 located at the corners. To create a barcode, an encoding process 1600 of Fig. 16 is used. In a first step 1610, the data is XORed with a pseudorandom string to rebalance the number of 1 and 0 bits. Next in step 1620 the data is divided into blocks, and then in 1630 15 each block is encoded with ECC information by an ECC method. In this embodiment, Low Density Party Check is used, however other ECC methods such as Reed-Solomon are possible. Next, the ECC blocks are rejoined and in step 1640 the ECC encoded data is shuffled by the ND-Shuffle method 1100, in which the elements to the input array are bits of the ECC encoded data. 20 To demonstrate the effects of shuffling the ECC data, drawing 1520 shows the bit positions of the first ECC block; the positions of the codels are marked as white dots, and the rest of the codels are black. Shuffling ECC blocks has the effect of distributing each individual block throughout the whole area of the barcode; this is very effective against damage concentrated at one area of the barcode, such as stain 1531 in barcode 1530. 25 Without shuffling the ECC blocks, the stain could damage a whole ECC block, rendering the block undecodable even though the stain only covers a small portion of the total barcode area. In step 1650, the shuffled data bits are then rendered as black and white barcode codels that represent 0 and I binary digits respectively. Finally, in the last step 1660 the alignment spirals and dots are also rendered to form the complete barcode 1510. 30 Decoding such a barcode is outlined in method 1700 of Fig. 17. The input to this method is a scan containing the barcode. The barcode region is located in the first 1-1-~ 1 -- IDXd.O1A1KC -31 step 1710 by using the alignment spirals. In a next step 1720, the dimensions of the barcodes are determined, and in step 1730 the barcode is corrected for any rotation, scaling and translation by using the alignment spirals. Next, in step 1740 interior warping is corrected by using the I in 9 alignment dots contained inside, along with the barcode data. 5 Next, in step 1750 the data carrying dots are converted to bit likelihoods and joined together as an array. Next, in step 1760 the array of likelihoods is unshuffled via method XUOO described in the previous section where each element in the array to be unshuffled represents one likelihood. Next, in step 1770 the unshuffled likelihoods are divided into ECC blocks and in step 1780 each block is decoded by the ECC method. After all blocks 10 have been decoded, the blocks are rejoined. The original data is recovered in step 1790 by XORing of the ECC decoded data with the same pseudorandom string that was used at the encoding stage in step 1610. In another embodiment, the shuffling step 1640 and unshuffling step 1760 are swapped, so the unshuffle method is performed in the barcode encoder and the shuffle method is 15 performed in the barcode decoder. The shuffle method requires no extra memory and fewer steps than the unshuffle method, so performing the shuffle method in the decoding stage can be beneficial in situations where the barcode decoder's speed and memory use is more important than that of the encoder. Industrial Applicability 20 It is apparent from the above that the arrangements described are applicable to the computer and data processing, and printing industries. 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 spirit of the invention, the embodiments being illustrative and not restrictive. 25 In the context of this specification, the word "comprising" means "including 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. - - - 1DM1%J A1A<

Claims (17)

1. A method of determining dimensions of a barcode containing a correlatable alignment pattern, said method comprising the steps of: estimating at least one initial barcode dimension; 5 generating at least one correction value through correlation of said correlatable alignment pattern with the barcode; and refining said initial barcode dimension using said generated correction values to generate final barcode dimensions. 10
2. The method according to claim 1, wherein the initial barcode dimension is estimated from a linear distance between a plurality of finder patterns.
3. The method according to claim 2, wherein the finder patterns are spirals. is
4. The method according to claim 1, wherein the said correction values are generated through correlation at a plurality of locations on the barcode.
5. The method according to claim 4, wherein said locations on the barcode are positioned with equal spacing on a line connecting diagonally opposing corners of the 20 barcode.
6. The method according to claim 1, wherein said correction values are generated using spatial correlation. 25
7. The method according to claim 6, wherein tile-based spatial correlation is used.
8. The method according to claim 6, wherein the spatial correlation utilises the following formula: 2 (nZ xy -E )2 ) ..- 1~ It C - 33 wherein xi represents a value of an alignment codel at coordinate r, yi represents a value of said codel at coordinate c, while n represents a number of alignment codels within said barcode and (vxy) 2 represents a correlation score between said correlatable alignment pattern and said barcode. 5
9. The method according to claim 1, wherein each of said at least one correction values is generated in steps comprising: generating a correlation score for each of a plurality of displacement coordinates centered at a selected position on the barcode; 10 selecting a displacement coordinate with a highest correlation score; and selecting a vector describing positions of said coordinate with the highest correlation score relative to the center as said correction value.
10. A method of estimating a likelihood that a barcode codel is "on", said method 15 comprising the steps of: creating a mapping of a number of known "on" codels as a function of a corresponding observed pixel and neighbouring pixel values; creating a mapping of a number of known "off" codels as a function of a corresponding observed pixel and neighbouring pixel values; and 20 calculating a likelihood value using the numbers of known "on" and "off' codels in the region of said mappings corresponding to the respective "on" and "off' codels.
11. The method according to claim 0, comprising the further step of: modifying said mappings of known "on" and "off' codels by integration. 25
12. A method of permuting an ordered set, said method comprising the steps of: dividing said set into pages of a given size; arranging the pages as a compact array of two or more dimensions and a one-dimensional array of remainder pages; 30 for each array dimension successively, shuffle the elements of the sets formed by grouping pages differing only in array location with respect to the given dimension; and -34 shuffling the remainder pages into the compact array.
13. The method according to claim 1, wherein the elements in said ordered set are symbols of an error correcting code block. 5
14. The method according to claim 1, wherein the elements in said ordered set represent codels of a barcode.
15. A method of determining dimensions of a barcode containing a correlatable io alignment pattern, said method being substantially as described herein with reference to the accompanying drawings.
16. A method of estimating a likelihood that a barcode codel is "on", said method being substantially as described herein with reference to the accompanying drawings. 15
17. A method of permuting an ordered set, said method being substantially as described herein with reference to the accompanying drawings. DATED this Twenty-Fourth Day of December, 2007 20 CANON KABUSHIKI KAISHA Patent Attorneys for the Applicant SPRUSON&FERGUSON
AU2007254663A 2007-12-24 2007-12-24 Efficient shuffling Abandoned AU2007254663A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU2007254663A AU2007254663A1 (en) 2007-12-24 2007-12-24 Efficient shuffling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
AU2007254663A AU2007254663A1 (en) 2007-12-24 2007-12-24 Efficient shuffling

Publications (1)

Publication Number Publication Date
AU2007254663A1 true AU2007254663A1 (en) 2009-07-09

Family

ID=40873542

Family Applications (1)

Application Number Title Priority Date Filing Date
AU2007254663A Abandoned AU2007254663A1 (en) 2007-12-24 2007-12-24 Efficient shuffling

Country Status (1)

Country Link
AU (1) AU2007254663A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111201559A (en) * 2017-10-12 2020-05-26 日本电信电话株式会社 Replacement device, replacement method, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111201559A (en) * 2017-10-12 2020-05-26 日本电信电话株式会社 Replacement device, replacement method, and program
EP3696796A4 (en) * 2017-10-12 2021-08-11 Nippon Telegraph And Telephone Corporation Replacement device, replacement method, and program
US11099984B2 (en) 2017-10-12 2021-08-24 Nippon Telegraph And Telephone Corporation Permutation apparatus, permutation method, and program
CN111201559B (en) * 2017-10-12 2023-08-18 日本电信电话株式会社 Replacement device, replacement method, and recording medium

Similar Documents

Publication Publication Date Title
US6115508A (en) Clock free two-dimensional barcode and method for printing and reading the same
KR100414524B1 (en) Two-dimensional Code having superior decoding property which is possible to control the level of error correcting codes, and method for encoding and decoding the same
JP3742389B2 (en) Cyclic position code
US7694889B2 (en) Printed material having location identification function, two-dimensional coordinate identification apparatus, image-forming apparatus and the method thereof
CN1744104B (en) Method and device for determining captured array position
US7604180B2 (en) Code pattern, printed matter, image generating apparatus, image processing apparatus, image generating method, and information identifying method
AU2007254619B2 (en) Barcode removal
US20060157574A1 (en) Printed data storage and retrieval
JPH04233678A (en) Compatible diminishing scale method for decoding spatially periodic self-locking symbol-shape code
CN101243461A (en) Embedded interaction code enabled display
JPH04233677A (en) Binary-image processing method for decoding self-locking symbol-shape code
JP5287485B2 (en) Information expression image, printed matter, image processing apparatus, and image processing program
JPH0778817B2 (en) A method for decoding a bitmap image space representation of a self-clocking symbol shape code
US9367782B2 (en) High capacity 2D color barcode and method for decoding the same
WO2004098171A1 (en) Watermark information detection method
US7611067B2 (en) Printed material with identification function, image generating apparatus, image processing apparatus, image generating method, image processing method, and program product therefor
AU2007254595A1 (en) Constellation detection
US8019181B2 (en) Image generation apparatus, image processing apparatus, computer readable medium and computer data signal
US8544741B2 (en) Data block offset encoding method for coordinates
AU2007254663A1 (en) Efficient shuffling
EP2806378B1 (en) Method, apparatus and storage medium for two-dimensional data storage
US10891704B2 (en) M-ary cyclic coding
JPH0675795A (en) Logically independent partial-arrangement tiling for griff code for decreasing occurrence of hard error
AU2005209709A1 (en) Two dimensionally phase modulated information symbol
JPH06103390A (en) Protection of two-dimensional code from multiplex burst error pattern

Legal Events

Date Code Title Description
MK1 Application lapsed section 142(2)(a) - no request for examination in relevant period