Abstract:
Methods, media, and mobile devices for providing information associated with a visual code are provided. In some embodiments, methods for providing information associated with a visual code are provided, including capturing an image including a visual code and non-visual code regions using a mobile device; selecting a non-visual code region of the non-visual code regions based at least in part on the visual code and an orientation of the mobile device relative to the visual code; retrieving information associated with the selected non-visual code region; and displaying the retrieved information on the mobile device.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation of U.S. patent application Ser. No. 11/105,150, filed Apr. 13, 2005, which is hereby incorporated by reference herein in its entirety. This application also claims the benefit of U.S. Provisional Patent Application Ser. No. 60/563,669, filed Apr. 20, 2004, which is hereby incorporated by reference herein in its entirety. 
     
    
     FIELD OF THE INVENTION 
       [0002]    The present invention relates to methods, media, and mobile devices for providing information associated with a visual code. 
       BACKGROUND OF THE INVENTION 
       [0003]    Barcodes have been utilized for identifying and pricing objects for more than thirty years. Most typically, barcodes are used in retail to identify the item of merchandise. For example, a gallon of milk may contain a barcode that, when scanned, will notify the cashier of the price of the milk. 
         [0004]    Yet in recent years, barcodes have acquired new purposes as computers and barcode scanners have become more portable. The circuitry required to scan a conventional one-dimensional barcode can now be housed in a device as small as a typical keychain. As a result, many mobile telephones, personal digital assistants (“PDAs”), and pagers can be retrofitted with or connected to a laser-based scanning device. This allows the mobile device to function as a scanner capable of storing hundreds or thousands of scanned barcodes. 
         [0005]    Mobile devices with attached scanners have allowed for the development of a new niche in the wireless electronics business. Some companies have developed software and hardware which allows a user to scan any barcode and be redirected to media information (e.g., a website, product description, price, etc.) about the scanned product. These programs provide a link between the physical and online world which previously did not exist. 
         [0006]    However, mobile devices with attached scanners possess some drawbacks which have curtailed their expansion into the mobile marketplace. First, there are few mobile devices produced for the general public that contain integrated laser-based scanners. Therefore, for a user to acquire scanning capability for a mobile device, he/she must purchase additional equipment. The additional scanning equipment also adds size and weight to the mobile device, thereby reducing its mobility. 
         [0007]    Currently, many cell phones and mobile devices are available with built-in cameras. The explosion of the availability of affordable digital cameras and their inclusion into mobile devices is driven by several factors. One of the most important is the recent availability of inexpensive image sensors based on CMOS technology. The cameras on these devices provide a means for capturing the barcode information which was previously only accessible via a laser-based scanner. Decoding barcode images from digital cameras included in mobile devices presents several difficult problems. These problems go well beyond the challenges addressed in commercial barcode readers. 
         [0008]    Therefore, there clearly exists a need for a visual code system which is capable of being decoded on a camera-equipped mobile device. The visual code system should be able to be decoded from a wide range of angles and distances for use in different applications. 
       SUMMARY OF THE INVENTION 
       [0009]    Methods, media, and mobile devices for providing information associated with a visual code are provided. In some embodiments, methods for providing information associated with a visual code are provided, including capturing an image including a visual code and non-visual code regions using a mobile device; selecting a non-visual code region of the non-visual code regions based at least in part on the visual code and an orientation of the mobile device relative to the visual code; retrieving information associated with the selected non-visual code region; and displaying the retrieved information on the mobile device. 
         [0010]    In some embodiments, methods for providing information associated with a visual code are provided, including capturing an image including a visual code and non-visual code regions using a mobile device; identifying regions in the image including the visual code and at least one non-visual code region; calculating at least one of orientations and shapes of at least one of the identified regions; locating the visual code based at least in part on the at least one of the orientations and shapes of the at least one of the identified regions; reading encoded bits in the visual code to produce a decoded value; determining an orientation of the mobile device relative to the visual code; selecting a non-visual code region of the at least one non-visual code region of the at least one identified regions based on the orientation of the mobile device relative to the visual code; retrieving information associated with the selected non-visual code region based at least in part on the decoded value; and displaying the retrieved information on the mobile device. 
         [0011]    In some embodiments, mobile devices for providing information associated with a visual code including a screen; a digital camera; and a processor in communication with the screen and the digital camera are provided, wherein the processor: receives an image including a visual code and non-visual code regions from the digital camera; selects a non-visual code region of the non-visual code regions based at least in part on the visual code and an orientation of the mobile device relative to the visual code; retrieves information associated with the selected non-visual code region; and displays the retrieved information on the mobile device. 
         [0012]    In some embodiments, mobile devices for providing information associated with a visual code including a screen; a digital camera; and a processor in communication with the screen and the digital camera are provided, wherein the processor: captures an image including a visual code and non-visual code regions using the digital camera; identifies regions in the image including the visual code and at least one non-visual code region; calculates at least one of orientations and shapes of at least one of the identified regions; locates the visual code based at least in part on the at least one of the orientations and shapes of the at least one of the identified regions; reads encoded bits in the visual code to produce a decoded value; determines an orientation of the mobile device relative to the visual code; selects a non-visual code region of the at least one non-visual code region of the at least one identified regions based on the orientation of the mobile device relative to the visual code; retrieves information associated with the selected non-visual code region based at least in part on the decoded value; and displays the retrieved information on the mobile device. 
         [0013]    In some embodiments, a visual code system lets a camera-equipped mobile devices act as sensors and decoders for proprietary two-dimensional visual codes. The visual codes can be printed on paper documents, displayed on electronic screens, or attached to physical objects and act as a key to access object-related information and functionality. 
         [0014]    Enhancing mobile devices in this manner is promising, because they are in constant reach of their users and are thus available in many everyday situations. They provide continuous wireless connectivity, and models with integrated cameras are becoming more and more popular. The ability to detect objects in the user&#39;s immediate vicinity strengthens the role of mobile phones in m-commerce, education, and gaming scenarios. Additionally, it offers a natural way of interaction and makes data entry more convenient. 
         [0015]    The visual code system provides the basis for superimposing textual or graphical information over the camera image in near real-time, providing the user with the sense of “augmented reality.” This allows for a wide assortment of application possibilities in situations where information is to be closely linked to physical objects. An example is the maintenance of devices or apparatuses in the field. For example, individual parts of an apparatus may be associated with different visual codes. By decoding different visual codes, graphical information, which is aligned with the items in the image, can be superimposed over the camera image. Further application possibilities include showing maintenance instructions, ordering spare parts, checking a maintenance schedule, etc. Other closely related applications include convenient order placing in mail-order catalogs, entering reference numbers in online banking applications, linking up-to-date online content to newspapers, supporting mobile marketing advertising campaigns, integration with TV commercials, vote-now, or buy-now TV spots, booking tickets for events, and simplifying interaction with the mobile device itself. 
         [0016]    A features of some embodiments of the present invention is a built-in orientation-independent coordinate system, rotation angle determination, tilting determination, and distance determination that enable a large number of applications, such as item selection and form entry. The recognition algorithm precisely determines the coordinates of a targeted point relative to the coordinate system that is defined by the visual code. The coordinates are independent of the orientation, tilting, or rotation of the visual code in the camera image. This allows the application to associate each point on the viewed image (and therefore arbitrarily shaped areas) with information and with specific operations. In this manner, a single visual code can be associated with multiple such areas (e.g., the individual cells of a table or elements and regions of an image). 
         [0017]    The recognition algorithm provides the rotation angle of the visual code in the camera image as an additional input parameter. This can be employed to simplify the interaction with the mobile device. Simply by changing the orientation of the mobile device, different information is displayed, without requiring any interactions via the keypad. Horizontal and vertical tilting is used as an additional input parameter in the same manner as described above (i.e., associating different information with different tilting angles). The mapping between the image coordinate system and the code coordinate system is also used to un-warp projective distortion in the camera image, which allows the automatic capture of form elements. Individual fields of the printed form are un-warped to remove the distortion and thus prepare them for further processing, such as transmitting them to an online server. 
         [0018]    Interaction Scenarios 
         [0019]    New interaction possibilities open up when mobile phones or PDAs are enhanced to act as sensors for real-world objects. The gap between the physical world surrounding the user and the virtual world is narrowed by offering a natural way of “picking up” data in everyday situations. Information becomes collocated with physical entities and is thus situated and grounded in the real-world context. Mobile phones are in an excellent position to contribute to this vision, because they are ubiquitously available devices, constantly within reach of the user. The short interaction time required for recognizing codes is crucial for usability in a mobile setting. It does not require much effort on behalf of the user and takes just a few seconds. 
         [0020]    There are many application scenarios which could take advantage of using visual codes: In mail-order catalogs, items could be selected by scanning visual codes to conveniently place orders. In online banking applications, long reference codes or transaction numbers often need to be manually copied from printed forms. Visual codes and mobile phones could replace expensive dedicated devices which perform this task. In newspapers, visual codes could be used to store or rate newspaper articles, to get background information related to an advertisement, or for updates on information which quickly gets obsolete, like stock quotes and weather forecasts. Using the code coordinate system, it is possible to define printed image maps with predefined sensitive areas that are associated with online content. In this way, a single code can be associated with multiple items: For example, areas on a geographic map could be linked to weather forecasts corresponding to those regions and each row in a printed table containing stock quotes could be linked to a chart which is displayed on the phone. 
         [0021]    In the emerging area of mobile marketing, visual codes could be used to simplify SMS campaigns and SMS lotteries. In an advertising campaign Coca Cola printed code numbers on the labels of 160 million soft-drink bottles. By sending a number via SMS, customers got logos, ring tones, and greeting cards, and could take part in a lottery. 5.9 million SMS messages were sent, which corresponds to a response ratio of 3.7%. Using visual codes would make the process more convenient for the user and might result in even higher attendance in such campaigns, which would be commercially very interesting. 
         [0022]    The proposed 2-dimensional codes are also suitable for display on electronic screens, such as computer monitors, TV screens, public wall displays, and even on the tiny screens of handheld devices. Questionnaires, surveys, and polls on TV (like selecting the best candidate of a TV show) could be realized by overlaying visual codes over the screen image. This idea also has commercial implications. The music company Polydor used SMS as a mobile response channel in a TV spot advertising a CD. Viewers could order the CD via SMS prior to the official release date, which immediately increased sales figures. Again, using visual codes, the response ratio might be substantially increased. Camera-equipped mobile phones are not only capable of retrieving an object ID, but can also be used for more complex forms of interaction. Our code recognition system also provides the phone&#39;s orientation, amount of rotation, and coordinates of the image center. 
         [0023]    Therefore, it is an object of some embodiments of the present invention to provide a visual code system which utilizes an orientation-independent coordinate system that is defined by a visual code and the associated recognition algorithm that determines the coordinates of a targeted point in the camera image relative to that coordinate system. 
         [0024]    It is an additional object of some embodiments of the present invention to provide a visual code system which associates multiple regions of an image with a single code, wherein each region is linked to different online information and operations associated with the different regions. 
         [0025]    Yet another object of some embodiments of the present invention is to provide a visual code system which includes a rotation determination feature, a vertical and horizontal tilting determination feature, and a distance determination feature, which allows different rotation, tilting, and distance values to be associated with different information. 
         [0026]    Another object of some embodiments of the present invention is to utilize the visual code system of some embodiments of the present invention for item selection, information display in textual, graphical (e.g. on the screen of the mobile device or on a nearby electronic display), auditory (e.g., via the mobile device&#39;s speaker, headset or earphone), or tactile form (e.g., via phone vibration), and triggering specific operations. 
         [0027]    An additional object of some embodiments of the present invention is to provide an application in which textual or graphical feedback is superimposed on the camera image itself and correctly aligned (“registered”) with the items present in the image, thereby giving the user a sense of “augmented reality.” 
         [0028]    A further object of some embodiments of the present invention is to provide an application wherein the visual code system is used in conjunction with printed forms for convenient data entry. 
         [0029]    These and other objects of various embodiments of the present invention will be made clearer with reference to the following detailed description and accompanying drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0030]      FIG. 1  depicts an example of the visual code and its novel features. 
           [0031]      FIG. 2  depicts a flowchart showing the steps utilized by a camera-equipped mobile device to decode a visual code. 
           [0032]      FIG. 3  depicts a flowchart showing the steps utilized by the code location step of  FIG. 2 . 
           [0033]      FIG. 4  depicts an example of a printed document containing visual codes. 
           [0034]      FIG. 5  depicts another example of a printed document containing visual codes. 
           [0035]      FIG. 6  depicts an example form for the entry of calendar events. 
       
    
    
     DETAILED DESCRIPTION 
       [0036]    The following presents a detailed description of a preferred embodiment (as well as some alternative embodiments) of the present invention. However, it should be apparent to one skilled in the art that the described embodiment may be modified in form and content to be optimized for a wide variety of situations. 
         [0037]    With reference first to  FIG. 1 , shown is an example of visual code  101  utilized in the present invention. Visual code  101  consists of large guide bar  103  and small guide bar  105  for determining the location and orientation of visual code  101 , three cornerstones  107 ,  109 , and  111 , for detecting distortion and the data area with the actual code bits. The displayed version of visual code  101  has a capacity of 83 bits, but its design is generic and suitable for extension to a larger number of bits. Visual code  101  can be reliably located even in a low quality image which is small and tilted. 
         [0038]    Visual code  101  may be printed utilizing either standard ink or infrared ink. If infrared ink is utilized to print visual code  101 , the digital camera must be capable of identifying infrared images. Infrared ink has the advantage that visual code  101  would not be visible to the naked eye. Therefore, if the algorithm of the present invention were constantly running in the background whenever the digital camera of a mobile device was being used, the decoding of visual code  101  could be utilized to make certain information appear. 
         [0039]    The three cornerstones  107 ,  109 , and  111  define the coordinate system induced by the code. Cornerstone  107  is located at the origin, or position (0,0). Similarly, cornerstone  109  is said to be located at position (10,0) while cornerstone  111  is located at position (0,10). In this coordinate system, the center of large guide bar  103  is located at position (10,5) while the center of small guide bar  105  is located at position (8,10). The code requires a white space of a single code element around the code (1 unit in the code coordinate system). Multiple visual codes may be printed next to each other, for example arranged in a grid. A white space of a single code element around two neighboring codes (1 unit in the code coordinate system) is required. 
         [0040]    Next, with reference to  FIG. 2 , shown is a flowchart depicting the steps utilized by a camera-equipped mobile device to decode visual code  101 . First, the image captured by the digital camera is corrected for radial distortion in step  201 . The image obtained from the digital camera typically shows some amount of barrel distortion. However, radial lens distortion is less an issue with newer phone cameras, especially if the code only occupies a small area of the image. It is corrected by shifting each pixel radially towards the center of the image. The displacement only depends on the distance of the pixel from the image center and not on the particular image to be corrected. The following correction function produces adequate results (w and h are the pixel width and pixel height of the image, respectively, r is the distance from the image center, and κ is a constant that reflects the amount of radial distortion of the lens): 
         [0000]    
       
         
           
             r 
             = 
             
               
                 
                   
                     ( 
                     
                       
                         x 
                         distorted 
                       
                       - 
                       
                         w 
                         / 
                         2 
                       
                     
                     ) 
                   
                   2 
                 
                 + 
                 
                   
                     ( 
                     
                       
                         y 
                         distorted 
                       
                       - 
                       
                         h 
                         / 
                         2 
                       
                     
                     ) 
                   
                   2 
                 
               
             
           
         
       
       
         
           
             
               x 
               undistorted 
             
             = 
             
               
                 
                   ( 
                   
                     
                       x 
                       distorted 
                     
                     - 
                     
                       w 
                       / 
                       2 
                     
                   
                   ) 
                 
                  
                 
                   ( 
                   
                     1 
                     + 
                     
                       κ 
                        
                       
                           
                       
                        
                       
                         r 
                         2 
                       
                     
                   
                   ) 
                 
               
               + 
               
                 w 
                 / 
                 2 
               
             
           
         
       
       
         
           
             
               y 
               undistorted 
             
             = 
             
               
                 
                   ( 
                   
                     
                       y 
                       distorted 
                     
                     - 
                     
                       h 
                       / 
                       2 
                     
                   
                   ) 
                 
                  
                 
                   ( 
                   
                     1 
                     + 
                     
                       κ 
                        
                       
                           
                       
                        
                       
                         r 
                         2 
                       
                     
                   
                   ) 
                 
               
               + 
               
                 h 
                 / 
                 2 
               
             
           
         
       
     
         [0041]    For the integrated camera of the Nokia 7650, κ=6×10 −7  was found acceptable by manual testing. For the newer Nokia 6600, 7610, and 6630, no correction was necessary. Even for the Nokia 7650, code recognition works without correction. 
         [0042]    Step  201  is optional, because a single visual code typically only covers a small area of the camera image. In this case, radial lens distortion is not significant. However, for some applications, like those involving precise selection of items in the camera image, this step may increase accuracy. 
         [0043]    Next, the image undergoes grayscaling and adaptive thresholding in step  203  because the three color channels in the image often differ in their sharpness and contrast quality. Therefore, the algorithm uses the formula gray=(red+green)/2 instead of the more straightforward version gray=(red+green+blue)/3 or the ITU-standardized formula for luminance Y=0.2126 red+0.7152 green+0.0722 blue. This formula is computationally efficient and produces an adequate starting point for thresholding. 
         [0044]    An adaptive method is taken to produce a black-and-white version of the gray scaled image, because the brightness of the camera image is not constant and the printed code may be unevenly illuminated. The algorithm uses a (weighted) moving average of the gray values while traversing the image in a snake-like fashion. The average g s (n) is updated according to the formula: 
         [0000]    
       
         
           
             
               
                 g 
                 s 
               
                
               
                 ( 
                 n 
                 ) 
               
             
             = 
             
               
                 
                   
                     g 
                     s 
                   
                    
                   
                     ( 
                     
                       n 
                       - 
                       1 
                     
                     ) 
                   
                 
                 · 
                 
                   ( 
                   
                     1 
                     - 
                     
                       1 
                       s 
                     
                   
                   ) 
                 
               
               + 
               
                 p 
                 n 
               
             
           
         
       
     
         [0045]    with p n  denoting the gray value of the current pixel and s the width of the moving average. g s  is initialized with  s (0)=½cs g, where c is the maximum possible gray value. The color of the thresholded pixel T(n) is then chosen based on the formula: 
         [0000]    
       
         
           
             
               T 
                
               
                 ( 
                 n 
                 ) 
               
             
             = 
             
               { 
               
                 
                   
                     
                       1 
                       , 
                       
                         
                           if 
                            
                           
                               
                           
                            
                           
                             p 
                             n 
                           
                         
                         &lt; 
                         
                           
                             
                               
                                 g 
                                 s 
                               
                                
                               
                                 ( 
                                 n 
                                 ) 
                               
                             
                             s 
                           
                           · 
                           
                             
                               100 
                               - 
                               t 
                             
                             100 
                           
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                       otherwise 
                     
                   
                 
               
             
           
         
       
     
         [0046]    The recommended values for t and s are t=15 and 
         [0000]    
       
         
           
             
               s 
               = 
               
                 
                   1 
                   8 
                 
                  
                 w 
               
             
             , 
           
         
       
     
         [0047]    where w is the width of the image. 
         [0048]    After the image has undergone grayscaling in step  203 , the algorithm next attempts to identify and label the different regions of the image in step  205 . This step consists of finding regions of neighboring black pixels, counting them, and assigning a number to each. The algorithm used is a well known two-phase method. In the first phase, the image is traversed row by row, assigning preliminary labels to the regions found. During this process, it may happen that two regions with different labels turn out to be in fact the same region. In this case, the equivalence of the two temporary labels is stored in a table. The second phase resolves the equivalences by merging the corresponding regions and assigns a final label to each region. 
         [0049]    Next, the algorithm calculates the different regions&#39; shapes and orientations in step  207 . In order to identify candidates for orientation bars among the regions found, the notion of second-order moments is used. The second-order moments of a region consisting of the set of pixels R and having the center of gravity (  x ,  y ) are defined as follows: 
         [0000]    
       
         
           
             
               μ 
               xx 
             
             = 
             
               
                 1 
                 
                    
                   R 
                    
                 
               
                
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     R 
                   
                 
                  
                 
                     
                 
                  
                 
                   
                     ( 
                     
                       x 
                       - 
                       
                         x 
                         _ 
                       
                     
                     ) 
                   
                   2 
                 
               
             
           
         
       
       
         
           
             
               μ 
               yy 
             
             = 
             
               
                 1 
                 
                    
                   R 
                    
                 
               
                
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     R 
                   
                 
                  
                 
                     
                 
                  
                 
                   
                     ( 
                     
                       y 
                       - 
                       
                         y 
                         _ 
                       
                     
                     ) 
                   
                   2 
                 
               
             
           
         
       
       
         
           
             
               μ 
               xy 
             
             = 
             
               
                 1 
                 
                    
                   R 
                    
                 
               
                
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     R 
                   
                 
                  
                 
                     
                 
                  
                 
                   
                     ( 
                     
                       x 
                       - 
                       
                         x 
                         _ 
                       
                     
                     ) 
                   
                    
                   
                     ( 
                     
                       y 
                       - 
                       
                         y 
                         _ 
                       
                     
                     ) 
                   
                 
               
             
           
         
       
       
         
           
             where 
             , 
             
               
 
             
              
             
               
                 x 
                 _ 
               
               = 
               
                 
                   1 
                   
                      
                     R 
                      
                   
                 
                  
                 
                   
                     ∑ 
                     
                       
                         ( 
                         
                           x 
                           , 
                           y 
                         
                         ) 
                       
                       ∈ 
                       
                           
                       
                        
                       R 
                     
                   
                    
                   
                       
                   
                    
                   x 
                 
               
             
           
         
       
       
         
           
             
               y 
               _ 
             
             = 
             
               
                 1 
                 
                    
                   R 
                    
                 
               
                
               
                 
                   ∑ 
                   
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                     ∈ 
                     
                         
                     
                      
                     R 
                   
                 
                  
                 
                     
                 
                  
                 y 
               
             
           
         
       
     
         [0050]    From these moments, an ellipsis E={(x,y)|dx2+2exy+fy2≦1} that has the same major and minor axis as the region can be defined by setting: 
         [0000]    
       
         
           
             
               ( 
               
                 
                   
                     d 
                   
                   
                     e 
                   
                 
                 
                   
                     e 
                   
                   
                     f 
                   
                 
               
               ) 
             
             = 
             
               
                 1 
                 
                   
                     4 
                      
                     
                         
                     
                      
                     
                       μ 
                       xx 
                     
                      
                     
                       μ 
                       yy 
                     
                   
                   - 
                   
                     μ 
                     xy 
                     2 
                   
                 
               
                
               
                 ( 
                 
                   
                     
                       
                         μ 
                         yy 
                       
                     
                     
                       
                         - 
                         
                           μ 
                           xy 
                         
                       
                     
                   
                   
                     
                       
                         - 
                         
                           μ 
                           xy 
                         
                       
                     
                     
                       
                         μ 
                         xx 
                       
                     
                   
                 
                 ) 
               
             
           
         
       
     
         [0051]    The ratio of the lengths of the major and the minor axis is a good measure for the “eccentricity” of the region: perfect circles and squares have a ratio equal to one whereas line segments have a ratio close to zero. This is very useful for identifying regions with a bar-like shape. Furthermore, the orientation vector of the major axis of the region can be calculated as: 
         [0000]    
       
         
           
             
               
                 ( 
                 
                   
                     
                       
                         
                           - 
                           sin 
                         
                          
                         
                             
                         
                          
                         α 
                       
                     
                   
                   
                     
                       
                         cos 
                          
                         
                             
                         
                          
                         α 
                       
                     
                   
                 
                 ) 
               
                
               
                   
               
                
               where 
                
               
                   
               
                
               α 
             
             = 
             
               
                 1 
                 2 
               
                
               arc 
                
               
                   
               
                
               
                 tan 
                 ( 
                 
                   
                     2 
                      
                     
                         
                     
                      
                     e 
                   
                   
                     d 
                     - 
                     f 
                   
                 
                 ) 
               
             
           
         
       
     
         [0052]    Once the shapes and orientations of the different regions have been identified, the algorithm performs the step of locating and evaluating the visual codes in step  209 . Locating codes in the image is done by looking for guide bar candidates and by finding corresponding cornerstones. Guide bar candidates are found by simply selecting those regions which have a small enough axis ratio (e.g. below 0.05). For each of these candidates, the size and orientation of the region is used to estimate the expected positions of small guide bar  105  and the three cornerstones  107 ,  109 , and  111 . It is then checked whether these features are actually present at the estimated positions. Cornerstone candidates found are only accepted if their axis ratio is above a certain limit (as stated earlier, theoretically they should have a ratio equal to one). If any of the code features (cornerstones  107 ,  109 , and  111 , and small guide bar  105 ) is not present for some guide bar candidate, this particular candidate is abandoned and the next one is examined. 
         [0053]    Now, with reference to  FIG. 3 , shown is a flowchart showing the steps utilized by code location step  209  of  FIG. 2 . First, the algorithm computes the projective mapping from code coordinates to image coordinates (and the inverse mapping from image coordinates to code coordinates) in step  303 . Once a guide bar candidate with all code features has been found, the algorithm assumes that this is indeed a code in the image and starts to read the encoded bits. To that end, the bit positions in the image must be determined, i.e. one needs a function that maps each code bit to an image pixel. Since the code elements are coplanar, there exists a unique homography (projective transformation matrix) between the code plane and the image plane. The projective mapping can be calculated once four corresponding points are known. In the algorithm, the correspondences are the centers of the three cornerstones  107 ,  109 , and  111  plus the center of the small guide bar  105 . This induces a code coordinate system with its origin at the upper left corner of the code. 
         [0054]    The code coordinates of the upper left cornerstone  107 , the upper right cornerstone  109 , large guide bar  103 , and the lower left cornerstone  111  are defined to be at (0,0), (10,0), (8,10), and (0,10). It is assumed that these elements have been found at image coordinates (x i ,y i ), iε{0, . . . , 3}, respectively. A code coordinate (u,v), u,v ε{0, . . . , 10}, is mapped to image coordinate (x,y), where 
         [0000]    
       
         
           
             
               x 
               = 
               
                 
                   
                     a 
                      
                     
                         
                     
                      
                     u 
                   
                   + 
                   bv 
                   + 
                   
                     10 
                      
                     
                         
                     
                      
                     c 
                   
                 
                 
                   gu 
                   + 
                   hv 
                   + 
                   10 
                 
               
             
             , 
             
               
 
             
              
             
               y 
               = 
               
                 
                   du 
                   + 
                   ev 
                   + 
                   
                     10 
                      
                     f 
                   
                 
                 
                   gu 
                   + 
                   hv 
                   + 
                   10 
                 
               
             
           
         
       
     
         [0055]    The parameters a to h are calculated from the four reference points (x i , y i ), iε{0, 3}, as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           Δ 
                            
                           
                               
                           
                            
                           
                             x 
                             1 
                           
                         
                         = 
                         
                           
                             x 
                             1 
                           
                           - 
                           
                             x 
                             2 
                           
                         
                       
                     
                     
                       
                         
                           Δ 
                            
                           
                               
                           
                            
                           
                             y 
                             1 
                           
                         
                         = 
                         
                           
                             y 
                             1 
                           
                           - 
                           
                             y 
                             2 
                           
                         
                       
                     
                   
                 
               
               
                 
                   
                     
                       
                         
                           Δ 
                            
                           
                               
                           
                            
                           
                             x 
                             2 
                           
                         
                         = 
                         
                           
                             x 
                             3 
                           
                           - 
                           
                             x 
                             2 
                           
                         
                       
                     
                     
                       
                         
                           Δ 
                            
                           
                               
                           
                            
                           
                             y 
                             2 
                           
                         
                         = 
                         
                           
                             y 
                             3 
                           
                           - 
                           
                             y 
                             2 
                           
                         
                       
                     
                   
                 
               
             
             
               
                 
                   Σx 
                   = 
                   
                     
                       0.8 
                        
                       
                         x 
                         0 
                       
                     
                     - 
                     
                       0.8 
                        
                       
                         x 
                         1 
                       
                     
                     + 
                     
                       x 
                       2 
                     
                     - 
                     
                       x 
                       3 
                     
                   
                 
               
               
                 
                   Σy 
                   = 
                   
                     
                       0.8 
                        
                       
                           
                       
                        
                       
                         y 
                         0 
                       
                     
                     - 
                     
                       0.8 
                        
                       
                           
                       
                        
                       
                         y 
                         1 
                       
                     
                     + 
                     
                       y 
                       2 
                     
                     - 
                     
                       y 
                       3 
                     
                   
                 
               
             
           
         
       
       
         
           
             g 
             = 
             
               
                 
                   
                     Σx 
                      
                     
                         
                     
                      
                     Δ 
                      
                     
                         
                     
                      
                     
                       y 
                       2 
                     
                   
                   - 
                   
                     Σy 
                      
                     
                         
                     
                      
                     Δ 
                      
                     
                         
                     
                      
                     
                       x 
                       2 
                     
                   
                 
                  
                 
                     
                 
               
               
                 
                   Δ 
                    
                   
                       
                   
                    
                   
                     x 
                     1 
                   
                    
                   Δ 
                    
                   
                       
                   
                    
                   
                     y 
                     2 
                   
                 
                 - 
                 
                   Δ 
                    
                   
                       
                   
                    
                   
                     y 
                     1 
                   
                    
                   Δ 
                    
                   
                       
                   
                    
                   
                     x 
                     2 
                   
                 
               
             
           
         
       
       
         
           
             h 
             = 
             
               
                 
                   Σy 
                    
                   
                       
                   
                    
                   Δ 
                    
                   
                       
                   
                    
                   
                     x 
                     1 
                   
                 
                 - 
                 
                   Σx 
                    
                   
                       
                   
                    
                   Δ 
                    
                   
                       
                   
                    
                   
                     y 
                     1 
                   
                 
               
               
                 
                   Δ 
                    
                   
                       
                   
                    
                   
                     x 
                     1 
                   
                    
                   Δ 
                    
                   
                       
                   
                    
                   
                     y 
                     2 
                   
                 
                 - 
                 
                   Δ 
                    
                   
                       
                   
                    
                   
                     y 
                     1 
                   
                    
                   Δ 
                    
                   
                       
                   
                    
                   
                     x 
                     2 
                   
                 
               
             
           
         
       
       
         
           
             
               
                 
                   a 
                   = 
                   
                     
                       x 
                       1 
                     
                     - 
                     
                       x 
                       0 
                     
                     + 
                     
                       g 
                        
                       
                           
                       
                        
                       
                         x 
                         1 
                       
                     
                   
                 
               
               
                 
                   d 
                   = 
                   
                     
                       y 
                       1 
                     
                     - 
                     
                       y 
                       0 
                     
                     + 
                     
                       g 
                        
                       
                           
                       
                        
                       
                         y 
                         1 
                       
                     
                   
                 
               
             
             
               
                 
                   b 
                   = 
                   
                     
                       x 
                       3 
                     
                     - 
                     
                       x 
                       0 
                     
                     + 
                     
                       h 
                        
                       
                           
                       
                        
                       
                         x 
                         3 
                       
                     
                   
                 
               
               
                 
                   e 
                   = 
                   
                     
                       y 
                       3 
                     
                     - 
                     
                       y 
                       0 
                     
                     + 
                     
                       h 
                        
                       
                           
                       
                        
                       
                         y 
                         3 
                       
                     
                   
                 
               
             
             
               
                 
                   c 
                   = 
                   
                     x 
                     0 
                   
                 
               
               
                 
                   f 
                   = 
                   
                     y 
                     0 
                   
                 
               
             
           
         
       
     
         [0056]    The inverse mapping to the one described above is important for applications which select items visible in the image. Given a pixel coordinate, its corresponding coordinate in the coordinate system induced by the code can thus be obtained. An image coordinate (x,y) is mapped to a code coordinate (u,v) as follows: 
         [0000]    
       
         
           
             
               u 
               = 
               
                 10 
                 · 
                 
                   
                     Ax 
                     + 
                     By 
                     + 
                     C 
                   
                   
                     Gx 
                     + 
                     Hy 
                     + 
                     I 
                   
                 
               
             
             , 
             
               
 
             
              
             
               v 
               = 
               
                 10 
                 · 
                 
                   
                     Dx 
                     + 
                     Ey 
                     + 
                     F 
                   
                   
                     Gx 
                     + 
                     Hy 
                     + 
                     I 
                   
                 
               
             
             , 
             
               
 
             
              
             with 
           
         
       
       
         
           
             
               
                 
                   A 
                   = 
                   
                     e 
                     - 
                     fh 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   B 
                   = 
                   
                     ch 
                     - 
                     b 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   C 
                   = 
                   
                     bf 
                     - 
                     ce 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   D 
                   = 
                   
                     fg 
                     - 
                     d 
                   
                 
               
               
                 
                   G 
                   = 
                   
                     dh 
                     - 
                     eg 
                   
                 
               
             
             
               
                 
                   E 
                   = 
                   
                     a 
                     - 
                     cg 
                   
                 
               
               
                 
                   H 
                   = 
                   
                     bg 
                     - 
                     ah 
                   
                 
               
             
             
               
                 
                   F 
                   = 
                   
                     cd 
                     - 
                     af 
                   
                 
               
               
                 
                   I 
                   = 
                   
                     ae 
                     - 
                     bd 
                   
                 
               
             
           
         
       
     
         [0057]    The algorithm next computes the rotation angle of the visual code in the image in step  305 . It takes on values between 0° and 359°. A code that has the same orientation as the image has rotation angle 0°. The rotation is determined by mapping the points (0,0) and (100,0) from the code coordinate system to the image coordinate system, resulting in the image points (a x , a y ), and (b x , b y ). The rotation angle is then determined as: 
         [0000]    
       
         
           
             α 
             = 
             
               arc 
                
               
                   
               
                
               tan 
                
               
                 
                   { 
                   
                     
                       ( 
                       
                         
                           a 
                           y 
                         
                         - 
                         
                           b 
                           y 
                         
                       
                       ) 
                     
                     / 
                     
                       ( 
                       
                         
                           a 
                           x 
                         
                         - 
                         
                           b 
                           x 
                         
                       
                       ) 
                     
                   
                   } 
                 
                 · 
                 
                   180 
                   π 
                 
               
             
           
         
       
     
         [0000]    though several special cases have to be considered. 
         [0058]    After the rotation angle of the visual code has been computer, the algorithm next determines the horizontal and vertical tilting in step  307 . The term “tilting” denotes the amount of inclination of the image plane relative to the code plane. “Horizontal tilting” is the amount of inclination of the image plane relative to the horizontal axis of the visual code. Analogously, “vertical tilting” denotes the amount of inclination of the image plane relative to the vertical axis of the visual code. A tilting value of 1 means no tilting, a value less than 1 means tilting towards the left/top, and a value greater than 1 means tilting towards the right/bottom. The tilting parameters are computed as follows: Four image points with constant distance h (image height) from the image center point in the axis directions of the code coordinate system are computed. They are mapped to corresponding code coordinates and their distances to the center point are computed. The ratios of these distances determine the tilting parameters t x  and t y . They are independent of the size of the code in the image. From these ratios the tilting angles t x   α , and $t y   α  can be determined, if a constant r is known that depends on the camera parameters. It can be obtained experimentally. 
         [0000]    
       
         
           
             i 
             = 
             
               image 
                
               
                   
               
                
               coordinates 
                
               
                   
               
                
               of 
                
               
                   
               
                
               the 
                
               
                   
               
                
               image 
                
               
                   
               
                
               center 
                
               
                   
               
                
               point 
             
           
         
       
       
         
           
             c 
             = 
             
               CodeCoordinates 
                
               
                 ( 
                 i 
                 ) 
               
             
           
         
       
       
         
           
             x 
             = 
             
               
                 ImageCoordinates 
                  
                 
                   ( 
                   
                     c 
                     + 
                     
                       ( 
                       
                         1 
                         , 
                         0 
                       
                       ) 
                     
                   
                   ) 
                 
               
               - 
               i 
             
           
         
       
       
         
           
             y 
             = 
             
               
                 ImageCoordinates 
                  
                 
                   ( 
                   
                     c 
                     + 
                     
                       ( 
                       
                         0 
                         , 
                         1 
                       
                       ) 
                     
                   
                   ) 
                 
               
               - 
               i 
             
           
         
       
       
         
           
             u 
             = 
             
               x 
               / 
               
                  
                 x 
                  
               
             
           
         
       
       
         
           
             v 
             = 
             
               y 
               / 
               
                  
                 y 
                  
               
             
           
         
       
       
         
           
             l 
             = 
             
                
               
                 
                   CodeCoordinates 
                    
                   
                     ( 
                     
                       i 
                       - 
                       hu 
                     
                     ) 
                   
                 
                 - 
                 c 
               
                
             
           
         
       
       
         
           
             n 
             = 
             
                
               
                 
                   CodeCoordinates 
                    
                   
                     ( 
                     
                       i 
                       + 
                       hu 
                     
                     ) 
                   
                 
                 - 
                 c 
               
                
             
           
         
       
       
         
           
             t 
             = 
             
                
               
                 
                   CodeCoordinates 
                    
                   
                     ( 
                     
                       i 
                       - 
                       hv 
                     
                     ) 
                   
                 
                 - 
                 c 
               
                
             
           
         
       
       
         
           
             b 
             = 
             
                
               
                 
                   CodeCoordinates 
                    
                   
                     ( 
                     
                       i 
                       + 
                       hv 
                     
                     ) 
                   
                 
                 - 
                 c 
               
                
             
           
         
       
       
         
           
             
               t 
               x 
             
             = 
             
               l 
               / 
               r 
             
           
         
       
       
         
           
             
               t 
               y 
             
             = 
             
               t 
               / 
               b 
             
           
         
       
       
         
           
             
               t 
               x 
               α 
             
             = 
             
               arc 
                
               
                   
               
                
               
                 tan 
                  
                 
                   ( 
                   
                     r 
                      
                     
                       
                         
                           t 
                           x 
                         
                         - 
                         1 
                       
                       
                         
                           t 
                           x 
                         
                         + 
                         1 
                       
                     
                   
                   ) 
                 
               
             
           
         
       
       
         
           
             
               t 
               y 
               α 
             
             = 
             
               arc 
                
               
                   
               
                
               
                 tan 
                  
                 
                   ( 
                   
                     r 
                      
                     
                       
                         
                           t 
                           y 
                         
                         - 
                         1 
                       
                       
                         
                           t 
                           y 
                         
                         + 
                         1 
                       
                     
                   
                   ) 
                 
               
             
           
         
       
     
         [0059]    Next, in step  308 , the algorithm computes the distance of the code from the camera. If the real code size s real  (the distance between the centers of the upper left and the upper right cornerstones of the printed code) and the camera&#39;s focal distance f are known, then the metric distance from the camera to the untilted visual code can be computed from s image  (the pixel distance between the centers of the upper cornerstones in the camera image) using the pinhole model as (w image  is the pixel width of the image) 
         [0000]    
       
         
           
             
               D 
               
                 camera 
                 , 
                 code 
               
             
             = 
             
               
                 
                   
                     s 
                     real 
                   
                   × 
                   f 
                 
                 
                   
                     s 
                     image 
                   
                   / 
                   
                     w 
                     image 
                   
                 
               
               . 
             
           
         
       
     
         [0060]    Since s real  and f are typically not known and we want to use the code distance for interaction purposes rather than measuring its exact value, we define the distance in terms of the size of the visual code in the image. We set d camera,code :=100 for the farthest distance at which a code is recognized in view finder mode. For typical devices this is the case when s image =25 pixels, which amounts to 15.625% of the image width. Hence the distance is computed as 
         [0000]    
       
         
           
             
               d 
               
                 camera 
                 , 
                 code 
               
             
             = 
             
               
                 15.625 
                 
                   
                     s 
                     image 
                   
                   / 
                   
                     w 
                     image 
                   
                 
               
               . 
             
           
         
       
     
         [0061]    Should s real  and f be known, the metric distance can still be computed from d camera,code . 
         [0062]    It should be obvious to one skilled in the art that steps  303 ,  305 ,  307 ,  308 , and  309  can be performed in any order because each step is discrete and outputs a different parameter or result. 
         [0063]    Once the positions of the guide bars  103  and  105  and cornerstones  107 ,  109 , and  111  have been identified and a suitable projective mapping (from code coordinates to image coordinates) has been computed, the algorithm reads the encoded bits in step  309  by simply testing the appropriate pixels (x,y) of the black-and-white image, using code coordinates (u,v) with u,v ε{0, . . . , 10} and (x,y)=ImageCoordinates((u,v)). 
         [0064]    Error detection may optionally be performed in step  311 . The (83,76,3) linear code employed encodes a 76-bit ID to an 83-bit codeword. The resulting hamming distance is three, which should be sufficient to identify wrong codes with a high probability. Alternatively, other error detecting or error correcting codes, such as Reed-Solomon codes, might be used for increased reliability and robustness against bit errors. This might come at the expense of slightly higher processing times and a lower number of bits actually available for data storage. As an example, 15 bits of the raw 83 bits might be used for Reed-Solomon error correcting codes, leaving 68 bits for data storage. 
         [0065]    Applications of the Algorithm 
         [0066]    A. Rotation Angle and Tilting Determination 
         [0067]    In addition to the code coordinate of the image center, the recognition algorithm provides the orientation of the mobile device relative to the code. In particular, the algorithm provides the rotation of the code in the image, the viewing position (from left, from right, from top, from bottom), the amount of tilting of the image plane relative to the code plane, and the distance from the code to the camera. The projective mapping (planar homography) between the image plane and the code plane that the recognition algorithm implements, allows the mapping of arbitrary points given in image coordinates to corresponding points in code coordinates and vice versa. 
         [0068]    B. Item Selection 
         [0069]    The code coordinate system and the orientation determination features enable a number of interesting application scenarios involving the selection of items in printed documents. An example is the selection of articles depicted in printed mail-order catalogs. A single code is sufficient as long as the code coordinates of the items are known. This can be achieved by content creation software that creates “image maps” for the code and its associated sensitive areas. Articles in mail-order catalogs can thus be scanned, stored in the mobile device, and current information concerning the articles can be retrieved. The order can then be placed using the wireless communication channel provided by the mobile device. 
         [0070]    For example, in  FIG. 4 , shown is an example of a printed document containing visual codes. The regions on the map and the entries in the table are individually mapped to different URLs and thus associated to online content. 
         [0071]    In newspapers, online background information to articles, advertisements, or information which quickly gets obsolete, like weather forecasts or stock quotes, can be linked via visual codes. By using the code coordinate system, a single code located near several items of interest suffices. The exact area aimed at, like the local weather forecast, can be determined via the projective mapping by computing the vertical and horizontal distances to the visual code element. In a table of stock quotes, the row and column aimed at, and thus the desired information, can be obtained in the same manner.  FIG. 4  shows a cut-out of a newspaper page containing a geographic map with the current weather data and a table containing the snow heights for various regions. The dotted lines drawn on the newspaper page indicate sensitive areas that are individually linked to online content. Such a mapping can be created with suitable content creation software. As a prototype, we developed a mapping tool which allows to draw the areas into the image and to specify the associated URL for each region. The tool computes the coordinates of these areas in the coordinate systems of the codes present in the image, and stores this data as an XML file. Multiple URLs can be specified for each region by taking into account further parameters that are provided by the code system, such as rotation and tilting. As shown in  FIG. 4 , a single code suffices to select the area and table entries, respectively. By rotating the mobile device, different aspects of the online information can be chosen: In the example, vertical orientation shows the snow depth for the selected area, while a slight rotation shows the current temperature. 
         [0072]    As another application, visual codes can be used in mobile marketing to automate the input of coupon numbers into the mobile device. An example are SMS campaigns of soft-drink producers: The soft-drink bottles contain numbers (represented by visual codes), which can be sent as an SMS and thus allow the participation in lotteries. On TV, visual codes could be used for interactive input of answers to multiple choice questions in ad hoc surveys and quizzes or for the selection of candidates in a TV show. The code coordinates and the orientation of the device can serve as additional input parameters (in addition to the code value), for example to answer a multiple choice question. 
         [0073]    Further application possibilities concern simplifying the interaction with the mobile device itself. Telephone numbers, for example, can be encoded as visual codes and printed on business cards or in phone books. Depending on the orientation of the code in the image, the device either immediately calls the encoded phone number, stores the virtual business card in the device&#39;s memory, or—for mobile phone numbers—starts the device&#39;s SMS editing application. Parts of the device&#39;s user interface, like deeply nested menus, can be externalized by associating them with a visual code and printing them on paper or showing them on a large screen. 
         [0074]    A further possible application scenario of the presented invention is adding online content and operations to printed documents, like flyers, magazines, etc. An example online operation is selling tickets for events, theaters, or movies via the mobile phone. 
         [0075]      FIG. 5 . shows a page of a printed television magazine, which is equipped with embedded visual codes. By aiming at the printed visual codes, movie plot outlines can be shown, a list of the cast can be given, movie ratings can be displayed or submitted, movie trailers can be started, and tickets can be directly booked via the mobile phone. 
         [0076]    C. Form Entry 
         [0077]    Visual codes can also be combined with printed forms for the simplification of form input, in which the mobile device provides a wireless communication channel for conveniently and cheaply sending back the entered data. The fields of these forms can be check boxes, rulers, and canvas fields for free-hand textual or graphical input. Using the frame surrounding the form as a marker, the individual form elements can be precisely localized. The projective mapping of the recognition algorithm allows to “unwarp” parts of the image as well as the image as a whole. 
         [0078]      FIG. 6  shows an example form for the entry of calendar events. The recognition algorithm first recognizes the code and locates the edges of the frame. Then the checkboxes located in the form are scanned for check marks. Finally, the canvas fields are “unwarped”, i.e. their tilting is removed as shown in the lower part of  FIG. 6 , and stored. 
         [0079]    To define the forms, a markup language is used, which describes the structure of a form, including the positions and kinds of input elements it contains. The code is first used as a key to retrieve the form description from an online server. After interpreting the retrieved markup, user input can be categorized according to field type and sent back to the server.