AU2008261179B2 - QR code decoding system - Google Patents

QR code decoding system Download PDF

Info

Publication number
AU2008261179B2
AU2008261179B2 AU2008261179A AU2008261179A AU2008261179B2 AU 2008261179 B2 AU2008261179 B2 AU 2008261179B2 AU 2008261179 A AU2008261179 A AU 2008261179A AU 2008261179 A AU2008261179 A AU 2008261179A AU 2008261179 B2 AU2008261179 B2 AU 2008261179B2
Authority
AU
Australia
Prior art keywords
code
detected
region
finder
patterns
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
AU2008261179A
Other versions
AU2008261179A1 (en
Inventor
James Swayne
Alvin Wai Leong Yeap
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 AU2008261179A priority Critical patent/AU2008261179B2/en
Priority to US12/628,425 priority patent/US9355293B2/en
Priority to JP2009285726A priority patent/JP5393428B2/en
Publication of AU2008261179A1 publication Critical patent/AU2008261179A1/en
Application granted granted Critical
Publication of AU2008261179B2 publication Critical patent/AU2008261179B2/en
Ceased legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/422Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation for representing the structure of the pattern or shape of an object therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/457Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by analysing connectivity, e.g. edge linking, connected component analysis or slices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Image Processing (AREA)

Description

S&F Ref: 888278 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): James Swayne, Alvin Wai Leong Yeap Address for Service: Spruson & Ferguson St Martins Tower Level 35 31 Market Street Sydney NSW 2000 (CCN 3710000177) Invention Title: QR code decoding system The following statement is a full description of this invention, including the best method of performing it known to me/us: 5845c(1903558_1) - 1 QR CODE DECODING SYSTEM TECHNICAL FIELD The present invention relates to searching for, and grouping multiple identification markers to form a QR code region. Once identified, these QR code regions may be used to decode the data encoded by the QR code symbology. 5 BACKGROUND A QR code, such as the code 300 of Fig. 3, is a two-dimensional barcode that encodes information with black and white square blocks, referred to as 'modules'. In the QR code 300, labelled are a black module 302 and a white module 301. QR codes have a range of data capacities. A 'Version 1' QR code encodes the least number of data bits, 10 and a 'Version 40' QR code encodes the maximum number of data bits. QR codes encoding more data bits have a greater number of modules. Irrespective of its data capacity, a QR code will always be the same number of modules in width as it is in height - that is, QR codes are always square. A QR code comprises three location and identification symbols. These three 15 location symbols are known as 'finder patterns' (FPs) and are located in the top-left, top right, and bottom-left corners of a QR code. Therefore, the two-dimensional area of an image occupied by a QR code, also known as a 'QR code region', is demarcated by the locations of the three FPs. Fig. 2B shows these three FPs 201, 202, 203 as may be located at three corners of a QR code 200. Fig. 2A provides an enlarged representation 20 of the FP 202. Fig. I is a detailed view of a QR code finder pattern 100. Finder patterns are composed of a 3-by-3 square of black modules 103 superimposed on a 5-by-5 square of white modules 102, which is in turn superimposed on a 7-by-7 square of black modules 101. 1902838_1 888278_speci_lodge -2 The process of extracting the data encoded in a QR code begins with the acquisition of an image containing the code. Subsequently, all three finder patterns are detected and their locations are determined. Using the location information of the detected FPs, data modules of the QR code are then sampled to obtain a binary data 5 stream. Finally, the binary data stream is translated to meaningful text or numerical information. QR codes are frequently included on a broad range of media, such as product labels, billboards and business cards. In general, these media have only included a single QR code of high quality (that is, the digital image of the original QR code has been 10 accurately re-produced on the media). Therefore, when a QR code is being decoded, there is only a single QR code in the acquired image and the quality of the code is high, facilitating the use of relatively simple decoding processing. Furthermore, conventional QR code capturing devices (such as camera phones) can be user-adjusted such that an image of the QR code may be acquired with very little rotational misalignment. These 15 user-adjusted capturing devices can also frame the QR code such that the size of modules in the QR code (with respect to the capturing device) is within a confined known range. Recently, there has been increased interest in the application of QR codes in aiding document security and workflow management. For these applications, there may 20 be multiple QR codes in an acquired image. Furthermore, there will often be a broad variation in module sizes and orientations amongst the QR codes in the image. The QR codes may also have been printed, scanned and re-printed many times, each time introducing deterioration of the QR code image quality. Specifically, QR codes may suffer from 'dot gain' in which the ratio of black module size and white module size in 1902838_1 888278_speci_lodge -3 the QR code differs significantly from the ideal 1:1 ratio. Multiple cycles of printing and scanning also introduces noise and other distortions that further alter the appearance of QR code finder patterns compared to the ideal FP 100. The effect of dot gain and other print and/or scan introduced distortions on decoding reliability using traditional 5 techniques can be considerable. This is because traditional decoding systems typically rely heavily on the expected appearance of QR code finder patterns 100, especially the 1:1 ratio between white and black module sizes, to detect the QR code finder patterns and thereby decode the QR code. SUMMARY 10 The arrangements to be described provide a method of detecting and decoding QR codes that is highly robust to dot gain, noise and other types of damage. Furthermore, the arrangements are able to group QR finder patterns to form valid QR code regions even when there are multiple QR codes in the acquired image. Briefly, the arrangements disclosed herein comprise four basic stages 15 Binarization, CCA, Resolving and Decoding. These stages are described in more detail later. The arrangements employ a method of detecting and locating QR FPs that use Connected Components Analysis (CCA) which provides more useful information to the Resolving and Decoding stages than conventional FP detection approaches. 20 One aspect of the present disclosure employs a novel approach to grouping QR FPs into QR code regions. The process of grouping multiple QR FPs to form QR codes is referred to herein as 'resolving'. The method of resolving disclosed herein, applied in conjunction with a missing finder pattern recovery process, that is another aspect, is capable of resolving QR code regions from only two initially detected QR FPs. This feat 1902838_1 888278_speci lodge -4 has not been achieved with methods in the prior art to the best knowledge of the present inventors and allows QR codes to be decoded when one of the three FPs is damaged. Overall, the disclosed decoding method incorporating the above-mentioned aspects enables a highly robust QR code decoding system capable of decoding QR codes 5 even when one of three FPs is damaged. This damage may be caused by accidental staining or pen strokes, or by severe noise induced by multiple cycles of printing and scanning. In accordance with one aspect of the present disclosure, there is provided a method of decoding a QR code having two initially detected finder patterns, the method 10 comprising the steps of: (a) forming a pattern matching template based on characteristics of the detected finder patterns; (b) determining at least one candidate region about the detected finder patterns, the candidate region being based at least on the relative position of the detected 15 finder patterns; and (c) locating a previously undetected third finder pattern of the QR code in the at least one candidate region by correlating content of the candidate region with the pattern matching template; and (d) decoding the QR code with each of the two initially detected finder 20 patterns and the third finder pattern. Other aspects are also disclosed. BRIEF DESCRIPTION OF THE DRAWINGS At least one embodiment of the present invention will now be described with reference to the following drawings, in which: 1902838_1 888278_spedlodge -5 Fig. I shows an ideal arrangement of a QR code 'finder pattern'; Figs. 2A and 2B show a QR code affected by noise and dot gain; Fig. 3 shows a QR code with examples of black and white modules; Fig. 4 is a flowchart of a QR code decoding process; 5 Fig. 5 is a flowchart giving a general overview on a resolving process employed at step 404 of Fig. 4; Fig. 6 is a flowchart giving a general overview of a process employed at step 502 of Fig. 5 to resolve groups of three finder patterns into a QR code regions; Fig. 7 is a flowchart detailing a process for checking that groups of three finder 10 patterns may potentially form a QR code region; Figs. 8A, 8B and 8C show some examples whereby the checks performed in step 602 of Fig. 6 fail; Fig. 9 is a flowchart showing a process employed at 603 for finding 'true' 3/3 regions; 15 Figs. 1OA, 1OB and IOC show examples of QR code regions with and without internal finder patterns. Fig. 11 shows vectors used to determine if a 3/3 QR code region contains an internal finder pattern; Fig. 12 is a flowchart giving a general overview of a process employed at step 20 503 to resolve groups of two finder patterns into QR code regions; Fig. 13 is a flowchart detailing a process for checking that a pair of finder patterns may potentially form a QR code region; Fig. 14 shows examples whereby the checks performed in 1203 fail; Figs. 15A, 15B and 15C show normally and diagonally oriented 2/3 regions; 1902838_1 888278_speci_lodge -6 Fig. 16 is a flowchart describing a process employed at step 1203 for generating potential 2/3 regions; Figs. 17A and 17B show potential QR code regions with respect to detected finder patterns; 5 Figs. 18A and 18B show vectors, with respect to detected finder patterns, used to determine the extents of potential QR code regions; Fig. 19 is a flowchart showing a process employed at 1204 for finding 'true' 2/3 regions; Figs. 20A and 20B show vectors used to determine if a 2/3 QR code region 10 contains an internal finder pattern; Fig. 21 is a flowchart giving a general overview of a process employed at step 405 for decoding QR code regions; Fig. 22 is a flowchart detailing a process employed at step 2102 for decoding 3/3 regions; 15 Fig. 23 is a flowchart detailing a process employed at step 2103 for decoding 2/3 regions; Fig. 24 is a flowchart detailing a process employed at step 2304 for detecting missing finder patterns in a 2/3 region; Fig. 25 is a flowchart giving a general overview of a process employed at step 20 2402 for forming a pattern matching template from CCA information; Fig. 26 is a flowchart giving a general overview of an alternative process that may be employed at step 2402 for forming a pattern matching template by averaging two initially detected finder patterns; 1902838_1 888278_specilodge -7 Fig. 27 shows an example template formed in memory taking into account dot gain information; Fig. 28 shows an example template formed in memory and rotated; Figs. 29A and 29B show examples of search regions and their relation to detected 5 finder patterns in normally and diagonally oriented QR code regions; Fig. 30 show vectors and angles formed to determine the extents of a search region; Fig. 31 shows various inherent features of a QR code that may be utilised to aid in the checks of step 1201 or in the process of detecting missing finder patterns 10 employed at 2304; Fig. 32 is a flowchart of an alternative process for detecting a missing finder pattern utilising inherent QR code features; Figs. 33A and 33B form a schematic block diagram of a general purpose computer system upon which the arrangements described can be practiced. 15 DETAILED DESCRIPTION INCLUDING BEST MODE Operating Environment Figs. 33A and 33B collectively form a schematic block diagram of a general purpose computer system 3300, upon which the various arrangements described can be practiced. 20 As seen in Fig. 33A, the computer system 3300 is formed by a computer module 3301, input devices such as a keyboard 3302, a mouse pointer device 3303, a scanner 3326, a camera 3327, and a microphone 3380, and output devices including a printer 3315, a display device 3314 and loudspeakers 3317. An external Modulator Demodulator (Modem) transceiver device 3316 may be used by the computer 1902838_1 888278_specilodge -8 module 3301 for communicating to and from a communications network 3320 via a connection 3321. The network 3320 may be a wide-area network (WAN), such as the Internet or a private WAN. Where the connection 3321 is a telephone line, the modem 3316 may be a traditional "dial-up" modem. Alternatively, where the connection 3321 is 5 a high capacity (eg: cable) connection, the modem 3316 may be a broadband modem. A wireless modem may also be used for wireless connection to the network 3320. The computer module 3301 typically includes at least one processor unit 3305, and a memory unit 3306 for example formed from semiconductor random access memory (RAM) and semiconductor read only memory (ROM). The module 3301 also 10 includes an number of input/output (1/0) interfaces including an audio-video interface 3307 that couples to the video display 3314, loudspeakers 3317 and microphone 3380, an 1/0 interface 3313 for the keyboard 3302, mouse 3303, scanner 3326, camera 3327 and optionally a joystick (not illustrated), and an interface 3308 for the external modem 3316 and printer 3315. In some implementations, 15 the modem 3316 may be incorporated within the computer module 3301, for example within the interface 3308. The computer module 3301 also has a local network interface 3311 which, via a connection 3323, permits coupling of the computer system 3300 to a local computer network 3322, known as a Local Area Network (LAN). As also illustrated, the local network 3322 may also couple to the wide network 3320 via a 20 connection 3324, which would typically include a so-called "firewall" device or device of similar functionality. The interface 3311 may be formed by an Ethernet T circuit card, a BluetoothTM wireless arrangement or an IEEE 802.11 wireless arrangement. The interfaces 3308 and 3313 may afford either or both of serial and parallel connectivity, the former typically being implemented according to the Universal Serial 1902838_1 888278_specilodge -9 Bus (USB) standards and having corresponding USB connectors (not illustrated). Storage devices 3309 are provided and typically include a hard disk drive (HDD) 3310. Other storage devices such as a floppy disk drive and a magnetic tape drive (not illustrated) may also be used. An optical disk drive 3312 is typically provided to act as a 5 non-volatile source of data. Portable memory devices, such optical disks (eg: CD-ROM, DVD), USB-RAM, and floppy disks for example may then be used as appropriate sources of data to the system 3300. The components 3305 to 3313 of the computer module 3301 typically communicate via an interconnected bus 3304 and in a manner which results in a 10 conventional mode of operation of the computer system 3300 known to those in the relevant art. Examples of computers on which the described arrangements can be practised include IBM-PC's and compatibles, Sun Sparcstations, Apple Mac" or alike computer systems evolved therefrom. The methods of QR code decoding may be implemented using the computer 15 system 3300 wherein the processes of Figs. 4 to 32, to be described, may be implemented as one or more software application programs 3333 executable within the computer system 3300. In particular, the steps of the methods of QR code decoding are effected by instructions 3331 in the software 3333 that are carried out within the computer system 3300. The software instructions 3331 may be formed as one or more 20 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 performs the QR code decoding methods and a second part and the corresponding code modules manage a user interface between the first part and the user. 1902838_1 888278_specilodge -10 The software 3333 is generally loaded into the computer system 3300 from a computer readable medium, and is then typically stored in the HDD 3310, as illustrated in Fig. 33A, or the memory 3306, after which the software 3333 can be executed by the computer system 3300. In some instances, the application programs 3333 may be 5 supplied to the user encoded on one or more CD-ROM 3325 and read via the corresponding drive 3312 prior to storage in the memory 3310 or 3306. Alternatively the software 3333 may be read by the computer system 3300 from the networks 3320 or 3322 or loaded into the computer system 3300 from other computer readable media. Computer readable storage media refers to any storage medium that participates in 10 providing instructions and/or data to the computer system 3300 for execution and/or processing. Examples of such storage media include floppy disks, magnetic tape, CD ROM, a hard disk drive, a ROM or integrated circuit, USB memory, 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 3301. Examples of 15 computer readable transmission media that may also participate in the provision of software, application programs, instructions and/or data to the computer module 3301 include radio or infra-red transmission channels as well as a network connection to another computer or networked device, and the Internet or Intranets including e-mail transmissions and information recorded on Websites and the like. 20 The second part of the application programs 3333 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 3314. Through manipulation of typically the keyboard 3302 and the mouse 3303, a user of the computer system 3300 and the application may manipulate the interface in a functionally 1902838_1 888278_specilodge -11 adaptable manner to provide controlling commands and/or input to the applications associated with the GUI(s). Other forms of functionally adaptable user interfaces may also be implemented, such as an audio interface utilizing speech prompts output via the loudspeakers 3317 and user voice commands input via the microphone 3380. 5 Fig. 33B is a detailed schematic block diagram of the processor 3305 and a "memory" 3334. The memory 3334 represents a logical aggregation of all the memory devices (including the HDD 3310 and semiconductor memory 3306) that can be accessed by the computer module 3301 in Fig. 33A. When the computer module 3301 is initially powered up, a power-on self-test 10 (POST) program 3350 executes. The POST program 3350 is typically stored in a ROM 3349 of the semiconductor memory 3306. A program permanently stored in a hardware device such as the ROM 3349 is sometimes referred to as firmware. The POST program 3350 examines hardware within the computer module 3301 to ensure proper functioning, and typically checks the processor 3305, the memory (3309, 3306), 15 and a basic input-output systems software (BIOS) module 3351, also typically stored in the ROM 3349, for correct operation. Once the POST program 3350 has run successfully, the BIOS 3351 activates the hard disk drive 3310. Activation of the hard disk drive 3310 causes a bootstrap loader program 3352 that is resident on the hard disk drive 3310 to execute via the processor 3305. This loads an operating system 3353 into 20 the RAM memory 3306 upon which the operating system 3353 commences operation. The operating system 3353 is a system level application, executable by the processor 3305, to fulfil various high level functions, including processor management, memory management, device management, storage management, software application interface, and generic user interface. 1902838_1 888278_speci-lodge - 12 The operating system 3353 manages the memory (3309, 3306) in order to ensure that each process or application running on the computer module 3301 has sufficient memory in which to execute without colliding with memory allocated to another process. Furthermore, the different types of memory available in the system 3300 must be used 5 properly so that each process can run effectively. Accordingly, the aggregated memory 3334 is not intended to illustrate how particular segments of memory are allocated (unless otherwise stated), but rather to provide a general view of the memory accessible by the computer system 3300 and how such is used. The processor 3305 includes a number of functional modules including a control 10 unit 3339, an arithmetic logic unit (ALU) 3340, and a local or internal memory 3348, sometimes called a cache memory. The cache memory 3348 typically includes a number of storage registers 3344 - 3346 in a register section. One or more internal buses 3341 functionally interconnect these functional modules. The processor 3305 typically also has one or more interfaces 3342 for communicating with external devices via the system 15 bus 3304, using a connection 3318. The application program 3333 includes a sequence of instructions 3331 that may include conditional branch and loop instructions. The program 3333 may also include data 3332 which is used in execution of the program 3333. The instructions 3331 and the data 3332 are stored in memory locations 3328-3330 and 3335-3337 respectively. 20 Depending upon the relative size of the instructions 3331 and the memory locations 3328-3330, a particular instruction may be stored in a single memory location as depicted by the instruction shown in the memory location 3330. Alternately, an instruction may be segmented into a number of parts each of which is stored in a separate 1902838_1 888278_specilodge - 13 memory location, as depicted by the instruction segments shown in the memory locations 3328-3329. In general, the processor 3305 is given a set of instructions which are executed therein. The processor 3305 then waits for a subsequent input, to which it reacts to by 5 executing another set of instructions. Each input may be provided from one or more of a number of sources, including data generated by one or more of the input devices 3302, 3303, data received from an external source across one of the networks 3320, 3322, data retrieved from one of the storage devices 3306, 3309 or data retrieved from a storage medium 3325 inserted into the corresponding reader 3312. The 10 execution of a set of the instructions may in some cases result in output of data. Execution may also involve storing data or variables to the memory 3334. The disclosed QR code decoding arrangements use input variables 3354, that are stored in the memory 3334 in corresponding memory locations 3355-3358. The QR code decoding arrangements produce output variables 3361, that are stored in the 15 memory 3334 in corresponding memory locations 3362-3365. Intermediate variables may be stored in memory locations 3359, 3360, 3366 and 3367. The register section 3344-3346, the arithmetic logic unit (ALU) 3340, and the control unit 3339 of the processor 3305 work together to perform sequences of micro operations needed to perform "fetch, decode, and execute" cycles for every instruction in 20 the instruction set making up the program 3333. Each fetch, decode, and execute cycle comprises: (a) a fetch operation, which fetches or reads an instruction 3331 from a memory location 3328; 1902838_1 888278_specilodge - 14 (b) a decode operation in which the control unit 3339 determines which instruction has been fetched; and (c) an execute operation in which the control unit 3339 and/or the ALU 3340 execute the instruction. 5 Thereafter, a further fetch, decode, and execute cycle for the next instruction may be executed. Similarly, a store cycle may be performed by which the control unit 3339 stores or writes a value to a memory location 3332. Each step or sub-process in the processes of Figs. 4 to 32 is associated with one or more segments of the program 3333, and is performed by the register section 3344 10 3347, the ALU 3340, and the control unit 3339 in the processor 3305 working together to perform the fetch, decode, and execute cycles for every instruction in the instruction set for the noted segments of the program 3333. The methods of QR code decoding may alternatively be implemented in dedicated hardware such as one or more integrated circuits performing the functions or 15 sub functions of QR code decoding. Such dedicated hardware may include graphic processors, digital signal processors, or one or more microprocessors and associated memories. Typically for QR code decoding, as seen in Fig. 33A, a document 3390 having at least one QR code formed thereon is scanned by the scanner 3326 or captured by the 20 camera 3327 to deliver to the computer 3301 via the interface 3313 an acquired image of the document 3390, the image being stored in the memory 3334 as the input variable 3355. Using the image stored in that storage location, and also in other storage locations including those mentioned above, QR code decoding proceeds under control of the 1902838_1 888278_specilodge - 15 application program and the processing performed by the processor 3305, as will now be described. Decoding Flow & Binarization A method 400 of decoding one or more QR codes in an acquired image is 5 described with reference to Fig. 4. The method 400 forms the basis of the application program as executed by the processor 3305. The process 400 of decoding one or more QR codes in the acquired image begins at an initial step 401 in which an image 410 with QR codes is input as discussed above. The image may be acquired from a flatbed scanner, or a digital camera, or by any other 10 means of obtaining a digital representation of an image, such as downloading an image via the networks 3320, 3322. Step 401 is followed by a binarization step 402, during which a binarized image 412 is generated from the acquired image 410. The binarized image may be stored as the intermediate variable 3359. The binarization step 402 employs a binarization algorithm 15 that labels each pixel in the acquired image as either 'black' or 'white' by examining the intensity of the pixel in relation to other pixels in the acquired image. There are many well-known binarization algorithms available in the art, and any algorithm that labels pixels as either 'black' or 'white' based on the pixel intensity may be employed at the step 402. 20 At a following step 403, FPs in the binarized image 412 are located by employing a method of Connected Component Analysis (CCA). The CCA stage 403 outputs a list 414 of detected FPs. The method of performing CCA to detect FPs disclosed herein provides much higher robustness to typical print-scan distortions such as dot-gain in 1902838_1 888278_speci-lodge -16 comparison to prior FP detection methods. The CCA FP detection algorithm is described in detail later. At a following step 404, the list 414 of detected FPs output from the previous stage 403 is processed to resolve the FPs into QR code regions 416. This process of 5 grouping FPs into QR code regions is referred to as 'resolving'. In the arrangements presently disclosed, two resolving algorithms are employed. The first, referred to as '3/3 resolving', forms QR code regions from groups of three detected finder patterns. The second resolving algorithm, referred to as '2/3 resolving', determines the possible QR code regions that could exist if it is assumed that one FP of 10 QR codes is not detected. By generating the possible QR code regions arising from this assumption, QR code regions can be resolved when only two of three finder patterns are initially detected by applying a later missing FP recovery step. This allows the realisation of a QR code decoding system that is overall far more robust than those of the prior art. Both 3/3 and 2/3 resolving algorithms will be explained in detail later. 15 At a following step 405, an attempt is made to extract encoded information 418 in each candidate QR code region. If the candidate QR code region comprises three detected FPs (the output of the 3/3 resolving algorithm), then the modules of the QR code region are sampled and information extracted using conventional, well-known methods. Otherwise, if the candidate QR code region comprises only two FPs (the 20 output of 2/3 resolving), then an attempt is made to acquire the third 'missing' FP. This process leverages additional information about detected finder patterns that is made available from the CCA FP detection method employed at step 403 and will be described in detail later. If a third finder pattern is acquired successfully, the QR code is sampled 1902838_1 888278_specilodge - 17 and information extracted through conventional, well-known methods. The process of extracting encoded information from a QR code region is known as 'decoding'. The process for decoding one or more QR codes in an acquired image is terminated at a final step 406. 5 Connected Components Analysis (CCA) The process of connected components analysis (CCA) employed at step 403 of the decoding process 400 is now described in detail. Connected Components Analysis (CCA) is a generic name for processes that identify continuous coloured or like-coloured regions in an image, such as black and/or 10 white regions. The arrangements presently disclosed employ a specific CCA that provides a much more robust FP detection method than that of the prior art, especially in the case where QR codes have been repeatedly printed and scanned. The CCA FP detection method 403 also facilitates the application of a resolving algorithm (employed at step 404) that is more efficient and precise than that of the prior art. The damaged FP 15 recovery algorithm employed at step 405 is also facilitated by the use of the CCA FP detector 403. The CCA algorithm employed at step 403 groups pixels with the same intensity in the binarized image 412 generated at step 402 so that continuous 'black' or 'white' regions are identified. Specifically, the CCA algorithm inspects each scanline of the 20 binarized image 412 sequentially from the topmost scanline to the bottommost scanline. Consecutive black pixels are referred to as a single 'run'. For a given scanline, each run is inspected to determine if it is connected to a run on a previous scanline. This is achieved by checking the left-most and right-most extents of the run, and determining if these extents overlap left-most and right-most extents of any run on the previous 1902838_1 888278_speci_lodge - 18 scanline. If the run is not connected to a previous run, then the run is established as the beginning of a new connected component (CC). Otherwise, if the run is connected to a previous run, then the previous run is a member of a previously established CC, and the run on the current subject scanline is appended to the previously established CC. 5 In the case where a run on current subject scanline connects two or more runs on the previous scanline, then all the CCs with runs connected to the run on the current subject scanline are merged to form a single CC. Thus, objects that begin with several disjoint components that come together at a lower point in the image may still be identified as being a single CC. 10 When a CC no longer has connected runs on a subject scanline, then the CC will be 'terminated'. That is, the CC is considered complete, as all of the pixels that belong to that CC have been identified. The CCA algorithm employed at step 403 detects QR finder patterns by searching for CC configurations where one continuous black CC is completely enclosed 15 by a continuous white CC that is in turn completely surrounded by a further black CC. This enclosure relationship is detected by a simple check performed when a CC is terminated. When terminated, a subject CC is checked to determine if there is another CC with left-, right-, top- and bottom-most extents that places it within the extents of the subject CC. If a CC exists within the bounds of the subject CC, then both CCs are 20 appended to the output list as a candidate FP. Otherwise, the CCs are discarded. Detecting QR finder patterns by searching for their topological relationship, i.e. the fact that they are composed of one black CC enclosed entirely within another, allows the above-described CCA method to provide far more robustness to print-scan introduced distortions than the methods of the prior art which rely heavily on the ideal 1902838_1 888278_speci_lodge -19 expected appearance 100 of FPs. Another feature of the above-described CCA method is that several useful FP metrics may be efficiently computed, and these can be applied to great advantage in the later resolving 404 and decoding 405 steps of the process 400. Specifically, at least the following information, referred to as 'metadata', about detected 5 FPs is determined: (i) Coordinates of the FP centre (average centre coordinates of the black connected components 101 and 103 of the FP 100); (ii) Size of black modules in the FP 100 (the stroke width of the black connected component 101); 10 (iii) Size of white modules in the FP 100 (the stroke width of the white connected component 102); (iv) Rotation of the FP 100 (this angle is modulo-90* and essentially corresponds to the angle of the sides of the CCs 101 and 102 that is between zero and 900 with respect to the coordinate system in use); 15 (v) Confidence of the FP 100 (this is calculated by comparing the appearance of the FP with the ideally expected appearance 100. FPs closely resembling the expected appearance will have confidences toward 100%); and (vi) Bounding box of the FP 100 (the left-, right-, top- and bottom-most extents of the outer black CC 101). 20 The FPs identified by the CCA method 403 are formed into the list 414 in which each list entry may be supplemented by some or all of the metadata associated therewith. General Resolving 1902838_1 888278_speci_lodge -20 A detailed description of the resolving process 404, is now described with reference to Fig. 5. The resolving process 404 begins at an initial step 501 in which the list 414 of detected FPs are input. At a following step 502, FPs are grouped into triplets, and checks are performed 5 to determine if the triplet forms a valid candidate 3/3 QR code region. At a following step 503, FPs are grouped into pairs, and checks are performed to determine if the pairs form a valid candidate 2/3 QR code region. The processes employed at steps 502 and 503 are described in detail later. The process 404 of resolving terminates at a final step 504. 10 3/3 Resolving The process for forming candidate 3/3 code regions, as employed at step 502, is described with reference to Figs 6, 7 and 9. At this point, two pre-determined parameters are introduced that allow some tolerance to warping and misalignment in the resolving method. These parameters are denoted as toleranceangle and tolerancemagnitude, 15 and both may be set to 0.2. These tolerances provide for the angles and distances to vary by 20% and yet still permit the FPs and thus the QR code to be detected. This permits detection in the presence of warping whilst preventing false positive detection. The tolerance may be varied as required based on a desired accuracy of the system. Turning to Fig. 6, there is shown the general process of resolving 3/3 regions. At 20 an initial step 601, the list 414 of detected FPs is input. At a following step 602, triplets of detected FPs undergo a series of checks to form a list 606 of 'potential' 3/3 regions. The process for carrying out these checks is described in detail later. 1902838_1 888278_specilodge -21 At a following step 603, each potential QR code region in the list 606 of 'potential' 3/3 regions are inspected to determine if they contain an 'internal' FP. The result of step 603 is a final list 608 of candidate 3/3 QR code regions. Again, the process for carrying out step 603 is described in detail later. 5 The process 502 of forming candidate 3/3 code regions is terminated at a final step 604. Find potential 3/3 regions The process 602 for forming the list 606 of potential 3/3 regions, is described with reference to Fig.7. 10 The process 602 begins at an initial step 701 in which the list 414 of detected FPs is input. At a following step 702, a list 710 of triplets is generated by first finding every combination of three FPs possible from the input list 414. From each of these combinations, six triplets are formed by assigning each FP to each of the possible 15 nominal FP positions of a QR code. That is, each FP is designated as being in the 'top left' corner, 'top-right' corner, or 'bottom-right' of the QR code in one of the six triplets. In the following description, attributes (such as module_size) relating to the FP assigned to the top-left will be subscripted with 'tl', and similarly 'tr' and 'bl' for the top-right and bottom-left FPs respectively. 20 At a following step 703, a triplet 712 from the list 710 of triplets generated at step 702 is selected. At a following step 704, the triplet 712 is checked to determine if the three finder patterns are reasonably similar in module size. The module size is the average of the black and white module sizes made available from the CCA FP detection method 1902838_1 888278_specilodge - 22 employed at step 403. In Fig. 8A, an example 801 of three FPs on which this check will fail because the FP module sizes are not substantially equal. The check for similar module sizes may be represented by Pseudocode 1 below: 5 **** Pseudocode 1 **** Step 704 **** if 10 abs (module_sizet 1 - module_sizeer) min(module_sizeci, modulesizetr) <= tolerancemagnitude and 15 abs (module-sizei - modulesizebi) min(modulesize, 1 , module_sizebi) <= tolerancemagnitude 20 and abs (modulesizebi - module_sizer) min(module sizebi, module_sizer) 25 ) <= toleranceagnitude check passed else: check failed 30 At a following step 705, the relative angles of the FPs are checked to determine if the angular orientations of the three FPs are substantially equal. As previously explained, the angle of rotation calculated for each FP is modulo 7r/2 radians (90'). Therefore, an adjustment is necessary to determine the smallest deviation between angles 35 of rotation of FPs. In Fig. 8B, an example 802 of three FPs on which this check will fail 1902838_1 888278_spedlodge - 23 because the angular orientations of the FPs are not substantially equal. This check may be performed by implementing Pseudocode 2: Pseudocode 2 **** Step 705 5 if abs anglei - angletr) <= toleranceangie x pi / 2 10 or pi / 2 - max(angleti, angler) + min(angle.
1 , angler) <= toleranceangle x pi / 2 15 and abs (angleti - anglebi) <= toleranceangie x pi / 2 or 20 pi / 2 - max(angleti, angle) + min(angleti, anglebi) <= tolerancengle x pi / 2 and 25 abs (anglebi - angletr) <= toleranceangle x pi / 2 or pi / 2 - max(anglebi, angler) + min(anglebi, angler) <= toleranceangle x Pi / 2 30 check passed else: check failed 35 Note that 'pi' refers to the mathematical constant 7r. At a following step 706, a check is performed to determine if the region defined by three detected FPs conforms to a square of a reasonable size given the module sizes of the FPs. This is achieved by first checking that the distances between the top-left and 1902838_1 888278_speci_lodge - 24 top-right FPs, and the top-left and bottom-left FPs are substantially equal. This check may be performed by implementing Pseudocode 3: *** Pseudocode 3 **** Step 706 - Part 1 **** 5 vectorXti-tr = xti - xtr vectoryti-tr = Yti - Ytr vectormagti-tr = sqrt (vectorXti-tr 2 + vector_yti-tr 2 ) 10 vectorxti-bl = xt- xbi vector_yti-bi = Yti - y bi vectormagilbl = sqrt (vectorXtl-b1 + vector_yt-bi 2 ) minvector mag = min(vector-magnibi, vectorXti1bi) 15 maxvector mag = max(vectormagtjb 1 , vectorXti1bi) if max vector_mag <= (minvector mag x (1 + tolerancemagnitude)) check passed else: 20 check failed Once it has been confirmed that the lengths of the vectors between the top-left and top-right FPs, and the top-left and bottom-left FPs are substantially equal, the next step is to check that the lengths of these vectors are reasonable given the modules sizes 25 of the FPs. Essentially, this checks that the lengths of the vectors are within those expected for QR codes of versions 1 (smallest) to 40 (largest). This check can be implemented with Pseudocode 4: Pseudocode 4 **** Step 704 - Part 2**** 30 modulesizeaverage = (module_sizeci + modulesizeer + module_sizebi) 3 35 if 1902838_1 888278_speci lodge - 25 vector magti-tr x (1 + tolerancemagnitude) 14 x modulesizeaverage 5 or vector magti-tr x (1 - tolerancemagnitude) 10 170 x module size-average or vectormagti-bi x (1 + toleranceagnitude) 15 14 x modulesizeaverage or 20 vectormagti-bi x (1 - tolerancemagnitude) 170 x module size-average 25 check failed else: check passed The check for a square arrangement of detected FPs involves a check for a 30 substantially orthogonal arrangement of FPs. This check may be performed by implementing Pseudocode 5: **** Pseudocode 5 **** Step 704 - Part 3 **** 35 dot-product = (vectorxtl-tr x vector_xtl-bl) (vector_Yti-tr x vectorytl-bl) 40 cos theta = dot-product / (vectormagji.tr x vectormagti.li) 1902838_1 888278_speci_lodge -26 if cos theta <= toleranceangle: check passed else: check failed 5 At a following step 707, a check is performed to determine if the region rotation matches the FP angles. The angle of rotation of the candidate region is defined as the vector angle between the top-left and top-right FPs. In Fig. 8C, an example 803 of three FPs on which this check will fail because the angular orientations of the FPs does not 10 match the orientation of the region. This check may be performed by implementing Pseudocode 6: **** Pseudocode 6 ***** Step 707 15 vector_angleti.tr = arctan2(vector_yti-tr, vectorXti-tr) if vectorangleti-tr < 0: vectorangleti-tr = vector angleti-tr + (2 x pi) vector_angleti-tr = ((4 x vectorangleti-tr)mod(2 x pi) / 4) 20 if abs (angleti - vectorangleti.tr) <= toleranceangie x pi / 2 25 or pi / 2 - max(angleti, vector_angleti.,r) + min(angleti, vector_angleti-tr) 30 ) <= toleranceangie x pi / 2 and abs anglerr - vectorangleti-tr) <= toleranceanie x pi / 2 35 or pi / 2 - max(angletr, vector_angleti-tr) + min(angletr, vector_angleti-tr) 1902838_1 888278_speci jodge -27 <= toleranceangie x pi / 2 and 5 abs (anglebi - vectorangleciter) <= tolerancengie x pi / 2 or pi / 2 - max(anglebi, vector_anglei.tr) 10 + min(anglebi, vector_anglei-,,) <= tolerancengle x pi / 2 check passed 15 else: check failed If all the above checks 704-707 are successful, as tested at step 714, the triplet 712 of FPs is appended to an output list 606 of potential 3/3 regions at step 708. Note 20 that each output potential region has associated with it a confidence value based on the confidences of the region's three FPs. This confidence can be calculated by implementing Pseudocode 7: **** Pseudocode 7 **** 25 confidenceregion = confidencei + confidencetr + confidencebi) / 3 The confidence value can be appended to the metadata for each FP in the list potential FPs. 30 If there are remaining triplets in the list of triplets generated at step 702, tested at step 716, processing returns to step 703. Otherwise, if all triplets have been processed, then the process 602 of forming the list 606 of potential 3/3 regions, is terminated at a final step 709. Find true regions 1902838_1 888278_speci_lodge -28 The process 603 for forming a list of true 3/3 regions, is described with reference to Fig.9. Valid QR code regions cannot contain additional detected finder patterns. Based on this requirement, the QR code region 1000 of Fig. 1OA is a valid region, as there are no additional detected finder patterns within the bounds 1001 of the region 5 1000. The QR code region 1010 seen in Fig. 1OB is not a valid QR code region as the region contains an additional detected FP 1012 with the region bounds 1011. An exception is made when the confidence of an 'internal' FP is considerably less than that of the three FPs of the region. This is because, in some rare cases, alignment patterns 1022 can be detected as finder patterns as shown in 1020 of Fig. IOC. In this situation 10 the confidence of the alignment pattern 1022 will be considerably lower than those of the detected finder patterns 1023, 1024 and 1025. Turning back to Fig.9, the process 603 of finding true 3/3 regions begins at an initial step 901 in which lists 606 of potential 3/3 regions and detected FPs are input. At a following step 902, a potential 3/3 region 910 is selected from the list 606 15 input in step 901. At a following step 903, it is determined whether the potential 3/3 region contains an additional finder pattern of high confidence. Essentially, all of the detected finder patterns except for the finder patterns forming the potential code region are checked to determine if they are inside the extents of the potential 3/3 region. 20 The processes for determining if a particular finder pattern is within a potential code region will now be described. Fig. 11 shows a QR code region 1100 comprised of top-left 1103, top-right 1101 and bottom-left 1102 FPs. A finder pattern 1109 is to be checked to determine if it is within the region 1100. First, vectors 1105 and 1106 1902838_1 888278_speci_lodge -29 between the top-left FP 1103 and the top-right 1101 and bottom-left 1102 FPs respectively are calculated. This can be achieved by implementing Pseudocode 8: **** Pseudocode 8 5 vector_Xtl-tr = Xti - Xtr vector_Yti-tr = Yti - Ytr vector_Xtibl = XtI -Xb vector ytl-bl = Ytl ~ Ybl 10 The position of the unknown corner of the region 1104 is then calculated, as shown in Pseudocode 9: **** Pseudocode 9 **** 15 Xbr = Xtl + vectorXtl-bl + vector_Xti-tr Ybr = Ytl + vector_ytl-bl + vector yti-tr Next, vectors 1107 and 1108 between the bottom-right corner of the region 1104 20 and the top-right 1101 and bottom-left 1102 FPs respectively are calculated. This can be achieved by implementing Pseudocode 10: Pseudocode 10 25 vector_Xbr-tr = -vector_Xtl.bl vectorYbr-tr = -vectorYtl-bl vectorXbr-bl = -vectorXti-tr vector_Ybr-bl = -vector yti-tr 30 Vectors 1110 and 1111 from the top-left 1103 and bottom-right 1104 corners of the region to the additional finder pattern to be checked 1109 are then constructed. This can be achieved with Pseudocode 11: **** Pseudocode 11 **** 35 vectorxti-fp = Xfp - Xti 1902838_1 888278_speci_lodge -30 vector_yti-fp = Yfp - Ytl vector_Xbr-fp = Xfp - Xbr vectorYbr-fp = Yfp - Ybr 5 Finally, it is determined whether the additional FP 1109 lies within the region 1100 by determining the following conditions: 1. if the angle of the vector 1110 between the top-left FP 1103 and the additional finder pattern 1109 is between the angles of the vectors 1105 and 1106 between the top-left FP 1103 and the top-right 1101 and bottom left 1102 FPs 10 respectively; and 2. if the angle of the vector 1111 between the bottom right corner 1104 and the additional finder pattern 1109 is between the angles of the vectors 1107 and 1108 between the bottom right corner 1104 and the top-right 1101 and bottom left 1102 FPs respectively. 15 If both conditions (1) and (2) are found to be true, then it is determined that the FP 1109 does lie within the region 1100. This check can be accomplished by implementing Pseudocode 12: ** Pseudocode 12 20 vector_angletijtr = arctan2 (vector_yti-tr, vectorXti-t) if vectorangleti-,r < 0: vector_angleti-t = vectorangleji-tr + (2 x pi) 25 vector_angleti-b 1 = arctan2 (vectoryti-bi, vectorxtl-bl) if vectorangletl-bi < 0: vectorangleti-bi = vectorangleti-bi + (2 x pi) vector_anglebr-tr = arctan2 (vectorYbr-tr, vectorXbr-tr) if vectoranglebr-tr < 0: 30 vectoranglebr-t- = vectoranglebr-tr + (2 x pi) vector_anglebr-bl = arctan2 (vectorYbr-bl, vectorXbr-bl) if vectoranglebr-bl < 0: 1902838_1 888278_speci_lodge -31 vectoranglebr-bi = vectoranglebr-bl + (2 x pi) vector_anglebr-fp = arctan2 (vectorYbr-fp, vector_br-fp) if vectoranglebr-fp < 0: 5 vectoranglebr-fp = vectoranglebrfp + (2 x pi) vector_angletl-fp = arctan2 (vector_ytl-fp, vector_xti-fp) if vectorangleilfp < 0: vectorangletl-fp = vectoranglet.fp + (2 x pi) 10 min-vector angleti = min (vector_angleti-tr, vectorangleti 1 bi) maxvector angleti = max (vector_angleti-tr, vectorangleti-bi) minvector angler = min (vector_anglebr-tr, vector_angler-bl) 15 maxvector angler = max (vector_angleb,-tr, vector_anglebrbl) if maxvector angleti - minvector-angleti 20 2 x pi maxvectorangleti 25 + minvectorangleti if 30 vector angletiep >= minvector angleti and vector angleti-fp <= maxvector anglet, 35 top left check passed else: top left check failed else: if 40 vector angletl-fp >= maxvector angleti or vector angletl-fp <= minvector angleti 1902838_1 888278_speci_lodge -32 top left check passed else: top left check failed 5 if maxvector anglebr - minvector angler 10 2 x pi maxvectoranglebr minvectoranglebr 15 if vector anglebr-fp >= minvector angler 20 and vector anglebr-fp <= max vector anglebr bottom right check passed else: 25 bottom right check failed else: if vector anglebr-fp >= max vector angler 30 or vector anglebr-fp <= minvector angler bottom right check passed else: 35 bottom right check failed if top left check passed 40 and bottom right check passed check passed else: 1902838_1 888278_specilodge -33 check failed The fact that QR codes must contain a 4 module size quiet region surrounding them can be exploited to enlarge potential 3/3 code regions for the purposes of the 5 internal FP check of step 903. This will reduce the number of false positive 3/3 regions that are identified as true 3/3 regions. Typically, an additional finder pattern cannot occur within 11 module sizes of the centres of detected finder patterns of a code region. This takes into account both the 4 module quiet zone and the width of two half finder patterns (7 modules). The size of the potential 3/3 region used for the internal FP check 10 could thus be enlarged by moving the four corners of the region outward by 11 module sizes. If it is determined that a potential 3/3 region contains an additional detected finder pattern, it is then determined whether the confidence of the additional detected finder pattern is considerably less than that of the detected finder patterns of the region. 15 This check can be accomplished by implementing Pseudocode 13: **** Pseudocode 13 **** if 20 conf idencef, 0.75 25 x min (conf idenceti, conf idencetr, conf idencebl) check passed 30 else: check failed 1902838_1 888278_specilodge -34 Turning back to Fig.9, if it is determined in step 903 that a potential 3/3 region does not contain an additional detected finder pattern of confidence similar to the detected finder patterns of the potential region, the potential 3/3 region is saved as a true 3/3 region in a following step 904. The saving may be performed to one of the 5 intermediate variables, such as the variable register 3360 in Fig. 33B. An accumulation of these savings commences formation of the list 608. If there are further unprocessed potential 3/3 regions, as tested at step 906, processing returns to step 902. Otherwise, if all potential 3/3 regions have been processed, then the process of forming the list 608 of true 3/3 regions, employed at step 10 603, is terminated at a final step 905. 2/3 Resolving A detailed description of the process 503 for forming candidate 2/3 regions, is described with reference to Figs. 12, 13, 16 and 19. The same two pre-determined tolerance parameters that were used in the previous description of 3/3 resolving, 15 toleranceangc and tolerancemagnitude, will also be used in resolving 2/3 regions. The same value of 0.2 will be used for both parameters. Turning to Fig. 12, there is shown the general process 503 of resolving 2/3 regions. At an initial step 1201, the list 414 of detected FPs is input. At a following step 1202, finder pattern pairs 1210 are found. These are pairs of 20 finder patterns matching a number of criteria indicating that they potentially form part of a QR code. At a following step 1203, potential 2/3 regions 1212 are found. Potential 2/3 regions 1212 are regions of the image 410/412 in which a QR code with an undetected finder pattern could potentially exist. 1902838_1 888278_specilodge - 35 At a following step 1204, the potential 2/3 regions 1212 found in step 1203 are checked to determine if they contain 'internal' FPs in the same way that potential 3/3 regions are checked in step 603. Potential 2/3 regions that do not contain such 'internal' FPs are determined to be true 2/3 regions 1214. 5 The process 503 of forming candidate 2/3 regions is terminated at a final step 1205. Find finder pattern pairs The process 1202 of finding finder pattern pairs is now described in more detail with reference to Fig. 13. At an initial step 1301, the list 414 of detected finder patterns 10 is input. At a following step 1302, a list 1312 of finder pattern pairs is generated by finding every combination of two FPs possible from the input list. For the purposes of this description, the two finder patterns in each finder pattern pair will be arbitrarily assigned the labels A and B. In the following description, attributes (such as 15 module_size) will be subscripted with 'A' and 'B' to indicate which FP they refer to. At a following step 1303, a pair 1314 of finder patterns is selected from the list 1312 generated in step 1302. At a following step 1304, the finder pattern pair 1314 is checked to determine if the two finder patterns are reasonably similar in module size. Fig. 14A shows an 20 example 1400 of where this check will not succeed. It can be seen that the module sizes of finder patterns 1401 and 1402 are considerably different. The check for similar module sizes may be represented by Pseudocode 14: Pseudocode 14 **** Step 1304 **** 25 if 1902838_1 888278_specilodge - 36 abs (modulesizeA - module_sizeB) 5 min(modulesize, module_sizeB) <= tolerancemgnitude check passed else: 10 check failed At a following step 1305, the angles of the FPs are checked to determine if the angular orientations of the two FPs are substantially equal. It must be noted that the angle of rotation for each finder pattern is modulo 7r/2 radians. Therefore, an adjustment 15 is necessary to determine the smallest deviation between the angles of rotation of the two finder patterns. Fig. 14B shows an example 1410 of where this check will not pass. It can be seen that the angles of finder patterns 1411 and 1412 are considerably different. This check may be performed by implementing Pseudocode 15: 20 **** Pseudocode 15 **** Step 1305 if 25 abs (angle - angle) <= tolerancen,1, x pi / 2 or (pi / 2) - max(angleA, angle) + min(angleA, angle) 30 toleranceangie x pi / 2 check passed 35 else: check failed Note that 'pi' refers to the mathematical constant 7r. 1902838_1 888278_specilodge - 37 At a following step 1306 the angle of the vector between the FPs checked to determine if it corresponds to the angles of the finder patterns for one of two possible 2/3 code region configurations. The two possible configurations of 2/3 regions are shown in Figs. 15A and 15B. The configuration 1500 of Fig. 15A, in which the two detected FPs 5 correspond to FPs along the side of the QR code 1501, will be referred to as a 'normal' type 2/3 region. The configuration 1510, of Fig. 15B, in which the detected FPs are on the diagonal of the QR code 1511, will be referred to as a 'diagonal' type 2/3 region. Fig. 15C shows an example 1520 of a pair of finder patterns to be checked. The check determines if the angle 1524 of the vector 1523 between the finder patterns 1521, 1522 is 10 consistent with either of the valid configurations 1500 and 1510 within the allowed angular tolerance toleranceangle. A consequence of this check is that the type of the FP pair, being normal or diagonal, is established. This check can be implemented using Pseudocode 16: 15 **** Pseudocode 16 vectorXA-B = XB - XA vectorYA-B = yB - YA vector_magA-3 = sqrt (vector-XA.B2 + vector yAB2 20 vectorangle-B = arctan2 (vectorYA-B, vectorXA.B) if vectorangleA.
8 < 0: vectorangleA-. = vector angleA-B + (2 x pi) 25 vector_angleA-B' = ((4 x vector_angleA.B)mod(2 x pi) / 4) anglediffA = abs(angleA - vectorangleA) anglediffA = min 30 anglediffA, pi / 2 1902838_1 888278_speci lodge - 38 max (angleA, vectorangleA-B') min(angleA, vectorangleA-B) 5 anglediff_45, = abs (anglediffA - pi / 4) anglediffB = abs (angleB - vectorangleA-B) 10 anglediffB = min angleditfB, 15 pi / 2 max (angleB, vectorangleA-B min (angle, vectorangleA-B') 20 anglediff_45 = abs(anglediffB - pi / 4) 25 if anglediffA < toleranceangie x pi / 2 and 30 anglediffB < toleranceangle x pi / 2 or anglediff_45A < toleranceangie x pi / 2 35 and anglediff_45B < toleranceangle x pi / 2 if 40 anglediff_45A < anglediffA and anglediff_45B < anglediffa 1902838_1 888278_speci Jodge - 39 region_ type = diagonal else: regiontype = normal 5 check passed else: check failed At a following step 1307, a check is made to determine if the length of the vector 10 between the two FPs is within the limits for QR code versions 1 - 40, allowing for the magnitude tolerance. This check can be performed by implementing Pseudocode 17: Pseudocode 17 15 modulesizeaverage = (modulesizeA + modulesizeB) / 2 if (regiontype == normal): if 20 vectormagA-B X (1 + tolerance,,gnitude) 14 x module size-average 25 or vectormagA.B x (1 - tolerancemagnitue) 170 x modulesize-average 30 check failed else check passed 35 else: if vectormagA-B x (1 + toleranceagnitude) 40 1.41 x 14 x modulesize average 1902838_1 888278_specilodge -40 or vector magA 8 B x (1 - tolerance,,agnitude) 5 1.41 x 170 x module-size-average check failed 10 else check passed If all the above checks 1304 - 1307 are successful, as tested at step 1310, the pair 1314 of FPs is appended to an output list 1210 of FP pairs at step 1308. If there are 15 remaining FP pairs in the list 1312 generated at step 1302, as tested at step 1311, processing returns to step 1303. Otherwise the process 1202 of finding FP pairs is terminated at a final step 1309. Find potential 2/3 regions The process 1203 of finding potential 2/3 regions is now described in more detail 20 with reference to Fig. 16. At an initial step 1601, the list 1210 of previously found finder pattern pairs is input. At a following step 1602, a finder pattern pair 1610 is selected from the list 1210 of finder pattern pairs input previously at step 1701. If the selected finder pattern pair 1610 has a "type" that is "diagonal", as tested in 25 step 1606, one diagonal type potential 2/3 region is generated in step 1603. If the selected finder pattern pair "type" is "normal", two normal type potential 2/3 regions are generated in step 1604. The implementations of steps 1603 and 1604 will be described subsequently. Note that for each potential 2/3 region 1612 output from steps 1603 and 1604, a confidence value based on the confidences of the region's two detected FPs is 30 calculated. This confidence can be calculated by implementing Pseudocode 18: 1902838_1 888278_speci_lodge -41 Pseudocode 18 **** confidenceregion = (confidenceA + confidence) / 2 5 If there are further unprocessed finder pattern pairs, determined at step 1607, processing returns to step 1602. Otherwise, the process 1203 of finding potential 2/3 regions is terminated at a final step 1605. The processing of step 1203 establishes a list 1212 of determined potential 2/3 regions which may be stored in the memory 3334. 10 The process 1603 of generating a diagonal type potential 2/3 region will now be described in detail. Fig. 17A shows an example 1700 of a diagonal type 2/3 region 1703 formed from a pair of detected finder patterns 1701 and 1702. As shown in the region of 1700, in the diagonal case the detected finder patterns correspond to the top-right and bottom-left FP positions in the QR code region. 15 Generating a potential 2/3 region from a finder pattern pair essentially involves determining the two possible locations for missing finder patterns in the region. This determines the extents of the potential 2/3 region. Fig. 18A shows an example 1800 of how the two possible locations of missing finder patterns are determined for diagonal type potential 2/3 regions. First, one of the two detected finder patterns 1801, 1802 is 20 selected as the reference finder pattern (finder pattern 1801 being selected in this example). Next, two vectors 1804 and 1806 are formed at angles offset by 450 1808 from the vector 1803 from the selected reference finder pattern 1801 to the other detected finder pattern 1802. The lengths of the vectors 1804 and 1806 are calculated from the length of the vector 1803 as shown in Pseudocode 19: 25 Pseudocode 19 vector_mag 4 60 4 = vectormag 4 6 03 / 1.41 vectormag 4 6 06 = vectormag 4 6 03 / 1.41 1902838_1 888278_specilodge -42 Note that the constant 1.41 approximates the square root of 2 in the above pseudocode. The endpoints of the vectors 1804 and 1806 determine the two possible locations 5 of missing finder patterns 1805 and 1807. With the two possible locations of missing finder patterns determined, the potential 2/3 region is fully defined and step 1603 is complete. The process of generating two normal type potential 2/3 regions 1604 will now be described in detail. Fig. 17B shows an example of two normal type 2/3 regions 1713 10 and 1714 formed from a pair of detected finder patterns 1711 and 1712. As shown in 1710, in normal type 2/3 regions the detected finder patterns correspond to two adjacent finder pattern positions on one side of the code region. For this reason, there can be two potential 2/3 regions formed from a single normal type finder pattern pair, as shown in 1710. Essentially, based on the detected finder pattern pair 1711, 1712, there could be a 15 QR code with a missing third finder pattern in either of the regions 1713 and 1714. For this reason, both potential 2/3 regions are generated in step 1604. Generating the two potential 2/3 regions for the finder pattern pair essentially involves determining, for each potential 2/3 region 1713 and 1714, the two possible locations of missing finder patterns. This process is the same for all normal type 20 potential 2/3 regions (i.e. it is the same for both 1713 and 1714), and is described subsequently. Once the process described below has been completed for both potential 2/3 regions (such as 1713, 1714) formed from a finder pattern pair, the step 1604 is complete. Fig 18B shows an example 1810 of a normal type potential 2/3 regions. For 25 normal type finder pattern pairs such as 1811, 1812, one normal type potential 2/3 region 1902838_1 888278_speci_lodge - 43 is formed on each side of the vector 1813 between the two detected finder patterns. Just one of the two possible potential 2/3 regions formed from finder pattern pair 1811, 1812 is shown in 1810. The process of determining the two possible locations of missing finder patterns 5 for the potential 2/3 region 1810 begins with forming two vectors 1814 and 1816 offset at 900 from the vector 1813 between the detected finder patterns 1811, 1812. The lengths of the vectors 1814 and 1816 are the same as that of the vector 1813. The endpoints of the vectors 1814 and 1816 determine the two possible locations of missing finder patterns 1815 and 1817. 10 Find true 2/3 regions The process 1204 of finding true 2/3 regions is now described in more detail with reference to Fig. 19. As previously explained in the description of 3/3 resolving, valid QR code regions cannot contain additional detected finder patterns, however an exception is made for when the detection confidence of an 'internal' FP is much lower 15 than the detected finder pattern pair of the code region. At an initial step 1901, a list 1212 of previously determined potential 2/3 regions is input. At a following step 1902, a potential 2/3 region 1910 is selected from the list 1212 input in step 1901. 20 At a following step 1903, it is determined whether the potential 2/3 region 1910 contains an additional finder pattern of high confidence. Essentially, all of the detected finder patterns except for the finder patterns forming the potential 2/3 region are checked to determine if they are inside the extents of the potential 2/3 region. 1902838_1 888278_spedlodge - 44 The process for determining if a particular FP is within a potential 2/3 region is essentially the same as that previously described for 3/3 resolving. To apply this process to potential 2/3 regions, the detected and missing FP locations must first be assigned to the standard FP position labels top-left, top-right, bottom-left and bottom-right. The 5 process of assigning standard FP position labels to the detected and possible missing FP locations will now be described for both normal and diagonal type potential 2/3 regions with reference to Figs. 20A and 20B. A diagonal type potential 2/3 region 2000 is shown in Fig. 20A. An additional finder pattern 2009 is to be checked to determine if it is within the potential 2/3 region. 10 First, one of the missing finder pattern locations 2003, 2004 is arbitrarily assigned the position of top-left FP. Subsequently, the other possible missing FP location is assigned the position of bottom-right FP. The two detected FPs 2001, 2002 are then assigned the positions of top-right and bottom-left FPs accordingly. The process of determining if the additional FP 2009 lies within the potential 2/3 region 2000 can now be carried out by 15 the method previously described for 3/3 resolving, using the following information: (i) Vectors 2005 and 2006 between the top-left FP 2003 and the top right 2001 and bottom-left 2002 FPs; (ii) Vectors 2007 and 2008 between the bottom-right FP 2004 and the top-right 2001 and bottom-left 2002 FPs; and 20 (iii) Vectors 2010 and 2011 from the top-left 2003 and bottom-right 2004 FPs to the additional finder pattern to be checked 2009. A normal type potential 2/3 region 2020 is shown in Fig. 20B. An additional finder pattern 2029 is to be checked to determine if it is within the potential 2/3 region. First, one of the detected finder pattern locations 2022, 2023 is arbitrarily assigned the 1902838_1 888278_specilodge - 45 position of top-left FP. Subsequently, the other detected FP location is assigned the position of bottom-left FP. The two possible missing FP locations 2021, 2024 are then assigned the positions of top-right and bottom-right FPs accordingly. The process of determining if the additional FP 2029 lies within the potential 2/3 region 2020 can now 5 be carried out by the method previously described for 3/3 resolving, using the following information: (i) Vectors 2025 and 2026 between the top-left FP 2023 and the top right 2021 and bottom-left 2022 FPs; (ii) Vectors 2027 and 2028 between the bottom-right FP 2024 and the 10 top-right 2021 and bottom-left 2022 FPs; and (iii) Vectors 2030 and 2031 from the top-left 2023 and bottom-right 2024 FPs to the additional finder pattern to be checked 2029. In the methods described previously for determining whether an additional FP lies within a potential 2/3 region, the extents of the potential 2/3 region were based on 15 the nominal predicted locations of the two possible missing finder patterns of the 2/3 region. Alternative methods may be used to define the extents of potential 2/3 regions for the internal FP check. One alternative is to apply the tolerances tolerancemagnitude and toleranceangic in determining the possible locations of missing finder patterns such that the extents of potential 2/3 regions are as small as possible (within the allowed 20 tolerances). This would be a more conservative approach than the approach detailed above, accounting for the possibility that warping has resulted in a smaller than expected QR code region. This would reduce false negatives, which are situations where a valid QR code region is erroneously eliminated by the internal FP check. 1902838_1 888278_speci lodge - 46 The fact that QR codes must contain a 4 module size quiet region surrounding them can be exploited to enlarge potential 2/3 code regions for the purposes of the internal FP check of step 1903. This will reduce the number of false positive 2/3 regions that are identified as true 2/3 regions. Typically, an additional finder pattern cannot 5 occur within 11 module sizes of the centres of detected finder patterns of a code region. This takes into account both the 4 module quiet zone and the width of two half finder patterns (3.5 modules each). The size of the potential 2/3 region used for the internal FP check could thus be enlarged by moving the four corners of the region outward by 11 module sizes. 10 If it is determined that a potential 2/3 region contains an additional detected finder pattern, it is then determined whether the confidence of the additional detected finder pattern is considerably less than that of the detected finder patterns of the region. This check can be accomplished by implementing Pseudocode 20: 15 **** Pseudocode 20 if confidencefp 20 < 0.75 x min(confidenceA, confidenceB) 25 check passed else: check failed 30 Turning back to Fig. 19, if it is determined in step 1903 that a potential 2/3 region does not contain an additional detected finder pattern of confidence similar to the 1902838_1 888278_speci_lodge - 47 detected finder patterns of the potential region, the potential 2/3 region is saved into memory 3334 as a true 2/3 region in a following step 1904. If there are further unprocessed potential 2/3 regions, as tested at step 1906, processing returns to step 1902. Otherwise, if all potential 2/3 regions have been 5 processed, then the process 1204 of forming the list 1214 of true 2/3 regions, is terminated at a final step 1905. The list 608 of true 3/3 regions and the list 1214 of true 2/3 regions collectively form the (expected) QR code regions 416 described above as being output from the resolving process 404. 10 Decoding Process The decoding process 405 is described with reference to Fig. 21. The decoding process 405 attempts to extract information from each 3/3 region (608) and 2/3 region (1214) in turn. A detected finder pattern may be shared by a number of 3/3 regions and 2/3 regions. This is because, at the conclusion of step 404, the presence of encoded data 15 in each of the 3/3 and 2/3 regions is yet unknown. That is, the regions 416 generated at step 404 are not confirmed QR codes, but rather regions likely to contain QR codes. At step 405, a region is confirmed as a QR code if data is successfully extracted from the region. Furthermore, QR codes may not share finder patterns with other QR codes. Therefore, once a QR code region is successfully decoded, any remaining regions 20 that share finder patterns with the successfully decoded code region are not processed. Thus, processing time is not wasted in attempts to decode regions that cannot form a QR code. The decoding process 405 begins at an initial step 2101 in which the list or lists of 3/3 regions and 2/3 regions are input. 1902838_1 888278_specilodge - 48 At a following step 2102, all 3/3 regions are processed in turn. This processing step, which involves attempting to extract coded information from code regions, is described in detail later. At a following step 2103, all 2/3 regions are similarly processed. 5 The decoding process 405 terminates at a final step 2104. The process of processing 3/3 regions employed at step 2102 is described in detail with reference to Fig. 22. At an initial step 2201, the list of 3/3 regions is received. At a following step 2202, the 3/3 regions are sorted by their region confidences to 10 ensure that regions with higher confidences are processed before regions with lower confidences. At a following step 2203, the next remaining 3/3 region in the list created in step 2202 is selected. At a following step 2204, an attempt is made to decode a region. Decoding uses 15 the three FPs of the region to identify the coded content of the QR code, Particularly the locations of each of the three FPs can be used to define a grid of data module locations from which the data modules in the code region are sampled and the encoded data is extracted. The process of sampling data modules and extracting coded data from a QR code once all three FPs of the code have been acquired is well known in the prior art and 20 need not be described further. If the region is successfully decoded, then any 3/3 regions remaining to be processed that share FPs with the current region are discarded at a following step 2205. Also, at step 2206 which follows step 2205, any 2/3 regions remaining to be processed that share FPs with the current region are also discarded. 1902838_1 888278_specilodge - 49 If there are 3/3 regions remaining to be processed, tested at step 2208, processing continues at step 2203. Where the decoding of step 2204 fails, the test of step 2208 follows. Once all 3/3 regions have been processed, the process 2102 is terminated at a 5 final step 2207. The processing of 2/3 regions employed at step 2103 is described in detail with reference to Fig. 23. At an initial step 2301, the list of remaining 2/3 regions is received, noting that some 2/3 regions may have been discarded in step 2206. 10 At a following step 2302, the 2/3 regions are sorted by their region confidences to ensure that regions with higher confidences are processed before regions with lower confidences. At a following step 2303, the next remaining 2/3 region in the list created in step 2302 is selected. 15 At a following step 2304, a third FP is sought in a process that is described in detail later. If a missing FP is successfully found in step 2304, processing continues at a following step 2305 in which an attempt is made to decode the region in a decode process identical to that employed at step 2204 using the two selected detected finder 20 patterns from step 2303 and the third finder pattern detected at step 2304. Decoded data may then be stored in the memory 3334 as, for example, the output variable 3362. If decoding is successful, then any 2/3 regions remaining to be processed that share FPs with the successfully decoded region are removed at step 2306 in a similar process as that employed at step 2206. 1902838_1 888278_specilodge -50 If there are 2/3 regions remaining to be processed, tested at step 2308, processing continues at step 2303. Where the detection at step 2304, or the decoding at step 2305 fails, the test of step 2308 follows. Once all the 2/3 regions have been processed, the process 2103 is terminated at a 5 final step 2307. Detect missing FP Template correlation is a known and very robust method for detecting and locating features in an image. In the context of the present disclosure, it is desired to detect and locate QR FPs. Template correlation, however, has several fundamental 10 disadvantages. Firstly, template correlation would require, in the context of the present disclosure, that the size of the QR FPs be pre-determined. Secondly, template correlation would require that the rotational orientation of the QR FPs be pre determined. These two restrictions would greatly limit the functionality of any QR FP detection system implementing template correlation. In the particular case of printed and 15 scanned QR codes, there is almost always some rotational misalignment of the QR code in the scanned image. In addition to the above two mentioned limitations, template correlation is a computationally expensive operation. Consequently, a QR FP detection system that employs template correlation on an entire scanned image could be impractically slow. 20 The present inventors have nevertheless developed a QR FP detection system that utilises template correlation in a manner that draws on its robustness, but overcomes the above-mentioned limitations. Broadly, the presently disclosed system employs the information gathered by the previously performed CCA to form a template that is adapted to the FP to be searched for, thereby maximizing correlation strength. In 1902838_1 888278_speci_lodge -51 essence, any distortions and misalignments introduced by printing and scanning cycles can be estimated from their effects on the two already detected FPs. This information can then be used to search for a missing damaged FP with greater efficiency and accuracy. 5 In addition, small search regions in the image may be estimated from the locations of the two already detected FPs. These search regions are the only possible areas in which a third missing FP can be located. Thus, the computationally expensive operation of template correlation is restricted to a small proportion of the image, resulting in a far more efficient detection system. 10 The process of detecting a missing FP, employed at step 2304 is described with reference to Fig. 24. The process begins at an initial step 2401 in which a 2/3 region is input. At a following step 2402, a pattern matching template is formed with reference to the two already detected FPs in the 2/3 region. Two effective methods for forming a 15 pattern matching template are described in detail later. At a following step 2403, candidate search regions are formed. A candidate search region is a small image region in which a third, missing FP may exist. The process 2403 of forming candidate search regions is described later. At a following step 2404, the pattern matching template generated at step 2402 is 20 applied to each candidate search region formed at step 2403. This step attempts to detect the third, missing FP by template correlation. If a missing FP is detected, and step 2404 thus successful, the 2/3 region is determined to be 'complete'. That is, all three FPs have been detected, and the data encoded in the QR code may be extracted. Therefore, if the missing FP is detected, then processing continues at step 2405, in which the 'complete' 1902838_1 888278_specilodge -52 region is appended to a list to be output from the process 2304. Otherwise, the 2/3 region does not form a valid QR code, and is discarded. The process 2304 of detecting a missing FP is terminated at step 2406. Forming template - from metadata 5 One process of forming a pattern matching template from CCA information, that may be employed at step 2402, is described in detail with reference to Fig. 25 as step 2402a. The process 2402a begins at an initial step 2501 in which a 2/3 region is input. At a following step 2502, information from CCA for the two already detected 10 FPs in the 2/3 region is acquired. As previously mentioned, CCA provides the following information regarding a detected FP: (i) Coordinates of the FP centre; (ii) Size of black modules in the FP; (iii) Size of white modules in the FP; 15 (iv) Rotation of the FP; (v) Confidence of the FP; and (vi) Bounding box of the FP. The size of black and white modules forming FPs gives an indication of the effect of dot gain. Thus, when two of three FPs in a QR code region have been detected, 20 dot gain information can be used to locate the third, missing FP. It is useful to obtain an average of module sizes between the two detected FPs. These averages may be computed by implementing Pseudocode 21: Pseudocode 21 25 averagemodule_sizeblack = (module_sizeblack, fpO + module_sizeblack, fpl) / 2 1902838_1 888278_specilodge -53 averagemodule_sizeite = (module_sizehite, fpo + module_sizehite. Epi) / 2 At a following step 2503, information acquired from CCA is used to generate a pattern matching template. In step 2503, a template 2700 (seen in Fig. 27) of a QR FP is 5 formed in the memory 3334 conforming to the following ratios of black and white widths, as in Pseudocode 22. The label "average_modulesize" is abbreviated as "ams" for convenience of representation. **** Pseudocode 22 **** 10 amsblack : amswhite : 3 x amsbiack : amswhite amsblack **** Pseudocode 22 **** average_module_sizeblack: 15 averagemodule_sizewhite: 3 x average-module_sizeblack: average_module_sizeite: average_module_sizeblack 20 As seen in Fig. 27, the outer black region 2701 of the FP template 2700 will have a stroke width 2704 of averagemodule sizebIack. Also, the white region 2702 will have a width 2705 of average modulesizewhite. Lastly, the inner black region 2703 will have a width 2706 of three times average modulesizeback. Subsequently, the template 2700 is rotated to account for the angle of the already 25 detected FPs. This is seen in Fig. 28 with reference to a rotated template 2800 where the average angle 2801 (angleaverage) between the two detected FPs, anglepo and anglerpt, is computed by implementing Pseudocode 23: ** Pseudocode 23 30 if 1902838_1 888278_specilodge - 54 abs (anglepo - anglefep) 5 pi / 2 max(anglefpo, anglefpi) min (anglepo, anglepi) 10 angleaverage = min (anglepo, anglep) 15 pi / 2 max (anglepo, angleepi) 20 2 25 if angleaverage <: angleaverage = pi / 2 + angleaverage else: angleaverage = 30 anglepo anglepi 35 2 A detailed description of rotating a template by a specified angle is not provided herein as a variety of well-known methods may be employed, such as an affine transformation with interpolation. 1902838_1 888278_speci_lodge -55 Once a template 2800 incorporating dot gain information and angular rotation information is formed, the process 2402a of forming a pattern matching template from CCA information is terminated at a final step 2504. Forming template - Cut out and average 5 Fig. 26 shows an alternative method 2402b of forming a pattern matching template, which may be employed at step 2402. Here, a template is created by cutting out from the input or binarized image 410, 412, the two already detected FPs, and then scaling and averaging those two already detected FPs. The process 2402b begins at an initial step 2601 in which a 2/3 region is input. 10 At a following step 2602, the two already detected FPs in the 2/3 region are cropped from the acquired image using the bounding box information of each FP. The two cropped images may differ slightly in height and width, and so scaling is then employed in step 2602 to scale both images to the average height and width of the two detected FPs. Again, an affine transformation may be used to accomplish this goal. 15 At a following step 2603, each pixel from the two scaled representations of the FPs is averaged by summing the two pixel intensities and dividing that sum by two. The result is a template that is an averaged representation of the detected FPs encompassing any noise and distortion effects introduced by printing and scanning operations. The process 2402b of forming a template 2402 terminates at a final step 2604. 20 Search regions The process 2403 of forming candidate search regions potentially containing a third finder pattern is now described in detail with reference to Figs. 29A to 30. Fig. 29B shows an example of a normally oriented 2/3 region 2910 and Fig. 29A shows an example of a diagonally oriented 2/3 region 2900. The process 2403 of 1902838_1 888278_specilodge - 56 generating search regions differs depending on whether a normally or diagonally oriented 2/3 code region is to be processed at step 2403. The appropriate processes for both types of 2/3 region are described below. In the normally oriented 2/3 region 2910 of Fig. 29B, two rectangular search 5 regions 2913 and 2914 are formed about or adjacent to the detected finder patterns 2911 and 2912. This may be achieved by forming two lines 2916 and 2917 perpendicular to a line 2915, the lines 2916 and 2917 running through the centres of the respective detected finder patterns 2911 and 2912. The lines 2916 and 2917 define the locations of the search regions 2913 and 2914 through a process to be described later with reference to 10 Fig. 30. Note that the 2/3 region 2910 shown in Fig. 29B is only one of two possible 2/3 regions that will have been formed from the two detected finder patterns 2911 and 2912 in the step 404. Another 2/3 region will also have been formed to the left of finder patterns 2911 and 2912, however search regions for this 2/3 region can be formed in the same way as for the region 2910 shown in Fig. 29B. 15 In the diagonally oriented 2/3 region 2900 of Fig. 29A, the two rectangular search regions 2903 and 2904 are formed about or adjacent to the detected finder patterns 2901 and 2902. Here, two lines 2905 and 2907 are formed at 450 to a line 2906 that passes through the centres of the two detected finder patterns 2901 and 2902. Both of these lines 2905 and 2907 must pass through the centre of one of the two detected finder 20 patterns 2901, 2902. The selection of the central FP is arbitrary. These lines 2905 and 2907 define the locations of the search regions 2903 and 2904 through the process to be described next with reference to Fig. 30. Fig. 30 shows a detected finder pattern 3001 and an adjacent search region 3017 located on a line 3002. Fig. 30 shows how a search region is formed based on a finder 1902838_1 888278_specilodge - 57 pattern in a 2/3 region and a known line passing through the centres of the finder pattern and the search region. Referring back to the normally oriented code region 2910 of Fig. 29, note that the arrangement shown in Fig. 30 could correspond to the finder pattern 2911 and adjacent search region 2913 (on line 2916), or alternatively, to the finder 5 pattern 2912 and adjacent search region 2914 (on line 2917). Referring to the diagonally oriented code region 2900 of Fig. 29A, further note that the arrangement of Fig. 30 could correspond to the central finder pattern 2901 and either of the adjacent search regions 2903 or 2904 (on lines 2905 and 2907 respectively). The centre 3013 of the search region 3017 corresponds to an expected location of 10 a missing finder pattern. The distance 3015 between the finder pattern 3001 and the centre 3013 of the search region 3017 is the nominal distance (to be referred to as Dnom) between adjacent finder patterns in the code region being processed. In a normally oriented code region, such as the code region 2910, the nominal distance Dnom is the distance between the centres of finder patterns 2911 and 2912 along line 2915. This can 15 be represented by Pseudocode 24: **** Pseudocode 24 **** Dnom, normal = distance(first detected FP to second detected FP) 20 In a diagonally oriented code region such as the code region 2900, the nominal distance Dnom is the distance between the centres of finder patterns 2901 and 2902 along the line 2906, divided by 1.41. This can be represented by Pseudocode 25: 25 **** Pseudocode 25 **** Dnom, diagonal = distance(first detected FP to second detected FP) / 1.41 Note that the constant 1.41 as used above approximates the square root of 2. 1902838_1 888278_specilodge - 58 The boundaries of the rectangular search region 3017 are defined such that the region is as small as possible, whilst still including all of the control points 3007, 3008, 3009, 3010, 3011 and 3012. Note that the rectangular search region is always oriented with sides parallel to the axes (e.g. 3020 and 3021) of the coordinate system in use, 5 regardless of the angle of the line 3002. This is because such rectangular and normally oriented search regions allow for a simple implementation of the later template matching process. The locations of the points defining the boundaries of the rectangular search region 3017 are based on the application of both a magnitude tolerance tolerancemagnitude 10 and angle tolerance toleranceangle to the expected location of the undetected finder pattern 3013. The point 3009 is found as the endpoint of the vector 3004 from the finder pattern 3001 along the line 3002 of length Dmax 3016. The length Dmax can be calculated as follows: 15 **** Pseudocode 26 Dnax = (1 + tolerancemgnitude) x Dnom The point 3012 is found as the point along the vector 3004 at a distance Dmin 20 3014 from the finder pattern 3001. The distance Dmin can be calculated as follows: ** Pseudocode 27 Dmax = (1 - tolerancemgnitude) x Dnom 25 A vector 3003 is found by rotating the vector 3004 away from the line 3002 by toleranceangle 3006. The points 3007 and 3008 are found at distances Dmin and Dmax along this vector, respectively. The points 3010 and 3011 are found similarly along vector 3005, rotated toleranceange 3006 in the other direction from line 3002. 1902838_1 888278_speci_lodge - 59 In this implementation, rectangular search regions with sides parallel to the axes of the coordinate system are used, however one skilled in the art will recognise that any search region formed using methods similar to those described herein may alternatively be used. The arrangements described herein teach that search regions should be formed 5 based on the expected locations of missing finder patterns and some applied tolerances, resulting in search regions of sizes on the order of the size of the potential code region (i.e. much smaller than the whole page). In the presently described implementation, a magnitude and angle tolerance is used, and a rectangular search region is fitted to the area defined by those tolerances. Conceivably, an alternative means of applying a 10 tolerance to the expected location of missing finder patterns may be employed to define search regions of any shape without departing from the present teachings. Applying the template At step 2404, the template formed at step 2402 is applied in a template correlation process in the search regions identified at step 2403. 15 Two-dimensional (2D) correlation is a well-known method for detecting and locating a sought-after feature in an image. 2D correlation involves passing a template over the content contained in a search region to yield a 2D correlation map. Each point in the correlation map indicates the similarity of the template and overlapping search area at that point. Thus, a sharp peak in the correlation map indicates that a feature 20 resembling the template is present in the content of the search region at the coordinates of the peak. The content in the QR codes being the individual black and white modules that collectively form the code. In step 2404, 2D correlation with the FP template formed at step 2402 is applied on each search region specified by step 2403 to determine if a third FP is present. In 1902838_1 888278_specilodge - 60 determining whether a third FP is present, a predetermined peak strength threshold is applied. If the highest peak of the correlation maps of either of the search regions is higher than the pre-determined threshold, an FP is determined to exist in that search region at the location of the peak. If an FP is found in both search regions, the third FP 5 of the 2/3 region is determined to be the FP with the higher peak in the corresponding correlation map. If a third FP is successfully found, processing continues at step 2405 to output a complete QR region. If a correlation peak of strength greater than the pre determined correlation peak threshold could not be found in either of the search regions specified by step 2403, the template matching process 2404 is deemed a failure and 10 processing continues at step 2406 where the process 2304 concludes. An alternative method of template correlation, as applied at step 2404, involves a one-dimensional correlation (instead of the 2-D correlation method described). A one dimensional correlation involves taking a 'slice' through the described 2-D pattern matching template formed at step 2402. A 'slice' is a cross-section through the centre 15 point of the template, oriented at the same angle of rotation, angleaverage, as the template and forms a search region. Subsequently, a line-by-line search is performed through the search regions. If the search yields a line of pixels resembling the template 'slice', then the third FP is deemed to have been successfully found. Additionally, the search may be performed at a direction perpendicular to the angle of rotation, angleaverage. 20 Alternative Implementations An alternative implementation to QR code detection and decoding exploits the inherent features of a QR code to aid in the process of detecting a missing FP in a 2/3 region. 1902838_1 888278_speci_lodge -61 In this alternative implementation, the process 2304 of detecting a missing FP is altered to the process 2304a seen in Fig. 32 and which comprises an additional region confirmation step 3201, with other steps being the same as described and numbered above. 5 In a first example of the region confirmation step 3201, a clocking pattern is sought. As seen in Fig. 31, QR codes comprise clocking patterns 3102 that run between FPs. These clocking patterns 3102 consist of alternating black and white modules that run in a straight line from the top-left FP to the bottom-left and top-right FPs. Consequently, a simple check may be implemented to detect a linear progression of 10 alternating black and white modules leading away from each of the two already detected FPs. If alternating black and white modules resembling a clocking pattern are detected, then the region confirmation step 3201 is successful and step 2402 described above follows. Otherwise, the region confirmation step 3201 fails and step 2406 follows. A second example of the region confirmation step 3201 inspects the frequency 15 characteristics of the code region. The QR code module size may be calculated from the two already detected FPs. Therefore, frequency analysis techniques (such as a 2-D Fourier Transform) may be used to determine if the frequency of black and white modules in the code region matches that of the detected FPs. Specifically, it is expected that the energy in the code region is concentrated at a frequency that maps to the QR 20 code module size. If this is the case, then the region confirmation step 3201 is successful and step 2402 follows. Otherwise, the region confirmation step 3201 fails and step 2406 follows. A further alternative implementation to QR code detection and decoding exploits version information 3104 in a QR code, as seen in Fig. 31, to aid in the check of step 1902838_1 888278_speci_lodge - 62 1307 (Fig. 13), which checks if the FPs conform to QR code versions 1 - 40. QR codes larger than version 6 encode the code's version in close proximity to the QR code finder patterns. The version information is error-corrected and may be decoded using known methods. Given a QR code module size (calculated from detected FPs), the QR code 5 version may be used to determine the physical size of the QR code in pixels. Thus, at step 1307, a check may be made to determine if the distance between detected FPs is consistent with the physical size of the QR code (as determined by decoding version information). Conclusion 10 CCA of itself is an imperfect tool for finder pattern detection. Whilst CCA is fast and inexpensive, it is unable to detect finder patterns that have been topologically damaged, for example where the inner component 103 is found to be connected to the outer component 101, or there is a cut or break in the outer component. However by combining CCA with template matching and limiting the combination to regions where 15 finder patterns are expected, the present inventors have found that the advantages of CCA (robust to size, rotation and dot gain) combine with those template matching (robust to topological damage) whilst avoiding the corresponding disadvantages. With this approach, missing finder patterns can be reliably located permiting efficient QR code decoding where previously decoding was computationally expensive or prone to 20 errors. INDUSTRIAL APPLICABILITY The arrangements described are applicable to the computer and data processing industries and particularly for the detection and decoding of QR codes in documents. 1902838_1 888278_specilodge -63 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. (Australia Only) In the context of this specification, the word "comprising" 5 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. 10 1902838_1 888278_speci_lodge

Claims (14)

1. A method of decoding a QR code having two initially detected finder patterns, said method comprising the steps of: 5 (a) forming a pattern matching template based on characteristics of the detected finder patterns; (b) determining at least one candidate region about the detected finder patterns, the candidate region being based at least on the relative position of the detected finder patterns in the QR code; 10 (c) locating a previously undetected third finder pattern of the QR code in the at least one candidate region by correlating content of the candidate region with the pattern matching template; and (d) decoding the QR code with each of the two initially detected finder patterns and the third finder pattern. 15
2. A method according to claim 1 wherein the two initially detected finder patterns are detected using connected component analysis.
3. A method according to claim 1 wherein the characteristics of the detected finder 20 patterns comprise the detected finder patterns' angle of rotation, and module size.
4. A method according to claim 3 wherein the characteristics of the detected finder patterns further include black and white module sizes. 1902838_1 888278_speci_lodge - 65 5. A method according to claim 1 wherein the characteristics of the detected finder patterns are based on the intensity values of pixels of at least one of the detected finder patterns.
5
6. A method according to claim I wherein step (d) comprises decoding the QR code with the location of the third finder pattern and the locations of the two initially detected finder patterns.
7. A computer readable storage medium having a computer program recorded 10 thereon, the program being executable by computer apparatus to decode a QR code having two initially detected finder patterns, said program comprising: code for forming a pattern matching template based on characteristics of the detected finder patterns; code for determining at least one candidate region about the detected finder 15 patterns, the candidate region being based at least on the relative position of the detected finder patterns in the QR code; code for locating a previously undetected third finder pattern of the QR code in the at least one candidate region by correlating content of the candidate region with the pattern matching template; and 20 code for decoding the QR code with each of the two initially detected finder patterns and the third finder pattern.
8. A computer readable storage medium according to claim 7 wherein the two initially detected finder patterns are detected using connected component analysis. 1902838_1 888278_speci_lodge -66
9. A computer readable storage medium according to claim 7 wherein the characteristics of the detected finder patterns comprise an angle of rotation of the detected finder patterns, and module size. 5
10. A computer readable storage medium according to claim 9 wherein the characteristics of the detected finder patterns further include black and white module sizes. 10
11. A computer readable storage medium according to claim 8 wherein the characteristics of the detected finder patterns are based on the intensity values of pixels of at least one of the detected finder patterns.
12. A computer readable storage medium according to claim 7 wherein said code for 15 decoding comprises code for decoding the QR code with the location of the third finder pattern and the locations of the two initially detected finder patterns.
13. A method for detecting and decoding a QR code, said method being substantially as described herein with reference to any one of the embodiments as that embodiment is 20 illustrated in the drawings.
14. Computer apparatus adapted to perform the method as claims in any one of claims 1 to 7 or 13. 1902838i.DOc 888278_specilodge - 67 Dated this 22nd December 2008 CANON KABUSHIKI KAISHA Patent Attorneys for the Applicant Spruson&Fergsuon 5 1902838_1 888278_speci_lodge
AU2008261179A 2008-12-22 2008-12-22 QR code decoding system Ceased AU2008261179B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
AU2008261179A AU2008261179B2 (en) 2008-12-22 2008-12-22 QR code decoding system
US12/628,425 US9355293B2 (en) 2008-12-22 2009-12-01 Code detection and decoding system
JP2009285726A JP5393428B2 (en) 2008-12-22 2009-12-16 Code detection and decoding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
AU2008261179A AU2008261179B2 (en) 2008-12-22 2008-12-22 QR code decoding system

Publications (2)

Publication Number Publication Date
AU2008261179A1 AU2008261179A1 (en) 2010-07-08
AU2008261179B2 true AU2008261179B2 (en) 2011-04-28

Family

ID=42313403

Family Applications (1)

Application Number Title Priority Date Filing Date
AU2008261179A Ceased AU2008261179B2 (en) 2008-12-22 2008-12-22 QR code decoding system

Country Status (1)

Country Link
AU (1) AU2008261179B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2010257441B2 (en) * 2010-12-24 2012-09-20 Canon Kabushiki Kaisha Method, apparatus and system for identifying candidate pairs of finder patterns of a barcode

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070228171A1 (en) * 2006-03-28 2007-10-04 Mohanaraj Thiyagarajah Method and apparatus for locating and decoding a two-dimensional machine-readable symbol

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070228171A1 (en) * 2006-03-28 2007-10-04 Mohanaraj Thiyagarajah Method and apparatus for locating and decoding a two-dimensional machine-readable symbol

Also Published As

Publication number Publication date
AU2008261179A1 (en) 2010-07-08

Similar Documents

Publication Publication Date Title
US9355293B2 (en) Code detection and decoding system
US10783613B2 (en) Content-based detection and three dimensional geometric reconstruction of objects in image and video data
US6366696B1 (en) Visual bar code recognition method
JP2835274B2 (en) Image recognition device
US7636483B2 (en) Code type determining method and code boundary detecting method
US6895116B2 (en) Automatically extracting graphical bar codes
Yang et al. Binarization of low-quality barcode images captured by mobile phones using local window of adaptive location and size
Lin et al. Real-time automatic recognition of omnidirectional multiple barcodes and dsp implementation
JP2010170539A5 (en)
Tribak et al. QR code recognition based on principal components analysis method
US20100201114A1 (en) Page mark-up using printed dot barcodes
US9922263B2 (en) System and method for detection and segmentation of touching characters for OCR
US8934660B2 (en) Two dimensional information symbol
AU2008261179B2 (en) QR code decoding system
US11893764B1 (en) Image analysis for decoding angled optical patterns
KR100726473B1 (en) Apparatus for classifying an image and method therefor
Gallo et al. Reading challenging barcodes with cameras
EP3929806A2 (en) Local encoding of intrinsic authentication data
Valiente et al. A process for text recognition of generic identification documents over cloud computing
CN114444531A (en) Method and system for collecting data for training Machine Learning (ML) models
AU2014277851A1 (en) Detecting a gap between text columns from text line fragments
US20150178255A1 (en) Text line fragments for text line analysis
Liu et al. QR code positioning algorithm
AU2010257441B2 (en) Method, apparatus and system for identifying candidate pairs of finder patterns of a barcode
JPH04112276A (en) Binary picture contour line chain encoding device

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