Patent Abstract:
The method according the invention allows the extracting raw data from an image resulting from a camera shot. 
     It comprises determining, for each point of the image of a combination V 0 [C,L] of colour components of the image, calculating, for each point of the image, of a value V N+1 [C,L], iterating said calculating a predetermined number of times then taking into account the values of the final image V Nfinal  [C, L] in each point of the image, calculating for each point of the image of the difference D [C, L]=V Nfinal  [C, L]−V 0  [C, L], calculating of a noise contextual datum V S , correcting the extracted raw data D[C, L], with the contextual datum V S , calculating of a corrected value I*[C, L] taking into D*[C, L] and presenting the extracted data under a desired angle.

Full Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to a method for extracting raw data from an image resulting from a camera shot. 
         [0003]    More specifically but not exclusively, it relates to a method for presenting data extracted from an image along a desired view angle, from a digital image taken by a photographic or cinematographic camera whether integrated or not into a communication device under any incidence. 
         [0004]    It is notably applied to transmission and storage of text data and digitized graphics viewed beforehand by a camera under any incidence and then processed by correcting the projective deformation and/or optionally by enhancing the resolution in order to obtain a corrected image having higher legibility, viewed along an angle of incidence different from that of the camera shot, for example under normal incidence or any predetermined incidence. Of course, with the invention useful information may be extracted before or after correction. Such a process is most particularly suitable for transmitting text and/or graphic information taken by a camera fitted onto a portable communications terminal, such as for example, a cellular radio transmitter/receiver. 
         [0005]    2. Description of the Prior Art 
         [0006]    Of course, in order to extract raw data relating to printed or hand-written information in an image and to infer from them, zones to be corrected, the applicant has already proposed a solution consisting of extracting the information by calculating, as extracted raw data, a difference image D(C, L) (in fact, the contrast between the background&#39;s light level and the light level of the data to be extracted). A threshold value is used for selecting the values to be extracted from this difference image. This threshold value V s  may thereby be selected as a threshold value of the gradient for removing the grid of lines (square pattern). However, this method has the following drawbacks: 
         [0007]    If no grid of lines is present in the original image, value V s  corresponds to the threshold for removing noise. It is found that this threshold is difficult to obtain by using a conventional histogram technique which does not provide satisfactory results. 
         [0008]    If grid lines are present, the correct threshold for finding a pattern may be determined, but this threshold value cannot always be used as a threshold for extracting a piece of information. Indeed, this threshold value always does not remove either grid lines or noise completely because the non-predictive image contrast varies like a diffuse saturation and like fogged image surfaces due to random illumination conditions. 
         [0009]    In the case of color images, three channels (red, green and blue) need to be considered and it is not clearly apparent whether one should have one threshold per channel or one threshold for all the channels. 
         [0010]    Moreover, it is known that reading and/or interpretation by a person of a text or graphic reproduced from information delivered by a camera which views an original document, assumes that shooting is performed under or close to normal incidence in order to allow recognition of letters composing the text and interpretation of the graphic (which most often requires observance of the shapes and proportions). 
         [0011]    Indeed, when the document is viewed by a camera under any incidence, the produced image has a projective deformation: accordingly, starting from a certain distance from the camera, disappearance of details which are required for character recognition and for consequently understanding the document, is reported. 
         [0012]    In order to eliminate these drawbacks, the applicant has already proposed a solution consisting of extracting identifiable contextual data present in the image taken by the camera and correcting the raw or extracted data delivered by the camera by means of these contextual data, the corrected data being then stored in memory and/or transmitted to an addressee so as to be displayed for reading purposes. 
         [0013]    The contextual data used for performing the correction of raw data may affect a pattern (a physical, plotted or printed contour) initially existing in the document or reported beforehand, certain parameters of which are known beforehand. The correction process may then comprise the following steps:
       searching for this pattern in the raw image taken by the camera,   calculating projective deformations exhibited by the raw image, from deformations of the pattern which it contains and which arise through changes in the aforementioned parameters,   determining the corrections to be made to the raw data or to the extracted data depending on the projective deformations,   generating an image containing the corrected data, while taking into account the corrections determined beforehand.       
 
         [0018]    The pattern searching step is then obtained by a first searching sequence including:
       detecting boundaries present in the image,   extracting boundaries, the length of which exceeds a predetermined value, and   detecting zones delimited by the boundaries found, with a sufficient surface area (larger than a predetermined value) and not touching the edge of the image.       
 
         [0022]    For each area found, this process comprises a calculation step for determining the main axis of the zone, for finding a point external to the zone on said main axis, the construction of an external cone issued from the external point, the extraction of the points from the boundary, the external normal of which is opposed to the vector which joins it and starts from the external point, the calculation of the line borne by the main axis of the extracted points, when the four lines are found, the calculation of four apices of the quadrilateral derived from the four lines and then, when the surface area of the quadrilateral is close to the surface area of the zone, the calculation of the homography deforming the quadrilateral into a rectangle having pre-established proportions. 
         [0023]    It is found that one of the drawbacks of this method precisely consists in that it involves proportions set beforehand. Of course, if these proportions set beforehand are not the initial ones, the homographic transformation performed on the image leads to changes in the proportions of the objects contained in the corrected image. 
         [0024]    Moreover, it is found that the homographic calculations used hitherto, are particularly complicated. Indeed, for each pixel of the final image, a zone of the initial image needs to be determined, the luminance and chrominance values of which are read in order to subsequently assign them in the final image to the location which this pixel should have according to a homographic relationship. 
         [0025]    Now, it is seen that the written text portion in an image generally does not comprise more than 20% of the pixels of this image so that the remaining 80% of the pixels of the image are of no interest. 
       OBJECT OF THE INVENTION 
       [0026]    Accordingly, the object of the invention notably is to solve these problems. 
         [0027]    For this purpose, first of all, it provides a method for accurately determining a noise contextual datum used for correcting the extracted raw data, and notably, the threshold value V s  at which the printed or handwritten information may be extracted without being concerned with knowing whether the grid lines are present or not, regardless of the sought-after pattern. Further, this threshold value may be used as a gradient threshold for seeking the pattern in order to reduce the processing requirements to the one and only pattern searching step. If the intention is to extract information for a color image, each color component of the image should be considered for calculating a unique threshold in order to extract color information. 
         [0028]    An image having a grey level is then considered, which may consist in a combination of three color channels of the image (red-green-blue) or in one of these channels. 
       SUMMARY OF THE INVENTION 
       [0029]    More specifically, the invention provides a method for extracting raw data from an image resulting from a camera shot, characterized in that it comprises the following steps: 
         [0030]    a) determining for each point located by column C and line L of the image, a value V s [C, L] consisting of a combination of components of the color of the image, expressed as: 
         [0000]        V   0   [C,L]=α Red[ C,L]+β Green[ C,L]+γ Blue[ C,L]   
         [0031]    formula wherein α, β, γ are coefficients which may for example satisfy the following relationships: 
         [0000]      α+β+γ=1 and α,β,γ≧0 
         [0032]    b) calculating for each point of the image, a background value V Back. (C, L) 
         [0033]    c) calculating for each point of the image, the difference D[C, L] 
         [0000]        D[C,L]=V   Back.   −V   0   [C,L ](dark data/bright background) 
         [0000]      or 
         [0000]      V 0 [C,L]−V Back. (bright data/dark background) 
         [0034]    d) calculating a threshold value V S  consisting of a noise contextual datum used for correcting the extracted raw data, from at least one contrast histogram and/or from the probability q that a regional maximum of the raw data D[C, L] contains noise 
         [0035]    e) correcting the raw data D[C, L] by means of the noise contextual datum V S  resulting in extracted data D*[C, L] 
         [0036]    f) calculating for each point of the image, a corrected value I*[C,L], taking into account the corrected raw datum D*[C, L] 
         [0037]    g) optionally presenting the extracted data or the image containing them under a desired angle. 
         [0038]    Advantageously,
       the background value V Back.  may be determined by an operating sequence comprising the following steps:
           calculating for each point of the image, a value V N+1 [C,L] which is the maximum (dark data on bright background) or minimum (bright data on dark background) value between the value V N [C,L] and different averages of V N  values over symmetrical structuring items centered on [C,L],   iterating said calculation a predetermined number of times (N_final) and then taking into account the values of the final image V N     —     final  as the values of the background image V Back. ,   the calculation of value V N+1 [C,L] may be obtained by a relationship of the type:   
               
 
         [0000]    
       
         
           
             
               
                 V 
                 
                   N 
                   + 
                   1 
                 
               
                
               
                 [ 
                 
                   C 
                   , 
                   L 
                 
                 ] 
               
             
             = 
             
               
                 max 
                  
                 
                   ( 
                   
                     dark 
                     
                       bright 
                        
                       
                           
                       
                        
                       background 
                     
                   
                   ) 
                 
               
                
               
                 ( 
                 
                   or 
                    
                   
                       
                   
                    
                   
                     min 
                      
                     
                       ( 
                       
                         bright 
                         
                           dark 
                            
                           
                               
                           
                            
                           background 
                         
                       
                       ) 
                     
                   
                 
                 ) 
               
                
               
                 { 
                 
                   
                     
                       
                         
                           V 
                           N 
                         
                          
                         
                           [ 
                           
                             C 
                             , 
                             L 
                           
                           ] 
                         
                       
                     
                   
                   
                     
                       
                         
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 
                                   
                                     
                                       
                                         C 
                                         + 
                                         1 
                                       
                                       , 
                                     
                                   
                                 
                                 
                                   
                                     
                                       L 
                                       + 
                                       1 
                                     
                                   
                                 
                               
                               ] 
                             
                           
                           + 
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 
                                   
                                     
                                       
                                         C 
                                         - 
                                         1 
                                       
                                       , 
                                     
                                   
                                 
                                 
                                   
                                     
                                       L 
                                       - 
                                       1 
                                     
                                   
                                 
                               
                               ] 
                             
                           
                         
                         2 
                       
                     
                   
                   
                     
                       
                         
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 
                                   
                                     
                                       
                                         C 
                                         + 
                                         1 
                                       
                                       , 
                                     
                                   
                                 
                                 
                                   
                                     
                                       L 
                                       - 
                                       1 
                                     
                                   
                                 
                               
                               ] 
                             
                           
                           + 
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 
                                   
                                     
                                       
                                         C 
                                         - 
                                         1 
                                       
                                       , 
                                     
                                   
                                 
                                 
                                   
                                     
                                       L 
                                       + 
                                       1 
                                     
                                   
                                 
                               
                               ] 
                             
                           
                         
                         2 
                       
                     
                   
                   
                     
                       
                         
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 C 
                                 , 
                                 
                                   L 
                                   + 
                                   1 
                                 
                               
                               ] 
                             
                           
                           + 
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 C 
                                 , 
                                 
                                   L 
                                   - 
                                   1 
                                 
                               
                               ] 
                             
                           
                         
                         2 
                       
                     
                   
                   
                     
                       
                         
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 
                                   C 
                                   + 
                                   1 
                                 
                                 , 
                                 L 
                               
                               ] 
                             
                           
                           + 
                           
                             
                               V 
                               N 
                             
                              
                             
                               [ 
                               
                                 
                                   C 
                                   - 
                                   1 
                                 
                                 , 
                                 L 
                               
                               ] 
                             
                           
                         
                         2 
                       
                     
                   
                 
                 } 
               
             
           
         
       
       
         
           
             the background image V Back.  may also be determined by an operating sequence comprising the following steps:
           generating an image V N+1 , four times smaller than V N , comprising the calculation for each point of the image, of a value V N+1 [C,L] which is the maximum (dark data on bright background) or the minimum (bright data on dark background) between a local average of V N  centered on the point [2C+½, 2L+½] (the four adjacent pixels here) and at least a local average including a larger number of pixels (the 16 adjacent pixels here); image V N+1  then being four times smaller than image V N ,   iterating said calculation, a predetermined number of times V NFinal ,   interpolating values of the image V N     —     Final  in order to obtain the values of V Back.  which has the same size as the initial image V 0 ,   
         
             the value V N+1 [C,L] may be determined by an operating sequence comprising: 
           
         
       
     
         [0000]    
       
         
           
             
               
                 V 
                 
                   N 
                   + 
                   1 
                 
               
                
               
                 [ 
                 
                   C 
                   , 
                   L 
                 
                 ] 
               
             
             = 
             
               
                 max 
                  
                 
                   ( 
                   
                     dark 
                     
                       bright 
                        
                       
                           
                       
                        
                       background 
                     
                   
                   ) 
                 
               
                
               
                 ( 
                 
                   or 
                    
                   
                       
                   
                    
                   
                     min 
                      
                     
                       ( 
                       
                         bright 
                         
                           dark 
                            
                           
                               
                           
                            
                           background 
                         
                       
                       ) 
                     
                   
                 
                 ) 
               
                
               
                 { 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         , 
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           1 
                                         
                                         , 
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             L 
                                           
                                           + 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     V 
                                     N 
                                   
                                    
                                   
                                     [ 
                                     
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         + 
                                         1 
                                       
                                       , 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                         + 
                                         1 
                                       
                                     
                                     ] 
                                   
                                 
                               
                             
                           
                           4 
                         
                         , 
                       
                     
                   
                   
                     
                       
                         
                           ( 
                           
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           - 
                                           1 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           - 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           - 
                                           1 
                                         
                                         , 
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           - 
                                           1 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           - 
                                           1 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           2 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           - 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         , 
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           C 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           2 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           1 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           - 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           1 
                                         
                                         , 
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           1 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           1 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           2 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           2 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           - 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           2 
                                         
                                         , 
                                         
                                           2 
                                            
                                           
                                               
                                           
                                            
                                           L 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           2 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           1 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       V 
                                       N 
                                     
                                      
                                     
                                       [ 
                                       
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             C 
                                           
                                           + 
                                           2 
                                         
                                         , 
                                         
                                           
                                             2 
                                              
                                             
                                                 
                                             
                                              
                                             L 
                                           
                                           + 
                                           2 
                                         
                                       
                                       ] 
                                     
                                   
                                   + 
                                 
                               
                             
                           
                           ) 
                         
                         16 
                       
                     
                   
                 
                 } 
               
             
           
         
       
     
         [0048]    The raw data D[C,L] are generally affected by a perspective deformation due to the arbitrary position of the camera in front of the supporting medium. The perspective deformation of the extracted raw data may be corrected with a known method for extracting geometrical contextual data. Likewise, these extracted raw data are also affected by luminous and/or electronic noise which may be eliminated by thresholding as follows: 
         [0049]    After having calculated the noise contextual datum V S , for each point of the image, a comparison of value D[C,L] with threshold value V S  is made in order to determine the value D*[C,L] to be extracted in the following way:
       if D[C,L]&lt;V S  then D*[C,L]=0   if D[C,L]≧V S , value D[C,L] is retained, i.e. D*[C,L]=D[C,L] or else it is replaced with   D[C,L]−V S  i.e. D*[C,L]=D[C,L]−V S          
 
         [0053]    Generation of image I*(p) containing the extracted data according to the subtractive principle, results from the calculation I*(p)=I max −f·D*(p) (dark data/bright background), with I max , value of the bright background, which may be equal to 255 for example, or I*(p)=I min +f·D*(p) (bright data/dark background), I min  may be equal to zero. 
         [0054]    The threshold value V S  is a noise contextual datum used for correcting raw data D[C,L]. It may be calculated according to a method based on the probability q that any regional maximum of raw data contains noise. This method comprises the following operating phases:
       a first phase wherein for each pixel p of a grey image I (either a color channel or luminance) the following is performed:       
 
         [0056]    a) for each direction d, with 0&lt;|d|&lt;D 
         [0057]    if the following condition is satisfied:
       convexity of I on [p−d, p+d], i.e.,       
 
         [0000]        I ( p +(1−2×) d )≦λ I ( p−d )+(1−λ) I ( p+d ) for any 0≦λ≦1 in case of dark data bright background) 
         [0059]    or
       concavity of I on [p−d, p+d], i.e.,       
 
         [0000]        I ( p +(1−2×) d )≧λ I ( p−d )+(1−λ) I ( p+d ) for any 0≦λ≦1(bright data/dark background) 
         [0061]    then G(p,d)=(I(p+d)+I(p−d))/2 is calculated 
         [0062]    or else G(p,d)=0 
         [0063]    b) a value S(p) is calculated, which is equal to the maximum value of G(p,d) for all directions d with 0&lt;|d|&lt;D 
         [0064]    as an alternative to this calculation of S(p), S(p) may be replaced with D(p), D(p) corresponding to the raw data,
       a second step wherein a value S max  is calculated, which is equal to the maximum value of S(p), for all pixels p   a third step wherein a histogram H(s) is reset to 0 for all values of s between 0 and S max      a fourth step for calculating the contrast histogram for the regional maximum pixels containing the noise to be eliminated, wherein this calculation may comprise:   a step wherein for each pixel p in the image S(p), if S(p) is a regional maximum, H(S(p)) is incremented according to the relationship H(S(p))←H(S(p))+1   a step wherein the identities S=S max  and N=1/q are determined and as long as H(S) is less than N, S is replaced with S−1, the final value of S is called 5 min, N is the minimum number of regional maximum pixels such that the mathematical expected value of the number of pixels containing noise is larger than or equal to 1   a step wherein value V S  is calculated according to formula       
 
         [0000]        V   S   =r·S   min +(1 −r )· S   max, with  ½ ≦r≦ 1 
         [0071]    The threshold value V S  may also be calculated according to the following method: 
         [0072]    1) A first step for calculating a histogram of the pits, H_pits, including the following operating phases: 
         [0073]    a) for each pixel p of image I, the following is performed: 
         [0074]    i. for each direction d with 0&lt;|d|&lt;D: 
         [0075]    if the following condition is satisfied:
       convexity of I on [p−d, p+d]       
 
         [0000]        I ( p +(1−2×) d )≦λ I ( p−d )+(1−λ) I ( p+d ) for any 0≦λ≦1 
         [0077]    then G(p,d)=(I(p+d)+I(p−d))/2 is calculated 
         [0078]    or else G(p,d)=0 
         [0079]    ii. S(p)=maximum value of G(p,d), is calculated for all the directions d with 0&lt;|d|&lt;D 
         [0080]    as an alternative to this calculation of S(p), S(p) may be replaced with a value D(p) which corresponds to the raw data (dark data/bright background) 
         [0081]    b) the maximum value of the pits, S pits_max is calculated, which is equal to the maximum value of S(p) for all pixels p 
         [0082]    c) the pit histogram, H_pits, is reset to zero for each value of s between 0 and the maximum value of the pits, S_pit max 
         [0083]    d) for each pixel p of the image S(p) the following calculations are performed: 
         [0084]    i. if S(p) is a regional maximum, H_pits (S(p)) is incremented in the following way: 
         [0000]        H _pits( S ( p ))← H _pits( S ( p ))+1 
         [0085]    2) A second step for calculating the histogram of the bumps, H_bumps, includes the following operating phases: 
         [0086]    a) for each pixel p of image I, the following is performed: 
         [0087]    i. for each direction d with 0&lt;|d|&lt;D: 
         [0088]    if the following condition is satisfied:
       concavity of I on [p−d, p+d], i.e.,       
 
         [0000]        I ( p +(1−2λ) d )≧λ I ( p−d )+(1−λ) I ( p+d ) for any 0≦λ≦1(bright data/dark background) are satisfied 
         [0090]    then G(p,d)=(I(p+d)+I(p−d))/2 is calculated 
         [0091]    or else G(p,d)=0 
         [0092]    ii. S(p)=maximum value of G(p,d) is calculated for all the directions d with 0&lt;|d|&lt;D 
         [0093]    as before, as an alternative to this calculation of S(p), the value S(p) may be replaced with a value D(p) which corresponds to the raw data (bright data/dark background) 
         [0094]    b) the maximum value of the bumps, S bumps_max, is calculated, which is equal to the maximum value of S(p) for all pixels p 
         [0095]    c) the bump histogram H_bumps(s) is reset to 0 for each s between 0 and the maximum value of the bumps, S bumps_max 
         [0096]    d) for each pixel p of the image S(p), the following calculations are performed: 
         [0097]    i. if S(p) is a regional maximum 
         [0098]    H_bumps(S(p)) is incremented in the following way: 
         [0000]        H _bumps( S ( p ))← H _bumps( S ( p ))+1 
         [0099]    3) A third step for superimposing pit histogram H_pits and bump histogram H_bumps, includes the following phases: 
         [0100]    a) S_max is calculated according to the expression: 
         [0000]        S _max=Max(maximum value of the pits, S _pits_max, maximum value of the bumps, S _bumps_max) 
         [0101]    b) H_max is calculated according to the expression: 
         [0000]        H _max=maximum value of the pits  H _pits( S ) and the bumps  H _bumps( S ) for all values of  S    
         [0102]    c) S0 is calculated according to the expression: 
         [0000]        s 0=maximum value of  s  such that  H _pits( s )=H_max 
         [0103]    or H_bumps(s)=H_max 
         [0104]    d) s=s0+1 is calculated and α is selected such that 0&lt;α&lt;½ and as long as: 
         [0000]      |ln(1 +H _pits( s )−ln(1 +H _bumps( s ))|&lt;α·ln(1 +H _max) 
         [0105]    s←s+1 is performed (wherein ln is Napier&#39;s logarithm function) 
         [0106]    finally, value S min  is determined by the final value of s incremented by 1 
         [0107]    4) a step for calculating the extraction threshold V S  according to the relationship: 
         [0000]        V   S   =r·S   min +(1 −r )· S   max  where ½ ≦r≦ 1 
         [0108]    It is seen that step b) of the method for extracting raw data, is iterated a large number of times, so that the threshold values calculated by means of both methods described earlier via calculation of S(p) do not allow the extracted raw data to be corrected efficiently. 
         [0109]    This drawback may be suppressed by using the alternative consisting of replacing S(p) with D(p). 
         [0110]    Thus, in this case, when the probability q that any regional maximum of the raw data contains noise, is known, the process for extracting the noise contextual datum may comprise the following steps:
       a first step wherein a value S max  is calculated, which is equal to the maximum value of D(p) for all the pixels p=[C,L], D being the image of the raw data to be corrected   a second step wherein a histogram is reset H(S)=0 for all values of S between 0 and S max      a third step wherein for each pixel p in image D(p), if D(p) is a regional maximum, H(D(p)) is incremented according to the relationship       
 
         [0000]        H ( D ( p ))← H ( D ( p ))+1       a fourth step wherein the identities S=S max  and N=1/q are determined and as long as H(S) is less than N, S is replaced with S−1, the final value of S is called S min      a fifth step wherein the value of the noise contextual datum V S  is calculated according to formula         
         [0000]        V   S   =r·S   min +(1 −r )· S   max  with ½ ≦r≦ 1 
         [0116]    If the probability q that any regional maximum of the raw data contains noise, is not known, the process for extracting the noise contextual datum V S  may comprise the following steps: 
         [0117]    1) a first step for calculating a pit histogram, H_pits includes the following operating phases:
       a) the maximum values of the pits S_pits_max is calculated, which is equal to the maximum value of D(p) for all the pixels p, D being the image of the extracted dark-on-bright-background raw data   b) the pit histogram H_pits is reset to 0 for each value of s between 0 and the maximum value of the pits, S_pits_max   c) for each pixel p of image D(p),
           if D(p) is a regional maximum   H_pits (D(p)) is incremented in the following way:   
               
 
         [0000]        H _pits( D ( p ))← H _pits( D ( p ))+1 
         [0123]    2) A second step for calculating a bump histogram, H_bumps includes the following operating phases:
       a) the maximum value of the pits S_bumps_max is calculated, which is equal to the maximum value of D(p) for all pixels p, D being the image of the extracted bright-on-dark-background raw data   b) the pit histogram H_bumps is reset to 0 for each value of s between 0 and the maximum value of the pits, S bumps_max   c) for each pixel p of the image D(p),
           if D(p) is a regional maximum   H_bumps(D(p)) is incremented in the following way:   
               
 
         [0000]        H _bumps( D ( p ))← H _bumps( D ( p ))+1 
         [0129]    3) A third step for superimposing pit H_pits and bump H_bumps histograms includes the following operating steps:
       a) calculating S_max according to the expression:       
 
         [0000]        S   max =Max(maximum value of the pits  S _pits_max,maximum value of the bumps  S _bumps_max)       b) calculating H_max according to the expression:         
         [0000]        H _max=maximum value of the pits  H _pits( S ) and of the bumps,  H _bump( S ) for all values of  S          c) calculating s0 according to the expression:
           S0=maximum value of s such that   
                 
         [0000]        H _pits( s )= H _max           or H_bumps(s)=H_max       d) s=s0+1 is calculated and α is selected such that 0&lt;α&lt;½ and as long as:         
         [0000]      |ln(1+ H _pits( s ))−ln(1 +H _bumps( s ))|&lt;α·ln(1 +H _max)           s←s+1 is performed (where ln is Napier&#39;s logarithm function)   finally the value S min  is determined by the final value of s incremented by 1             
         [0138]    4) a step for calculating the value of the noise contextual datum V S  according to the relationship: 
         [0000]        V   S   =r·S   min +(1 −r )· S   max  where ½ ≦r≦ 1 
         [0139]    Of course, information from a color image with red, green, blue color channels needs to be extracted. The steps of the method described earlier may be followed for each color channel, by determining a threshold for each channel. Extraction of the color information from the red, green, blue channels and their recombination into a final color image may be performed by extracting the red, green, blue values in each pixel for which it is seen that the threshold has been exceeded. 
         [0140]    Moreover, with the purpose of eliminating the drawbacks of the searching methods for patterns (physical, plotted, or printed contours), expressing some contextual data and involving proportions set beforehand, the invention proposes determining the real height/width ratio of the quadrilateral formed by four identified points of a pattern present in the image of a contour which is used for determining some contextual data of the image and this, in order to be able to reconstruct a document having the same proportions. 
         [0141]    For this purpose, the applicant provides a method for presenting information extracted from an image of the aforementioned type along a desired view angle, from a picture taken by a camera under any incidence, this method comprising:
       searching for at least four identifiable characteristic points of a pattern present in the image taken by the camera, defining contextual data,   optional extraction of the data according to predetermined criteria,   calculating geometrical deformations to be made on the raw image, the information or the extracted data, from the relative position of four points with respect to relative reference positions,   determining corrections to be made to the raw image or to the extracted data depending on the geometrical deformations,   generating an image containing the extracted data, taking into account the thereby determined geometrical corrections.       
 
         [0147]    This method is characterized in that, for obtaining an image containing extracted data having the same proportions as the object, it comprises the determination of the real height/width ratio of the quadrilateral defined by the aforementioned points and the taking into account of this ratio r in generating the corrected image. 
         [0148]    More specifically, determination of the proportions of the quadrilateral (rectangle) is carried out according to a process comprising the following steps:
       searching for four identifiable characteristic points of a pattern present in the image,   determining the vanishing points from the sides of the quadrilateral defined by the four points and determining a horizon line connecting the vanishing points,   determining the coordinates of the projection point F of the optical centre O of the camera on the horizon line,   calculating the camera base point (orthogonal projection of the optical centre of the camera on the plane of the pattern) from distances between the vanishing points and the projection point F and from the distance between this projection point F and the optical centre O,   calculating the focal length from the distances between the optical centre, the projection point F and the camera base point,   calculating the coordinates of the intersection points M 1  N 1 , M 2  N 2 , between the vanishing lines and the lines connecting the camera base point and the vanishing points as well as points O 1 , O 2 , P 1 , P 2 , located on the vanishing lines, at conventional (elliptical) distances from the camera base point,   calculating the ratio of the sides of the initial pattern from the coordinates calculated earlier by considering that the rectangle O 1 , O 2 , P 1 , P 2 , is the projection of a square extending in the plane of the pattern.       
 
         [0156]    If only the vanishing lines of a same pair intersect at a vanishing point while both other vanishing lines are parallel (vanishing point projected to infinity), calculation of the r ratio will be carried out by starting with a pre-established focal length f of the camera. 
         [0157]    If all the vanishing points are projected to infinity, ratio r is equal to the ratio of the lengths of the adjacent sides of the quadrilateral. 
         [0158]    An important advantage of this method consists in that it is not very sensitive to lack of orthogonality of the adjacent sides of the quadrilateral which is frequently the case when the quadrilateral is a pattern plotted by hand. Indeed, conventional solutions are particularly sensitive to such defects (instability in the case of lack of orthogonality). 
         [0159]    Another advantage of this solution consists in that texts may be reproduced in which there is no alignment of characters. 
         [0160]    With the purpose of alleviating homographic calculations notably by avoiding unnecessary calculations and by only applying them to the pixels which are relevant to the written text in the image and by reusing as much as possible calculations which have already been performed, the applicant proposes an operating sequence including the following phases:
       creating an initial (deformed) binary mask of the zones to be corrected by isolating the useful portion of the initial image containing the extracted data and by assigning the same binary value (0 or 1) to the pixels of this useful portion,   calculating an ideal binary mask by a direct homographic transformation of the initial mask (based on the transformation of any polygonal shape into a reference polygonal shape),   for each pixel (u, v) of the useful portion of the ideal binary mask, calculating by inverse homography, the position (x, y) in the initial image, determining the value of the final image at pixel (u, v) by an interpolated value at (x, y) in the initial image.       
 
         [0164]    Advantageously, the calculation of the inverse homography may comprise a preliminary calculation by inverse homography of the lines and columns of each pixel of the ideal mask. It will then be possible to infer the position of a given pixel in the initial image by calculating the intersection of both lines. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0165]    Embodiments of the invention will be described hereafter, as non-limiting examples, with reference to the appended drawings wherein: 
           [0166]      FIG. 1  is a schematic illustration of the shooting of a document by a camera, the main parameters used in the method according to the invention may be shown with this illustration; 
           [0167]      FIG. 2  is a projection of the view illustrated in  FIG. 1  in the plane of the image of the document; 
           [0168]      FIG. 3  is a projection of the  FIG. 2  type, but wherein one of the two vanishing points is projected to infinity; 
           [0169]      FIG. 4  is a diagram relating to the characterization of the inside of a quadrilateral; 
           [0170]      FIG. 5  illustrates a projective geometrical invariant; 
           [0171]      FIG. 6  is a schematic illustration of the operating steps for an image processing process according to the invention in order to obtain a corrected image; 
           [0172]      FIGS. 7-11  are diagrams for illustrating the calculations performed according to the process illustrated in  FIG. 6 ; 
           [0173]      FIG. 12  shows an example of a pair of histograms, H_pits and H_bumps in a logarithmic coordinate reference system; 
           [0174]      FIG. 13  is a schematic illustration for showing the main geometrical parameters of a camera; 
           [0175]      FIG. 14  is a diagram illustrating the principle for constructing a rectangular pattern having a prescribed physical aspect ratio, in the case of absence of vanishing points. 
       
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0176]    In the example illustrated in  FIG. 1 , the original document which is intended to be shot with a camera is positioned on a planar supporting medium, horizontally. 
         [0177]    The camera is positioned above the plane of the supporting medium and therefore of the document, at a determined height, the axis of the camera which is orientated towards the document being oblique (here, an angle of incidence of about 30°). 
         [0178]    The image of the document taken by the camera is located in an image plane which extends perpendicularly to the optical axis of the camera. 
         [0179]    The orthogonal projection of the optical centre C of the camera in the plane of the supporting medium is called the base of the camera. 
         [0180]    The plane passing through point C which is parallel to the plane of the supporting medium is the apparent horizon of the supporting medium. 
         [0181]    The pattern of a rectangle of document DT provides at the image, a quadrilateral A, B, C, D ( FIG. 2 ), the segments DC and AB of which are borne by two lines (vanishing lines) which intersect at a point F 1  while segments DA and CB are borne by two lines (vanishing lines) which intersect at a point F 2 . The line bearing the segment F 1 F 2  is the horizon line. 
         [0182]    As illustrated in  FIG. 2 :
       X is the base of the camera (projection of the optical centre C in the plane of the document)   M 1  is the intersection of lines (AD) and (F 1 X)   N 1  is the intersection of lines (BC) and (F 1 X)   M 2  is the intersection of lines (AB) and (F 2 X)   N 2  is the intersection of lines (CD) and (F 2 X)   δ is a positive constant representative of a conventional distance measured from point X on axes (F 1 ,X) and (F 2 ,X)   i is the angle of incidence   E is an ellipse with a major axis parallel to (FX); its major axis has a length δ/cos(i) and its minor axis has a length δ   O1 and P 1  are the intersections of (F 1 ,X) with ellipse E   O2 and P 2  are the intersections of (F 2 ,X) with ellipse E   O is the centre of the image   F is the orthogonal projection of the optical centre O of the camera on line (F 1 ,F 2 )       
 
         [0195]    In accordance with the method according to the invention, calculation of the physical aspect ratio r (r=horizontal length/vertical length) of the rectangle forming the original pattern is achieved according to one of the following three operating sequences:
       1) The case when points F 1  and F 2  exist, segments AB, BC, CD, DA not being parallel. In this case, the operating sequence comprises the following phases:   a first phase for calculating the coordinates of point F by projecting the centre of the image O on the horizon line (F 1 , F 2 )   a second phase for calculating the position of the base of the camera by its distance to point F, dist (X,F) by means of the relationship:       
 
         [0000]    
       
         
           
             
               dist 
                
               
                 ( 
                 
                   X 
                   , 
                   F 
                 
                 ) 
               
             
             = 
             
               
                 
                   dist 
                    
                   
                     ( 
                     
                       F 
                       , 
                       
                         F 
                         1 
                       
                     
                     ) 
                   
                 
                 · 
                 
                   dist 
                    
                   
                     ( 
                     
                       F 
                       , 
                       
                         F 
                         2 
                       
                     
                     ) 
                   
                 
               
               
                 dist 
                  
                 
                   ( 
                   
                     O 
                     , 
                     F 
                   
                   ) 
                 
               
             
           
         
       
     
         [0199]    This results from the following demonstration in three steps: 
         [0200]    a) the angle between the base of the camera and horizon is 90° and it is inferred that 
         [0000]    
       
         
           
             
               i 
               . 
               
                   
               
                
               
                 tan 
                  
                 
                   ( 
                   i 
                   ) 
                 
               
             
             = 
             
               
                 
                   OX 
                   f 
                 
                  
                 
                     
                 
                  
                 and 
                  
                 
                     
                 
                  
                 
                   tan 
                    
                   
                     ( 
                     
                       
                         π 
                         2 
                       
                       - 
                       i 
                     
                     ) 
                   
                 
               
               = 
               
                 OF 
                 f 
               
             
           
         
       
       
         
           
             
               
                 ii 
                 . 
                 
                     
                 
                  
                 therefore 
               
                
               
                   
               
                
               
                 XF 
                 OF 
               
             
             = 
             
               
                 1 
                 + 
                 
                   OX 
                   OF 
                 
               
               = 
               
                 1 
                 
                   
                     cos 
                     2 
                   
                    
                   
                     ( 
                     i 
                     ) 
                   
                 
               
             
           
         
       
     
         [0201]    b) the angle between F 1  and F 2  is also 90° and it is inferred that 
         [0000]    
       
         
           
             
               i 
               . 
               
                   
               
                
               
                 tan 
                  
                 
                   ( 
                   j 
                   ) 
                 
               
             
             = 
             
               
                 
                   
                     FF 
                     1 
                   
                   g 
                 
                  
                 
                     
                 
                  
                 and 
                  
                 
                     
                 
                  
                 
                   tan 
                    
                   
                     ( 
                     
                       
                         π 
                         2 
                       
                       - 
                       j 
                     
                     ) 
                   
                 
               
               = 
               
                 
                   FF 
                   2 
                 
                 g 
               
             
           
         
       
     
         [0202]    with g=OF/cos(i) and j being the angle between F 1  and F 2    
         [0203]    from this, we obtain 
         [0000]    
       
         
           
             
               
                 ii 
                 . 
                 
                     
                 
                  
                 therefore 
               
                
               
                   
               
                
               
                 1 
                 
                   
                     cos 
                     2 
                   
                    
                   
                     ( 
                     i 
                     ) 
                   
                 
               
             
             = 
             
               
                 
                   FF 
                   1 
                 
                 · 
                 
                   FF 
                   2 
                 
               
               
                 OF 
                 2 
               
             
           
         
       
     
         [0204]    c) the final formula for XF is obtained by combining relationships a) ii. and b) ii.,
       a third phase for calculating the focal length f with the relationship:       
 
         [0000]        f =√{square root over ( dist ( O,X )· dist ( O,F ))}{square root over ( dist ( O,X )· dist ( O,F ))}(inferred from  a ) i . above)       a fourth phase for calculating the angle of incidence i expressed by:         
         [0000]    
       
         
           
             
               
                 tan 
                  
                 
                   ( 
                   i 
                   ) 
                 
               
               = 
               
                 
                   
                     
                       dist 
                        
                       
                         ( 
                         
                           O 
                           , 
                           X 
                         
                         ) 
                       
                     
                     
                       dist 
                        
                       
                         ( 
                         
                           O 
                           , 
                           F 
                         
                         ) 
                       
                     
                   
                 
                  
                 
                     
                 
                  
                 
                   ( 
                   
                     inferred 
                      
                     
                         
                     
                      
                     from 
                      
                     
                         
                     
                      
                     a 
                   
                   ) 
                 
                  
                 i 
               
             
             , 
             above 
           
         
       
       
         
           
             a fifth phase for determining the coordinates of points M 1 , N 1 , O 1  and P 1  from the values calculated earlier 
             a sixth phase for determining the coordinates of points M 2 , N 2 , O 2  and P 2  from the values calculated earlier 
             a seventh phase for calculating the physical aspect ratio r by using the crossed ratios and the fact that the rectangle O 1 , O 2 , P 1 , P 2  is the projection of a square extending in the plane of the pattern centred on the base according to the relationship 
           
         
       
     
         [0000]    
       
         
           
             r 
             = 
             
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         M 
                         1 
                       
                       , 
                       
                         N 
                         1 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         M 
                         2 
                       
                       , 
                       
                         N 
                         2 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         O 
                         1 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         M 
                         1 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         P 
                         1 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                   ( 
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         N 
                         1 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         M 
                         2 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         O 
                         2 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         N 
                         2 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         P 
                         2 
                       
                     
                     ) 
                   
                 
               
             
           
         
       
     
         [0210]    This results from the fact that [O1,P1] and [O2,P2] are projections of two segments of the same length: [O1,P1] and [O2,P2] may be used as segments and the relative lengths of segments [M1,N1] and [M2,N2] may be measured by using the crossed ratios and r may be inferred from them. 
         [0211]    2) The case when two of the segments are parallel (intersection point is projected to infinity) ( FIG. 3 )) 
         [0212]    In this case, ratio r is obtained according to the following relationship: 
         [0000]    
       
         
           
             r 
             = 
             
               
                 
                   dist 
                    
                   
                     ( 
                     
                       A 
                       , 
                       B 
                     
                     ) 
                   
                 
                 · 
                 
                   dist 
                    
                   
                     ( 
                     
                       C 
                       , 
                       D 
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   
                     
                       dist 
                        
                       
                         ( 
                         
                           C 
                           , 
                           D 
                         
                         ) 
                       
                     
                     - 
                     
                       dist 
                        
                       
                         ( 
                         
                           A 
                           , 
                           B 
                         
                         ) 
                       
                     
                   
                   ) 
                 
                 · 
                 
                   
                     
                       f 
                       2 
                     
                     + 
                     
                       
                         dist 
                          
                         
                           ( 
                           
                             O 
                             , 
                             
                               F 
                               2 
                             
                           
                           ) 
                         
                       
                       2 
                     
                   
                 
               
             
           
         
       
     
         [0000]    formula wherein f is the focal length of the camera (with the understanding that this focal length f is calculated beforehand). 
         [0213]    3) The case when there is no vanishing point (segments AB, BC, CD, DA being parallel, two by two) 
         [0214]    In this case, the ratio r is simply 
         [0000]    
       
         
           
             r 
             = 
             
               
                 dist 
                  
                 
                   ( 
                   
                     A 
                     , 
                     B 
                   
                   ) 
                 
               
               
                 dist 
                  
                 
                   ( 
                   
                     A 
                     , 
                     D 
                   
                   ) 
                 
               
             
           
         
       
     
         [0215]    These relationships are essentially based on invariants in projective geometry and in particular on the crossed ratios of four points, the relationships of which are expressed facing  FIG. 5  which shows two views A*B*C*D*-A* 1 B* 1 C* 1 D* 1  of a same object taken by a camera with optical centre O* with two different angles of incidence. 
         [0216]    From points A*, B*, C*, and D*, a first series of crossed ratios 
         [0000]    
       
         
           
             
               
                 
                   A 
                   * 
                 
                  
                 
                   B 
                   * 
                 
               
               
                 
                   A 
                   * 
                 
                  
                 
                   D 
                   * 
                 
               
             
             ÷ 
             
               
                 
                   CB 
                   * 
                 
                 
                   CD 
                   * 
                 
               
               . 
             
           
         
       
     
         [0000]    may be obtained. 
         [0217]    Likewise, from points A* 1 , B* 1 , C* 1 , D* 1  a second series of crossed ratios 
         [0000]    
       
         
           
             
               
                 
                   A 
                   1 
                   * 
                 
                  
                 
                   B 
                   1 
                   * 
                 
               
               
                 
                   A 
                   1 
                   * 
                 
                  
                 
                   D 
                   1 
                   * 
                 
               
             
             ÷ 
             
               
                 
                   C 
                   1 
                   * 
                 
                  
                 
                   B 
                   1 
                   * 
                 
               
               
                 
                   C 
                   1 
                   * 
                 
                  
                 
                   D 
                   1 
                   * 
                 
               
             
           
         
       
     
         [0000]    is obtained. 
         [0218]    Conservation of the crossed ratio is then expressed as 
         [0000]    
       
         
           
             
               
                 
                   
                     A 
                     * 
                   
                    
                   
                     B 
                     * 
                   
                 
                 
                   
                     A 
                     * 
                   
                    
                   
                     D 
                     * 
                   
                 
               
               ÷ 
               
                 
                   CB 
                   * 
                 
                 
                   CD 
                   * 
                 
               
             
             = 
             
               
                 
                   
                     A 
                     1 
                     * 
                   
                    
                   
                     B 
                     1 
                     * 
                   
                 
                 
                   
                     A 
                     1 
                     * 
                   
                    
                   
                     D 
                     1 
                     * 
                   
                 
               
               ÷ 
               
                 
                   
                     C 
                     1 
                     * 
                   
                    
                   
                     B 
                     1 
                     * 
                   
                 
                 
                   
                     C 
                     1 
                     * 
                   
                    
                   
                     D 
                     1 
                     * 
                   
                 
               
             
           
         
       
     
         [0219]    In the case when one of the points, for example point A, is projected to infinity, the ratio A*B*/A*D* is considered to be equal to 1. 
         [0220]    As mentioned earlier, the invention also provides a method for reshaping the image allowing the complexity of the homographic calculations to be reduced, calculations which were hitherto used notably when this image contains text. 
         [0221]      FIG. 6  illustrates the different steps of this re-shaping mode which comprises: 
         [0000]    a) a first step for calculating a binary mask deformed from an image where the frame (or the page) has been detected, and the text (written) portion has been extracted. This step consists of affecting a zero value to all the pixels which are outside a quadrilateral surrounding the useful portion of the image as well as the pixels which do not correspond to the writing. 
         [0222]    The position of a point inside or outside a quadrilateral may be determined according to the method illustrated in  FIG. 4 . 
         [0223]    This figure shows in an x,y coordinate reference plane, a quadrilateral A′, B′, C′, D′, as well as, inside this quadrilateral, two points P and G of coordinates xp, yp and xo, yo. The G point may consist of the centre of gravity of the quadrilateral A′, B′, C′, D′ or more simply of the centre of its diagonals, for example the centre of segment B′D′. 
         [0224]    Segments A′B′-B′C′-C′D′ and D′A′ are borne by lines D 1 , D 2 , D 3 , D 4 , respectively. 
         [0225]    The expression of these lines and more generally of a line Di with i=1, 2, 3, 4 is of the type: 
         [0000]        ai·x+bi·y+ci= 0 
         [0000]    ai, bi, ci being constants. 
         [0226]    Point P is therefore inside the quadrilateral if and only if, it is always on the same side as G relatively to the limits of the quadrilateral (each limiting line D 1 -D 4  dividing the plane into two portions): this amounts to stating that: 
         [0227]    ai·xp+bi·yp+ci and ai·xo+bi·yo+co have the same sign for i belonging to the set {1,2,3,4}. This is written in the following form: 
         [0000]      ∀ i ε{1,2,3,4}( ai·xp+bi·yp+ci )·( ai·xo+bi·xo+ci )≧0 
         [0000]    b) A second step for calculating the ideal mask by direct homography. 
         [0228]    Reference will be made here to  FIG. 7  which illustrates the principle for calculating the image of a point by homography. On this figure, a quadrilateral P 1 , P 2 , P 3 , P 4  determined by using the method described earlier (page) and a point of coordinates (u,v) located inside this quadrilateral, are illustrated. 
         [0229]    Point O, if it exists, is the intersection of lines (P 1 , P 2 ) and (P 3 , P 4 ). Point Q is the intersection of lines (P 1 , P 4 ) and (P 2 , P 3 ). Point I is the intersection of segments OP and P 1 P 4 , whereas J is the intersection of segments QP and P 3 P 4 . 
         [0230]    It is known that homography provides the transformation of a quadrilateral (here, P 1 -P 4 ) into a rectangle H(P 1 ), H(P 2 ), H(P 3 ), H(P 4 ) visible in  FIG. 8 . 
         [0231]    In this  FIG. 8 , a point (x,y) with coordinates H(I), H(J) is also illustrated and the length D x  and the width D y  of the rectangle are shown. 
         [0232]    Conservation of the crossed ratios then gives: 
         [0000]    
       
         
           
             
               
                 
                   OP 
                   4 
                 
                 
                   OP 
                   3 
                 
               
               · 
               
                 
                   JP 
                   3 
                 
                 
                   JP 
                   4 
                 
               
             
             = 
             
               
                 Dx 
                 - 
                 1 
                 - 
                 x 
               
               x 
             
           
         
       
       
         
           
             
               
                 
                   QP 
                   4 
                 
                 
                   QP 
                   1 
                 
               
               · 
               
                 
                   IP 
                   1 
                 
                 
                   IP 
                   4 
                 
               
             
             = 
             
               
                 Dy 
                 - 
                 1 
                 - 
                 y 
               
               y 
             
           
         
       
     
         [0233]    The coordinates of H(P) may be inferred therefrom 
         [0000]    
       
         
           
             x 
             = 
             
               
                 
                   ( 
                   
                     Dx 
                     - 
                     1 
                   
                   ) 
                 
                 · 
                 
                   OP 
                   3 
                 
                 · 
                 
                   JP 
                   4 
                 
               
               
                 
                   
                     OP 
                     3 
                   
                   · 
                   
                     JP 
                     4 
                   
                 
                 + 
                 
                   
                     OP 
                     4 
                   
                   · 
                   
                     JP 
                     3 
                   
                 
               
             
           
         
       
       
         
           
             y 
             = 
             
               
                 
                   ( 
                   
                     Dy 
                     - 
                     1 
                   
                   ) 
                 
                 · 
                 
                   OP 
                   1 
                 
                 · 
                 
                   JP 
                   4 
                 
               
               
                 
                   
                     QP 
                     1 
                   
                   · 
                   
                     IP 
                     4 
                   
                 
                 + 
                 
                   
                     QP 
                     4 
                   
                   · 
                   
                     IP 
                     1 
                   
                 
               
             
           
         
       
     
         [0234]    The calculation of the image of a line by homography obviously results from this calculation as the image of a line simply consists of the segment joining the images of both points of the original line. 
         [0235]    The calculation of the ideal mask is performed according to the following process: 
         [0236]    Let (i,j) be a pixel which corresponds to the writing in the deformed binary mask with its four subpixels which surround it ( FIG. 9 ): 
         [0000]    
       
         
           
             
               ( 
               
                 
                   i 
                   - 
                   
                     i 
                     2 
                   
                 
                 , 
                 
                   j 
                   - 
                   
                     1 
                     2 
                   
                 
               
               ) 
             
             , 
             
               ( 
               
                 
                   i 
                   - 
                   
                     1 
                     2 
                   
                 
                 , 
                 
                   j 
                   + 
                   
                     1 
                     2 
                   
                 
               
               ) 
             
             , 
             
               
                 ( 
                 
                   
                     i 
                     + 
                     
                       1 
                       2 
                     
                   
                   , 
                   
                     j 
                     + 
                     
                       1 
                       2 
                     
                   
                 
                 ) 
               
                
               
                 ( 
                 
                   
                     i 
                     + 
                     
                       1 
                       2 
                     
                   
                   , 
                   
                     j 
                     - 
                     
                       1 
                       2 
                     
                   
                 
                 ) 
               
             
           
         
       
     
         [0237]    Let us assume that A, B, C and D are the images of these subpixels by direct homography ( FIG. 10 ). A, B, C, D is therefore a quadrilateral. Let us consider the smallest rectangle which this quadrilateral contains. All the pixels contained in this rectangle are set to the “true” value for example 1. 
         [0238]    An ideal binary mask may be obtained from this. A mechanism should then be established for calculating the image of a point with coordinates in the form of (u±½, v+½) wherein u, v is a pixel. 
         [0239]    For this purpose, a point P of the coordinate plane (u+½, v+½) is considered. This point is determined by the intersection of two intermediate lines: the vertical line of coordinate u+½ and the horizontal line of coordinate v+½. The image of point P is then at the intersection of the images of the horizontal and vertical lines obtained by homography. 
         [0240]    Accordingly, the images of these intermediate lines (and intermediate columns) are calculated beforehand. As soon as these images have been precalculated, the images of the subpixels are obtained by the intersection of two precalculated images of intermediate lines. 
         [0000]    c) A third inverse homography step. 
         [0241]    In order to calculate the final image, to each pixel of the binary mask, an intensity value must be assigned, which is calculated by finding the position of this pixel in the initial image: for this purpose, an inverse homography calculation needs to be performed. 
         [0242]    Thus, by repeating the symbology of  FIGS. 7 and 8 , (x,y) is considered to be a pixel of the ideal mask. This pixel is at the intersection of line y and of column x. The position of this pixel in the deformed image is then obtained by obtaining the intersection of the images of the line and column by inverse homography. 
         [0243]    The parameters of lines (QJ) and (OI) should then be found in order to calculate their intersection P. The position of points I and J should then be calculated. This result is easily obtained by finding distances JP 3  and IP 1 , for example. 
         [0244]    This is possible by using the following form of crossed ratios: 
         [0000]    
       
         
           
             
               
                 
                   OP 
                   4 
                 
                 
                   OP 
                   3 
                 
               
               · 
               
                 
                   JP 
                   3 
                 
                 
                   
                     P 
                     3 
                   
                    
                   
                     P 
                     4 
                   
                    
                   
                     JP 
                     3 
                   
                 
               
             
             = 
             
               
                 Dx 
                 - 
                 1 
                 - 
                 x 
               
               x 
             
           
         
       
       
         
           
             
               
                 
                   OP 
                   4 
                 
                 
                   OP 
                   1 
                 
               
               · 
               
                 
                   JP 
                   1 
                 
                 
                   
                     P 
                     1 
                   
                    
                   
                     P 
                     4 
                   
                    
                   
                     JP 
                     1 
                   
                 
               
             
             = 
             
               
                 Dy 
                 - 
                 1 
                 - 
                 y 
               
               y 
             
           
         
       
       
         
           
             
               IP 
               1 
             
             = 
             
               
                 
                   P 
                   1 
                 
                  
                 
                   
                     P 
                     4 
                   
                   · 
                   
                     ( 
                     
                       Dy 
                       - 
                       1 
                       - 
                       y 
                     
                     ) 
                   
                   · 
                   
                     QP 
                     1 
                   
                 
               
               
                 
                   
                     ( 
                     
                       Dy 
                       - 
                       1 
                       - 
                       y 
                     
                     ) 
                   
                   · 
                   
                     QP 
                     1 
                   
                 
                 + 
                 
                   y 
                   · 
                   
                     QP 
                     4 
                   
                 
               
             
           
         
       
     
         [0245]    It then becomes possible to calculate the position of point P. 
         [0246]    Practically, the images are calculated beforehand by inverse homography of the lines and columns of the ideal mask. The position of a given pixel is then inferred in the original image by calculating the intersection of two lines (in this example, the two lines avec (OI) and (QJ)). 
         [0247]    Of course, the invention is not limited to this single method. 
         [0000]    d) A fourth step for creating the final image: 
         [0248]    Let (u,v) be a pixel of the ideal mask. Its position in the deformed initial image is calculated by the intersection of precalculated inverse images of line v and column u. The point which is found, is then called (x,y). An intensity value should then be assigned to pixel (u,v) which will be interpolated in point (x,y) of the initial image. To accomplish this operation, bilinear interpolation is used, for example. 
         [0249]    If the pixels surrounding point (x,y) such as illustrated in  FIG. 11 , are considered, the interpolated intensity is given by formula: 
         [0000]        I ( x,y )=( y−j )[( i+ 1 −x ) I ( i,j+ 1)+( x−i ) I ( i+ 1 ,j+ 1)]+( j+ 1 −y )[( i+ 1 −x ) I ( I,j )+ I ( I+ 1 ,j )] 
         [0250]    Pixel (u,v) in the final image will then have intensity I(x,y) with the understanding that the grey levels are quantified in the final image. 
         [0251]    Advantageously, the image containing the corrected extracted data from the noise may be calculated according to the subtractive principle. 
         [0252]    It is known that luminance is equal to a combination of the intensities of the fundamental colours (red, green, blue): for example L=0.5G+0.3R+0.2B. 
         [0253]    Thus, in accordance with the method according to the invention, for each of the pixels, one successively proceeds with extracting the luminance, extracting the raw data D(p), calculating the noise contextual datum V S , extracting the noise corrected raw data D*(p) by means of the noise contextual datum, and then generating the luminance image corrected by the following calculation: 
         [0000]    
       
         
           
             
               
                 I 
                 * 
               
                
               
                 ( 
                 p 
                 ) 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         I 
                         max 
                       
                       - 
                       
                         
                           f 
                           · 
                           
                             
                               D 
                               * 
                             
                              
                             
                               ( 
                               p 
                               ) 
                             
                           
                         
                          
                         
                           ( 
                           
                             
                               dark 
                                
                               
                                   
                               
                                
                               data 
                             
                             bright 
                           
                           ) 
                         
                          
                         
                           ( 
                           
                             
                               I 
                               max 
                             
                              
                             
                                 
                             
                              
                             may 
                              
                             
                                 
                             
                              
                             be 
                              
                             
                                 
                             
                              
                             equal 
                              
                             
                                 
                             
                              
                             to 
                              
                             
                                 
                             
                              
                             255 
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       
                         I 
                         min 
                       
                       + 
                       
                         
                           f 
                           · 
                           
                             
                               D 
                               * 
                             
                              
                             
                               ( 
                               p 
                               ) 
                             
                           
                         
                          
                         
                           ( 
                           
                             
                               bright 
                                
                               
                                   
                               
                                
                               data 
                             
                             dark 
                           
                           ) 
                         
                          
                         
                           ( 
                           
                             
                               I 
                               min 
                             
                              
                             
                                 
                             
                              
                             may 
                              
                             
                                 
                             
                              
                             be 
                              
                             
                                 
                             
                              
                             equal 
                              
                             
                                 
                             
                              
                             to 
                              
                             
                                 
                             
                              
                             zero 
                           
                           ) 
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0254]    Advantageously, in the case of a colour image, the subtractive principle may be used by removing contrasts of determined chrominances from the background colour, as with a filter, in order to obtain the sought-after colour for the final image. 
         [0255]    For example, the noise contextual datum V S  may be extracted on the basis of the luminance image, and then the corrected raw data may be extracted from the noise (D* R ,D* G ,D* B ) of the colour channels by calculating the raw data of channels D R , D G , D B , expressing the contrast between the observed chrominance RGB and that of the background (V R   Back. , V G   Back. , V B   Back. ) and thresholding by means of V S , and finally generating the corrected chrominance image. 
         [0000]    
       
         
           
             
               
                 R 
                 * 
               
                
               
                 G 
                 * 
               
                
               
                 B 
                 * 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         ( 
                         
                           
                             V 
                             R 
                             Back 
                           
                           , 
                           
                             V 
                             G 
                             Back 
                           
                           , 
                           
                             V 
                             B 
                             Back 
                           
                         
                         ) 
                       
                       - 
                       
                         
                           f 
                           · 
                           
                             ( 
                             
                               
                                 
                                   D 
                                   R 
                                   * 
                                 
                                 · 
                                 
                                   D 
                                   G 
                                   * 
                                 
                               
                               , 
                               
                                 D 
                                 B 
                                 * 
                               
                             
                             ) 
                           
                         
                          
                         
                           ( 
                           
                             
                               dark 
                                
                               
                                   
                               
                                
                               data 
                             
                             bright 
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       ( 
                       
                         
                           ( 
                           
                             
                               V 
                               R 
                               Back 
                             
                             , 
                             
                               V 
                               G 
                               Back 
                             
                             , 
                             
                               V 
                               B 
                               Back 
                             
                           
                           ) 
                         
                          
                         
                             
                         
                          
                         may 
                          
                         
                             
                         
                          
                         be 
                          
                         
                             
                         
                          
                         equal 
                          
                         
                             
                         
                          
                         to 
                          
                         
                             
                         
                          
                         
                           ( 
                           
                             255 
                             , 
                             255 
                             , 
                             255 
                           
                           ) 
                         
                       
                       ) 
                     
                   
                 
                 
                   
                     
                       
                         ( 
                         
                           
                             V 
                             R 
                             Back 
                           
                           , 
                           
                             V 
                             G 
                             Back 
                           
                           , 
                           
                             V 
                             B 
                             Back 
                           
                         
                         ) 
                       
                       + 
                       
                         
                           f 
                           · 
                           
                             ( 
                             
                               
                                 
                                   D 
                                   R 
                                   * 
                                 
                                 · 
                                 
                                   D 
                                   G 
                                   * 
                                 
                               
                               , 
                               
                                 D 
                                 B 
                                 * 
                               
                             
                             ) 
                           
                         
                          
                         
                           ( 
                           
                             
                               bright 
                                
                               
                                   
                               
                                
                               data 
                             
                             dark 
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       ( 
                       
                         
                           ( 
                           
                             
                               V 
                               R 
                               Back 
                             
                             , 
                             
                               V 
                               G 
                               Back 
                             
                             , 
                             
                               V 
                               B 
                               Back 
                             
                           
                           ) 
                         
                          
                         
                             
                         
                          
                         may 
                          
                         
                             
                         
                          
                         be 
                          
                         
                             
                         
                          
                         equal 
                          
                         
                             
                         
                          
                         to 
                          
                         
                             
                         
                          
                         
                           ( 
                           
                             0 
                             , 
                             0 
                             , 
                             0 
                           
                           ) 
                         
                       
                       ) 
                     
                   
                 
               
               } 
             
           
         
       
     
         [0256]    As an example, let us assume that at a pixel, the estimated chrominance of the background corresponding to a white area of the supporting medium is (V R   Back. , V G   Back. , V B   Back. )=(160, 140, 110), and that this pixel represents a blue writing area with chrominance (V R   0 , V G   0 , V B   0 )=(120, 115, 105). Let us assume that the corrected white/blue contrast of the optical noise is (D* R ,D* G ,D* B )=(160-120, 140-115, 110-105)=(40, 25, 5). Let us set the chrominance of the pixels of the final image representing the white areas of the supporting medium to (R B , G B , B B )=(255, 255, 255), the corrected chrominance of this pixel in the final image is then determined by subtracting the contrast weighted earlier by an f factor, from that of the white, so that the corrected chrominance (R*,G*,B*) of the final image in this pixel will be, if f=1, (R*,G*,B*)=(R B −D* R ,G B −D* G ,B B −D* B )=(255−40, 255−25, 255−5)=(215, 230, 250). 
         [0257]    The f factor mentioned earlier may be advantageously used for aligning the obtained colours with reference colours, displayed for example on a test pattern. 
         [0258]    Of course, the invention is not limited to the embodiments described earlier. 
         [0259]    Thus, it is notably found that the usual process for determining the threshold value V S  at which a handwritten or printed piece of information may be extracted from each pixel of the difference image D(p) (based on knowing beforehand the probability q that a regional maximum of raw data D(p) is generated by noise), has the two following drawbacks:
       First of all, probability q must be known experimentally for each camera module in order to perform extraction of information from their images. This prevents any extracted information derived from an image captured by an unknown camera module, from being considered as trustworthy information (for example, extraction of information from an image received on a server, for forwarding it by fax to an addressee).   Next, it is mandatory to know beforehand whether the information is dark-on-bright-background information or vice versa.       
 
         [0262]    The invention therefore provides an enhancement of this method with which the two drawbacks mentioned earlier may be avoided. This enhancement notably provides accurate determination of the threshold value V S , at which the printed or handwritten information may be extracted from the difference image D(p) (analogous to D[C,L]) and determination whether the information is dark on a bright background or vice versa, bright on a dark background. 
         [0263]    By considering a grey level image I(p) which may either be a combination of the three colour channels of the image (red, blue, green) or one of these three channels, the method according to the invention comprises the following steps, with reference to  FIG. 12 : 
         [0264]    1) A first step for calculating a pit histogram H_pits includes the following operating phases: 
         [0265]    a) for each pixel p of image I, the following is performed: 
         [0266]    i. for each direction d with 0&lt;|d|&lt;D: 
         [0267]    if the condition
       convexity of I on [p−d, p+d] i.e.       
 
         [0000]        I ( p +(1−2×) d )≦λ I ( p−d )+(1−λ) I ( p+d ) for any 0≦λ≦1 
         [0269]    is satisfied 
         [0270]    then G(p,d)=(I(p+d)+I(p−d))/2 is calculated 
         [0271]    or else G(p,d)=0 
         [0272]    ii. S(p)=maximum value of G(p,d) is calculated for all directions d with 0&lt;|d|&lt;D 
         [0273]    b) the maximum value of the pits, S_pits_max is calculated, which is equal to the maximum value of S(p) for all the pixels p 
         [0274]    c) the pit histogram H_pits is reset to 0 for each value of s between 0 and the maximum value of the pits, S_pits_max 
         [0275]    d) for each pixel p of image S(p) the following calculations are performed: 
         [0276]    i. if S(p) is a regional maximum, 
         [0277]    H_pit (S(p)) is incremented in the following way: 
         [0000]        H _pit( S ( p ))← H _pit( S ( p ))+1 
         [0278]    2) A second step for calculating the bump histogram H_bumps includes the following operating phases: 
         [0279]    a) for each pixel p of image I, the following is performed: 
         [0280]    i. for each direction d with 0&lt;|d|&lt;D
       if the following condition   concavity of I on [p−d, p+d], i.e.,       
 
         [0000]        I ( p +(1−2λ) d )≧λ I ( p−d )+(1−λ) I ( p+d ) for any 0≦≦λ≦1 
         [0283]    then G(p,d)=(I(p+d)+I(p−d))/2 is calculated 
         [0284]    or else G(p,d)=0 
         [0285]    ii. S(p)=maximum value of G(p,d) is calculated for all directions d with 0&lt;|d|&lt;D 
         [0286]    b) the maximum value of the bumps S bumps_max is calculated, which is equal to the maximum value of S(p) for all the pixels p 
         [0287]    c) the bump histogram H_bumps(s) is reset to 0 for each s between 0 and the maximum value of the bumps, S bumps_max 
         [0288]    d) for each pixel p of image S(p), the following calculations are performed: 
         [0289]    i. if S(p) is a regional maximum 
         [0290]    H_bumps(S(p)) is incremented in the following way: 
         [0000]        H _bumps( S ( p ))← H _bumps( S ( p ))+1 
         [0291]    3) A third step for superimposing pit H_pits and bump H_bumps histograms includes the following operating steps:
       a) calculating S_max according to the expression:       
 
         [0000]        S   max =Max(maximum value of the pits  S _pits_max,maximum value of the bumps  S _bumps−max)       b) calculating H_max according to the expression:         
         [0000]        H _max=maximum value of the pits, H _pits( S ) and of the bumps, H _bumps( S ), for all values of  S          c) calculating s0 according to the expression:   s0=maximum value of s such that         
         [0000]        H _pits( s )= H _max       or H_bumps(s)=H_max   d) s=s0+1 is calculated and α is selected such that 0&lt;α&lt;½ and as long as:         
         [0000]      |ln(1+ H _pits( s ))−ln(1 +H _bumps( s ))&lt;α·ln(1 +H _max) 
         [0298]    s=s+1 is performed (where in is Napier&#39;s logarithm function) 
         [0299]    finally, value 5 min is determined by the final value of s incremented by 1 
         [0300]    4) A step for calculating the value of the extraction threshold V S  according to the relationship: 
         [0000]        V   S   =r·S   min +(1 −r )· S   max  where ½ ≦r≦ 1 
         [0301]    5) A step for comparing H_pits and H_bumps includes the following operating phases for β&gt;0: 
         [0302]    a) calculating a value N_pits from the relationship: 
         [0000]        N _pits=sum of  H _pits( s ) β  for  s= 5 min to  s=S _pits_max 
         [0303]    b) calculating a value N_bumps from the relationship: 
         [0000]        N _bumps=sum of  H _bumps( s ) β  for  s=S   min  to  s=S _bumps_max 
         [0304]    c) if N_pits is less than N_bumps, then the dark-on-bright-background information should be extracted or else the bright-on-dark-background information should be extracted 
         [0305]    6) A step for extracting luminance information L(p) includes the following operating phases: 
         [0306]    a) calculating D according to a known method 
         [0307]    b) for each pixel p in the difference image D(p), 
         [0000]    if D(p)&gt;V S , then D(p) is considered relevant and is extracted 
         [0308]    i. if the information is dark-on-bright-background information, calculating a value, L(p)=I max −f·D(p), I max  may be equal to 255 
         [0309]    ii. or else the value L(p)=I min +f·D(p) is calculated, I min  may be equal to 0 
         [0310]    If D(p) is not considered relevant 
         [0311]    i. if the information is dark-on-bright-background information, the value of L(p) is equal to I max  (bright background) 
         [0312]    ii. or else the value of L(p) is equal to I min  (dark background) 
         [0313]    As an example, satisfactory results may be obtained with the following parameters: 
         [0314]    D=3 
         [0315]    α=20% 
         [0316]    r=85% for extraction 
         [0317]    f=5 
         [0318]    The invention also relates to the simulation of an image of a rectangle (A, B, C, D) with a prescribed physical aspect ratio r=CD/AD, a prescribed point of the projected rectangle in the image (for example point D) and a known projected distance (for example CD) with a camera having a prescribed focal length (f), a tilt angle (π/2)−i where i is the angle of incidence), α is an angle of rotation around the axis of the camera and if i≠0, a prescribed skew angle (β) relatively to one of the existing vanishing points (for example F 1 ). These different parameters are indicated in  FIG. 13  which schematically illustrates a camera, with its optical axis and the focal point with the ox, oy, oz coordinate reference system which is bound to this focal point. 
         [0319]    The solution of this problem comprises the three following steps which refer to  FIGS. 2 and 3  and to  FIG. 14 , i.e.:
       A first step for calculating the position of the three unknown points A, B and C (point D being prescribed) in the new image which must be generated. The points must be consistent with the physical aspect ratio r of the pattern which must be projected on this new image and the position of the camera (focal distance, tilt angle, angle of rotation, skew angle) which must be simulated.   A second step for calculating homographic relationships in order to project the information contained in the pattern of the original image on the calculated pattern of the simulated image.   A third step for determining luminance and chrominance of the new image within the contour calculated from the original image with homographic relationships.       
 
         [0323]    Calculation of the three unknown points of the pattern takes into account the three following cases: 
         [0324]    If i≠0 (there is at least one vanishing point), the calculation comprises the four following operating phases:
       1. OX=f·tan(i)   2. OF=f/tan(i)   3. Points X and F are placed on a line crossing through the centre of image O and forming an angle α relatively to the vertical   4. Point F 1  is placed such that       
 
         [0000]        FF   1   =f  tan(β)/sin( i ) 
         [0329]    a) if β≠0 (2 vanishing points)
       i) point F 2  is placed such that FF 2 =(OF·XF)/FF 1      ii) points M 1 , C, N 1 , O 1 , P 1 , O 2 , P 2  and N 2  are inferred from points X, F 1 , F 2  (if β≠0), D and from distance DC,   iii) point M 2  is placed so as to obtain the relationship       
 
         [0000]    
       
         
           
             r 
             = 
             
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         M 
                         1 
                       
                       , 
                       
                         N 
                         1 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         M 
                         2 
                       
                       , 
                       
                         N 
                         2 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         O 
                         1 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         M 
                         1 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         P 
                         1 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         1 
                       
                       , 
                       
                         N 
                         1 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         M 
                         2 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         O 
                         2 
                       
                     
                     ) 
                   
                 
               
               · 
               
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         N 
                         2 
                       
                     
                     ) 
                   
                 
                 
                   dist 
                    
                   
                     ( 
                     
                       
                         F 
                         2 
                       
                       , 
                       
                         P 
                         2 
                       
                     
                     ) 
                   
                 
               
             
           
         
       
     
         [0333]    b) if β≠0 (only one vanishing point: F 1 =F) ( FIG. 3 ) 
         [0334]    i) point A is placed on line (DF) such that 
         [0000]    
       
         
           
             AF 
             = 
             
               r 
               · 
               DF 
               · 
               
                 
                   
                     
                       f 
                       2 
                     
                     + 
                     
                       OF 
                       2 
                     
                   
                 
                 
                   DC 
                   + 
                   
                     r 
                      
                     
                       
                         
                           f 
                           2 
                         
                         + 
                         
                           OF 
                           2 
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0335]    ii) point B is placed on line (FC) such that BF=CF·(AF/DF) 
         [0336]    c) if i=0 (no vanishing point) ( FIG. 14 )
       1) point C is placed by using point D, distance DC and the angle of rotation α   2) point B is placed such that (A, B, C, D) is a rectangle.

Technology Classification (CPC): 6