FIELD OF THE INVENTION 
       [0001]    The present invention relates to a high precision method for calibrating and removing distortion from a lens, and more particularly, a method for calibrating and removing distortion by arranging sensor readings to compensate for its presence and simultaneously optimize the resulting image magnification for best image quality. 
       BACKGROUND OF THE INVENTION 
       [0002]    An optical instrument is generally required to produce a geometrically consistent image of a given object, where each point is imaged as a point in the image. The image is generally formed in accordance with some predefined imaging model, which in this case, is assumed to be a projective camera. The departure of practical optical systems from ideal behavior leads to the introduction of aberrations in the resulting images. The aberration here is lens distortion, a well known monochromatic aberration, which is present in both color and greyscale imaging devices. Its nature is predominantly a radial geometric displacement of pixels giving a barrel or a pincushion effect but without loss of image quality. 
         [0003]    Lens distortion is a thorn in the side of many relatively straightforward image analysis tasks. It comprehensively degrades the accuracy of measurements made in real images, where pixels in a normal perspective camera can typically be displaced by up to ten percent of the image width. 
         [0004]    One known method for addressing lens distortion is in conjunction with a complete calibration of the camera system. Complete camera calibration essentially means that the camera&#39;s internal and external parameters are obtained. Internal parameters roughly relate to the camera lens, such as focal length and optical axis. Lens distortion parameters may be considered as an add-on to the set of internal camera parameters. The external parameters relate to the positioning of the camera. Such conventional camera calibration methods are disclosed in many research papers. The importance of distortion in this regard has seen the utter dominance of these more complicated algorithms at the expense of those that do not consider distortion. 
         [0005]    Despite this, many applications do not require the full complement of internal camera parameters and the relative orientation in relation to some calibration target. Non-metric applications differ in that they do not necessarily employ the lens or external characteristics in determining distortion. 
         [0006]    In the 1960&#39;s Duane C. Brown, working in the area of photogrammetry, proposed a method for determining lens distortion based on the truism that straight lines must be imaged as straight lines. This technique, published in (Brown, 1971), and with extensions in (Fryer and Brown, 1986), became known as the ‘plumb line’ method, where initially fine white thread was stretched by plumb bobs which were stabilized in an oil bath. A comprehensive historical review is given in Clarke and Fryer (1998). This technique was adopted by the machine vision community where simplified versions of the plumb line method were presented, e.g. Prescott and McLean (1997b), (also as patent Prescott and McLean (1997a) XP000683415) Haneishi et al. (1995a) (also as patent Haneishi et al. (1995b) XP000527216) Poulo and Gorman (1999) U.S. Pat. No. 6,002,525 and Asari et al. (1999) all describe a similar truism based correction for the correction of distortion using images of co-linear points. Similarly, high level distortion is considered in Brauer-Burchardt and Voss (2001), however the real example shown, with a quoted residual distortion of ±0.7 pixels, resembles a quite benign distortion level. Since these methods only estimate distortion, they are sometimes referred to as non-metric calibration. 
         [0007]    An intrinsic problem for the multiple line based methods is that it becomes intractable to form geometric relationships between a distorted line segment and its true projection. An alternating approach was employed, for example in Devernay and Faugeras (2001), Tzu-Hung (2003) and Bing (1999) EP0895189, which iteratively adjusts the distortion parameters in order to minimize the line fitting to the distorted line segments. No meaningful geometric relationship exists between this objective error and the distortion parameters, hence no analytical derivatives are available. This results in slow convergence and can become unstable for elevated distortion levels, unless special steps are taken, as in Swaminathan and Nayar (2000). In this non-metric approach Swaminathan and Nayar (2000) reformulated the objective function in distorted space instead of the usual undistorted space. This is done by performing a further search at each alternation to find the location of a point closest to the considered distorted point, but that lies exactly on the line fitted to the current undistorted point estimates. The reported results showed improved robustness to noise for simulated data but no meaningful performance was reported in the real case. 
         [0008]    Another approach has been suggested in Ahmed and Farag (2001) where the curvature of detected lines are used to estimate the parameters of the derivative distortion equation. However, the simulation results showed abysmal performance in the presence of noise, while the real results lacked a qualitative evaluation. 
         [0009]    A more standard means of calibrating distortion is with the simultaneous estimation of a camera&#39;s extrinsic and intrinsic parameters. Tsai&#39;s method (Tsai, 1987) involves simultaneously estimating, via an iterative numerical optimization scheme, the single distortion parameter and some internal parameters such as focal length, given the 3D position of a set of control points. The external parameters or position of the camera is already computed in a previous step. The disadvantage of this approach is that it requires known 3D control points and in return offers relatively low accuracy for all but simple distortion profiles. Algorithmic variations on this principal have been proposed by some, such as Weng et al. (1992) and Wei and Ma (1994) using more appropriate models for lens distortion. These methods also require known 3D control points. 
         [0010]    The generation of distortion corrected images is investigated in Heikkila and Silven (1997), while Heikkila (2000) describes a similar technique that requires 3D control points or multiple image sets of 2D control points. An alternative method also based on multiple sets of 2D control points has been advanced in Zhang (1998, 2000) and Sturm and Maybank (1999). This technique addresses distortion through an alternating linear least squares solution which is then iteratively adjusted in a numerical minimization including all estimation parameters. The relative complexity of these techniques is increased by the inclusion of lens distortion. 
         [0011]    On the other hand there are many situations where only distortion removal is required, not the full complement of intrinsic and extrinsic parameters. An example is in the estimation of multiple view geometry in real images, where techniques have been specifically developed to accommodate lens distortion. Zhang (1996) investigates the possibility of simultaneously estimating distortion parameters and the Fundamental Matrix. The results conclude that this is possible if noise is low and distortion is high. Fitzgibbon (2001) (with patent Fitzgibbon (2003) GB2380887), Micusik and Pajdla (2003) and Barreto and Daniilidis (2004) use an alternative model for distortion, leading to a polynomial Eigenvalue problem and a more reliable estimation of distortion and geometry. Stein (1997) took the reverse approach and used the error in Fundamental Matrix estimation as an objective error to estimate distortion parameters. 
         [0012]    Alternative methods of distortion calibration exist, where control points correspondences are abandoned in favor of distortion free scenes. These scenes are then imaged by the camera system, whereupon an image alignment process is conducted to correct for distortion. Lucchese and Mitra (2003) describe a technique where the distorted image is warped until it registers (in intensity terms) with the reference image. A similar technique using a coarse filter to find registration is described in Tamaki (2002) (with patent Tamaki et al. (2002) US2002057345) while Sawhney and Kumar (1999) (also with patent Kumar et al. (1998) WO9821690) describe a registration technique that does not require an undistorted reference image. Instead, multiple images are registered for the generation of a mosaic image, for example such as a panoramic resulting from the combination of several different views, and distortion is simultaneously estimated. These techniques have a very high computational overhead, with twenty minutes quoted in Tamaki (2002). 
         [0013]    A final class of non-metric calibration methods are based on distortion induced high-order correlations in the frequency domain. Farid and Popescu (2001) describe a technique, however its performance is poor in comparison with regular camera calibration techniques and it also appears to be slightly dependent on the image content. Yu (2004) further develops this approach with alternative distortion models and reports accuracy approaching that achieved with regular camera calibration if the source image is of a regular calibration target. Finally, a means of fabricating a curved CCD array has been suggested by Gary (2003) US2003141433. In the lens distortion profile is copied in the array by a series of line segments, thus the resulting image appears distortion free. 
       SUMMARY 
       [0014]    The solution provided herein may be considered non-metric as no regular internal or external camera parameters are explicitly required. This solution is found with much higher stability and precision than other non-metric approaches. The performance at least matches, and often surpasses, that of complete calibration methods. Its practical implementation is very straightforward, requiring the camera to capture only a single view of a readily available calibration target. A more complete understanding of the invention will be appreciated from the description and accompanying drawings and the claims which follow. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]    The foregoing and other features and advantages of the present invention will be more fully understood from the following detailed description of illustrative embodiments, taken in conjunction with the accompanying drawings in which: 
           [0016]      FIG. 1  is a graphical interpretation of the formation of a distorted image and its undistorted counterpart; 
           [0017]      FIG. 2A  is an original distorted image; 
           [0018]      FIG. 2B  is a resampled image; 
           [0019]      FIG. 2C  is an optimally adjusted resampled image; 
           [0020]      FIG. 3  is a table showing the properties of a proposed algorithm of Method 1 in comparison to alternate techniques; 
           [0021]      FIG. 4  is a table of residual errors for Method 1 in mean (SD) format; 
           [0022]      FIG. 5  is a table of Residual Errors for a prior art method (Method 2) in mean (SD) format; 
           [0023]      FIG. 6  is a table of Residual errors for a prior art (Method 3) in mean (SD) format; 
           [0024]      FIG. 7  is a table of Residual errors for a prior art (Method 4) in mean (SD) format; 
           [0025]      FIG. 8  is a table of real distortion samples, including the number of iterations for each of the methods where available; 
           [0026]      FIGS. 9A ,  9 B and  9 C are illustrations showing three calibration images; 
           [0027]      FIG. 9D  is an illustration of an evaluation image; 
           [0028]      FIG. 10  is a table of distortion residuals on real examples; 
           [0029]      FIG. 11  is a table of a comparison of Method 1 to prior art method 2 both using the same distortion model (i.e. two parameter radial model); 
           [0030]      FIGS. 12A ,  12 B and  12 C are corrected evaluation images; 
           [0031]      FIG. 13  illustrates Method 1 parameters with scaled 95% uncertainty bound; 
           [0032]      FIG. 14  illustrates Method 2 parameters; 
           [0033]      FIG. 15  illustrates Method 3 parameters with scaled 95% uncertainty bound; 
           [0034]      FIG. 16  illustrates Method 4 parameters with scaled 95% uncertainty bound; 
           [0035]      FIG. 17  illustrates a graph of the Mean and SD errors for the 4 methods computed over 100 random positions of control points; 
           [0036]      FIG. 18  illustrates the mean estimated distortion center less the ideal value, for the 4 methods over the range of distortion; 
           [0037]      FIG. 19  illustrates the mean and SD of parameter values for Method 1 over the 100 randomly chosen control point locations; 
           [0038]      FIG. 20  illustrates the mean and SD of parameter values for Method 2 over the 100 randomly chosen control point locations; 
           [0039]      FIG. 21  illustrates mean and SD of parameter values for Method 3 over the 100 randomly chosen control point locations; 
           [0040]      FIG. 22  illustrates mean and SD of parameters values for Method 4 over the 100 randomly chosen control point locations; 
           [0041]      FIG. 23  is a table illustrating the estimates of the distortion center for each of the prior art methods 2, 3 and 4 and the method of the present application, 
           [0042]      FIG. 24  is an exemplary process flow for determining the distortion parameters of Method 1, and 
           [0043]      FIG. 25  is an exemplary process flow for correcting an image using the distortion parameters as determined from the Method of  FIG. 24 . 
       
    
    
     DETAILED DESCRIPTION 
       [0044]    The present invention addresses a problem of geometric distortion in optical systems by rearranging the sensor readings to compensate for its presence. Any array type lens system is applicable such as infrared sensors and optical laser deflection systems, color and monochrome cameras regardless of resolution. The method of the present invention is highly accurate, stable and suitable for all levels of lens distortion. The correction method of the present application may be applied to both RAW and processed images. However, where other corrections for other distortions are also applied, the process may more suitably be performed on RAW format images in advance of or subsequent to the other correction processes. 
         [0045]    Many calibration methods are complicated to carry out, requiring multiple views of a target while avoiding degenerate configurations. Their software requirements are also nontrivial, often requiring a complete nonlinear bundle adjustment optimization. Whilst these methods may be suitable for complex industrial applications, they are not generally suitable for mass produced consumer products. In contrast, the method of the present invention provides a simpler method requiring one view of a calibration target which may be easily taken in a fronto parallel position. The position of the pattern relative to the camera coordinate system is not required. Two constraints are placed on the calibration target, that of planarity and known structure. These requirements are easily met, for example a regular pattern such as a chessboard has a regular grid structure and is easily made planar. The method does not require that the pattern be present in a specific location or orientation merely that the structure is known and entirely captured in an acquired image on the sensor. By known structure, it is meant that the configuration of the pattern is known in 2 dimensions (e.g. for a checkerboard pattern the number of square in each dimension in contrast the physical size is not important). 
         [0046]    In addition, the problem of optimally forming a new aberration free image from an initial digital representation is addressed. The optimization is focused on minimizing the unavoidable resampling errors due to the sealing and sheering effects of the digital interpolation. As discussed below, a mathematical formulation is described to automatically compute an affine transform to minimize these distortions, improving the overall image quality. 
         [0047]    As described in the background, lens distortion can comprehensively degrade the accuracy of measurements made in real images, where pixels in a normal perspective camera with a low focal length may move up to 30 pixels. In terms of the removal of such distortions, a precise means of calibrating and removing distortion is in conjunction with a full calibration of the internal and external parameters. The importance of distortion in this regard has seen the utter dominance of these more complicated algorithms at the expense of those that do not consider distortion. Despite this, many applications do not require the full complement of internal camera parameters and the relative orientation in relation to some calibration target. Selections of these, such as multiple view geometry estimation, in cases prefer to explicitly include lens distortion factors at the expense of extra complexity. 
         [0048]    Algorithms for internal and external camera calibration, multiple view geometry estimation, etc. are rendered considerably simpler by the lack of lens distortion. However, despite the long term existence of non-metric calibration techniques to enact this removal of distortion, they have not been adopted. It is believe, that this may be due to poor performance of such methods, their limited circumstances of usage, and their own relatively complex practical implementation. The present application comprehensively teaches an easy to use and highly precise method for calibrating lens distortion of all levels in perspective cameras. 
         [0049]    The present application is non-metric, as no internal or external camera parameters are explicitly available or required (although where the camera parameters are adjustable, these may be employed as inputs to improve performance). Non-metric refers to the unavailability of any internal or external camera parameters or orientations. The method exploits two geometric priors on the planarity of the control points and their known structure up to an arbitrary scale. Using a single view of the calibration pattern, an error function is formed in distorted space using a conventional mathematical distortion model. It will be appreciated that the model may be rewritten in non-distorted space, however this has the disadvantage of possibly reduced precision. As will be discussed below, the necessary undistorted coordinates are simultaneously estimated through a general projective transform. The partial derivatives of a quadratic cost function are then computed for all estimated parameters, allowing the closed form computation of the cost gradients for minimization. The resampling of an aberration free image is interpreted as a function (using resampling) in distortion free coordinate space, hence the calibrated forward distortion model generated by the method may be applied directly to distorted images. Automatic resealing may be applied to balance the creation and loss of pixels in this resampling. 
         [0050]    In comparison with the current benchmark for calibrating distortion through full camera calibration, the proposed approach has numerable advantages. Only one input image is required for the calibration, ideally taken in a roughly fronto parallel position. The distortion and associated parameters are estimated in a closed form solution with full partial derivatives, giving a computational advantage over current numerical techniques. Closed form in this sense refers to the direct geometric relationship between the criterion and the underlying model, meaning that it is absolutely correct at all times not just upon convergence conditions. The accuracy of the method matches and surpasses that of complete calibration over a general coverage of all possible distortion levels in perspective cameras. It also offers an alternative means of dealing with distortion for the many tasks that do not require the full complement of camera parameters. Additionally, the subsequent calibration of internal and/or external camera parameters becomes much simpler in the absence of lens distortion. 
         [0051]    In an embodiment, the calibration technique pursued requires one view of a calibration pattern. Two geometric priors are assumed on this calibration target, that of planarity and of known (up to an arbitrary scale) canonical coordinates for the pattern defined control points. Additionally, it can be assumed that all control points are observable within the image window and are appropriately ordered so as to correspond with the scaled canonical model. 
         [0052]    Considering the detection of a chessboard in an unknown position, the intersections with image coordinates are denoted as shown in Equation 1, with units of pixels (pix), a straight forward transform (subtracting fixed values from each of the x and y co-ordinates with scaling for stability purposes when performing calculations, inverse translation and scaling are subsequently applied when correcting an image) is specified to convert these measurements into a lens centered coordinate space. 
         [0000]          c =(   ū,  v , 1) T   (1)
 
         [0000]    where  c  is the vector of pixel (control point) measurements made with ū being the x co-ordinate,  v  being the y co-ordinate (Note: this is expressed and all equations hence are expressed in homogenous form unless stated otherwise). 
         [0053]    The required lens centric transform may be defined by Equation 3 below; 
         [0000]    
       
         
           
             
               
                 
                   
                     p 
                     _ 
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             
                               s 
                             
                             
                               0 
                             
                             
                               
                                 - 
                                 
                                   u 
                                   o 
                                 
                               
                             
                           
                           
                             
                               0 
                             
                             
                               s 
                             
                             
                               
                                 - 
                                 
                                   v 
                                   o 
                                 
                               
                             
                           
                           
                             
                               0 
                             
                             
                               0 
                             
                             
                               1 
                             
                           
                         
                         ) 
                       
                        
                       
                         ( 
                         
                           
                             
                               
                                 u 
                                 _ 
                               
                             
                           
                           
                             
                               
                                 v 
                                 _ 
                               
                             
                           
                           
                             
                               1 
                             
                           
                         
                         ) 
                       
                     
                     = 
                     
                       A 
                        
                       
                         c 
                         _ 
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0054]    The lens centric coordinate system obtained by this Euclidian transform applied to measured values can be thought of as the actual metric measurements of the ray intersections with the surface of the sensor pickup (e.g. CCD array), centered on the optical axis of the lens. As most sensors are not aligned accurately with respect to the lens, the center of the sensor array cannot be assumed to contain the optical axis. The precise metric values of the ray intersections are not required to influence the scale of the distortion parameters. 
         [0055]    Arbitrary scaling of lens centric coordinates, or equivalently varying sensor resolution, causes the parameter values of distortion to change, not the number of parameters as is clear from Equation 2 below where λ is an arbitrary scale and the proof which follows. 
         [0000]      λ(   p −p )=λ D ( p,k )= D (λ p,k   λ ),  (2)
 
         [0000]    where λ is the scaling factor and k λ  is the scaled parameter vector. 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       Proof 
                       _ 
                     
                     : 
                     
                       λ 
                        
                       
                           
                       
                        
                       
                         D 
                          
                         
                           ( 
                           
                             p 
                             , 
                             k 
                           
                           ) 
                         
                       
                     
                   
                   = 
                     
                    
                   
                     D 
                      
                     
                       ( 
                       
                         
                           λ 
                            
                           
                               
                           
                            
                           p 
                         
                         , 
                         
                           k 
                           λ 
                         
                       
                       ) 
                     
                   
                 
               
             
             
               
                 
                   
                     = 
                       
                      
                     
                       λ 
                        
                       
                         ( 
                         
                           
                             
                               
                                 
                                   
                                     k 
                                     1 
                                   
                                    
                                   
                                     λ 
                                     2 
                                   
                                    
                                   
                                     xr 
                                     2 
                                   
                                 
                                 + 
                                 
                                   
                                     k 
                                     2 
                                   
                                    
                                   
                                     λ 
                                     4 
                                   
                                    
                                   
                                     xr 
                                     2 
                                   
                                 
                                 + 
                                 … 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     k 
                                     1 
                                   
                                    
                                   
                                     λ 
                                     2 
                                   
                                    
                                   
                                       
                                   
                                    
                                   y 
                                    
                                   
                                       
                                   
                                    
                                   
                                     r 
                                     2 
                                   
                                 
                                 + 
                                 
                                   
                                     k 
                                     2 
                                   
                                    
                                   
                                     λ 
                                     4 
                                   
                                    
                                   y 
                                    
                                   
                                       
                                   
                                    
                                   
                                     r 
                                     2 
                                   
                                 
                                 + 
                                 … 
                               
                             
                           
                         
                         ) 
                       
                     
                   
                   , 
                 
               
             
             
               
                 
                   
                     = 
                       
                      
                     
                       λ 
                        
                       
                           
                       
                        
                       
                         D 
                          
                         
                           ( 
                           
                             p 
                             , 
                             k 
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
             
           
         
       
     
         [0056]    As k λ  absorbs the scaling factors as: k λ =(λ 2 k 1 , λ 4 k 2 , . . . ) T    
         [0057]    As a consequence, the recovered control points are normalized roughly to unit length by the average of the image width and height to standardize the scaling of the distortion parameters and improve the conditioning of the estimation equations. 
         [0058]    In the present application, references to the Forward model refer to the system models formulated in distorted space and references to the Reverse model refer to models formulated in undistorted space. 
         [0059]    The Forward model of distortion will now be derived and its advantages in comparison with other models theoretically argued and experimentally shown. The distortion may be expressed as shown in Equation 4 below: 
         [0000]          p =p+D ( p,k )  (4)
 
         [0060]    Where D(p,k) is expressed in Equation 5 below: 
         [0000]    
       
         
           
             
               
                 
                   
                     D 
                      
                     
                       ( 
                       
                         p 
                         , 
                         k 
                       
                       ) 
                     
                   
                   ≈ 
                   
                     ( 
                     
                       
                         
                           
                             
                               
                                 
                                   k 
                                   1 
                                 
                                  
                                 
                                   xr 
                                   2 
                                 
                               
                               + 
                               
                                 
                                   k 
                                   2 
                                 
                                  
                                 
                                   xr 
                                   4 
                                 
                               
                               + 
                               
                                 
                                   k 
                                   3 
                                 
                                  
                                 
                                   xr 
                                   6 
                                 
                               
                               + 
                               … 
                             
                              
                             
                                 
                             
                           
                         
                       
                       
                         
                           
                             
                               
                                 k 
                                 1 
                               
                                
                               y 
                                
                               
                                   
                               
                                
                               
                                 r 
                                 2 
                               
                             
                             + 
                             
                               
                                 k 
                                 2 
                               
                                
                               y 
                                
                               
                                   
                               
                                
                               
                                 r 
                                 4 
                               
                             
                             + 
                             
                               
                                 k 
                                 3 
                               
                                
                               y 
                                
                               
                                   
                               
                                
                               
                                 r 
                                 6 
                               
                             
                             + 
                             … 
                             + 
                           
                         
                       
                       
                         
                           
                             
                               
                                 ( 
                                 
                                   
                                     
                                       p 
                                       1 
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           3 
                                            
                                           
                                             x 
                                             2 
                                           
                                         
                                         + 
                                         
                                           y 
                                           2 
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                     2 
                                      
                                     
                                       p 
                                       2 
                                     
                                      
                                     xy 
                                   
                                 
                                 ) 
                               
                                
                               
                                 ( 
                                 
                                   1 
                                   + 
                                   
                                     
                                       p 
                                       3 
                                     
                                      
                                     
                                       r 
                                       2 
                                     
                                   
                                   + 
                                   … 
                                 
                                  
                                 
                                     
                                 
                                 ) 
                               
                             
                             + 
                           
                         
                       
                       
                         
                           
                             
                               ( 
                               
                                 
                                   2 
                                    
                                   
                                     p 
                                     1 
                                   
                                    
                                   xy 
                                 
                                 + 
                                 
                                   
                                     p 
                                     2 
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         3 
                                          
                                         
                                           y 
                                           2 
                                         
                                       
                                       + 
                                       
                                         x 
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 1 
                                 + 
                                 
                                   
                                     p 
                                     3 
                                   
                                    
                                   
                                     r 
                                     2 
                                   
                                 
                                 + 
                                 … 
                               
                                
                               
                                   
                               
                               ) 
                             
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0061]    In this function, the radial distortion component is represented by k 1 , k 2  and k 3  while the distortions introduced by decentering correspond to p 1 , p 2  and p 3 . These are combined into the parameter vector k=(k 1 , k 2 , k 3 , . . . p 1 , p 2  . . . ) T . It will be appreciated that for radial distortion we are not concerned with the tangential distortion coefficients of p 1  p 2  and p 3  although the method may account for these automatically as will be discussed in detail below. 
         [0062]    Given the normalized coordinates, {hacek over (c)}, of an arbitrarily oriented planar target, a planar transform or homography may be computed as shown in  FIG. 1 . 
         [0063]    A projective 3×3 transformation H d  can be computed between the captured image co-ordinates and a co-ordinate system for the known calibration target. This may be computed from the equation below: 
         [0000]      min Σ(   c ,H   d     w   ) 2  
 
         [0000]    where  w  are the canonical co-ordinates of the control points of the pattern (e.g. the corners in a chessboard pattern) with unknown scale. 
         [0064]    The application of H d  results in {tilde over (c)} as shown below: 
         [0000]    
       
      
       {tilde over (c)}=H 
       d 
         w ,  
      
     
         [0065]    H d  accounts for scale and position which when combined with H e  described below accounts for the unknown undistorted set of points from the measured set. The transform H d  may readily be determined using a conventional least squares system to match the acquired image of the calibrated target with its known representation. 
         [0066]    In addition, a distortion free projection of planar points, viewed from an arbitrary position, may be related to their distorted counterparts through the application of a general projective transform H e  as shown below: 
         [0000]        c=H   e   {tilde over (c)}   (6)
 
         [0067]    Equation 6 represents a key element in expressing distortion in a closed-form solution, enabling the recovery of the previously unavailable data c, through the simultaneous estimation of 3×3 matrix transform H e . Without loss of generality, H e  is scaled so that h 33  is one. In practice, no further constraints are available on H e  as the estimate of H d  is corrupted due to noise. 
         [0068]    A general form for H e  is to absorb inaccuracies. For each observed control point {hacek over (c)} i  an error function, as in Equation 7 may be formed. 
         [0000]        e   i ( {hacek over (c)}   1 ,φ)= H   e   {tilde over (c)}   i   +D ( H   e   {tilde over (c)}   i   ,k )− A{tilde over (c)}   i   (7)
 
         [0000]    , where the full parameter vector is φ=(h 11 , h 12 , . . . , s, u 0 , v 0 , k 1 , k 2 ) with φεIR nφ   
         [0069]    It will be appreciated that φ represents all of the unknown parameters. 
         [0070]    In solving a problem, a parameter counting exercise shows that for a parameter vector of length n φ , a minimum of m=ceil(n φ /2) control point observations (for example corners in a chessboard pattern) are required, where ceil ( ) is rounding towards +∞. Given at least n≧m observations, a least square solution may be obtained by Equation 8: 
         [0000]    
       
         
           
             
               
                 
                   
                     min 
                      
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         n 
                       
                        
                       
                         
                           
                             e 
                             i 
                           
                            
                           
                             ( 
                             
                               
                                 
                                   c 
                                   ⋓ 
                                 
                                 i 
                               
                               , 
                               
                                 φ 
                                 ^ 
                               
                             
                             ) 
                           
                         
                         2 
                       
                     
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             
                               
                                 e 
                                 i 
                               
                                
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ⋓ 
                                     
                                     i 
                                   
                                   , 
                                   
                                     φ 
                                     ^ 
                                   
                                 
                                 ) 
                               
                             
                             2 
                           
                         
                       
                       
                         
                           
                             
                               
                                 e 
                                 i 
                               
                                
                               
                                 ( 
                                 
                                   
                                     
                                       y 
                                       ⋓ 
                                     
                                     i 
                                   
                                   , 
                                   
                                     φ 
                                     ^ 
                                   
                                 
                                 ) 
                               
                             
                             2 
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0071]    This problem is nonlinear requiring a nonlinear optimization solution_One standard way of solving such an equation is to linearize it Equation 8 with some initial parameter value of φ 0 , resulting in an iterative Gauss-Newton scheme which can be solved using many robust least square techniques, such as Equation 9: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       φ 
                       ⋒ 
                     
                     
                       k 
                       + 
                       1 
                     
                   
                   = 
                   
                     
                       
                         φ 
                         ⋒ 
                       
                       k 
                     
                     - 
                     
                       
                         
                           λ 
                           ( 
                           
                             
                               
                                 ∂ 
                                 
                                   
                                     e 
                                     T 
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         c 
                                         ⋓ 
                                       
                                       , 
                                       
                                         
                                           φ 
                                           ^ 
                                         
                                         k 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               
                                 ∂ 
                                 φ 
                               
                             
                              
                             
                               
                                 ∂ 
                                 
                                   e 
                                    
                                   
                                     ( 
                                     
                                       
                                         c 
                                         ⋓ 
                                       
                                       , 
                                       
                                         
                                           φ 
                                           ^ 
                                         
                                         k 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               
                                 ∂ 
                                 
                                   φ 
                                   T 
                                 
                               
                             
                           
                           ) 
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         
                           ∂ 
                           
                             e 
                              
                             
                               ( 
                               
                                 
                                   c 
                                   ⋓ 
                                 
                                 , 
                                 
                                   
                                     φ 
                                     ^ 
                                   
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           
                             φ 
                             T 
                           
                         
                       
                        
                       
                         e 
                          
                         
                           ( 
                           
                             
                               c 
                               ⋓ 
                             
                             , 
                             
                               
                                 φ 
                                 ^ 
                               
                               k 
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0072]    Such techniques for solving systems will be readily familiar to those skilled in the art. 
         [0073]    An analysis by the inventor of the noise in the detected data revealed that the data covariances are approximately equal, so that no covariance matrix is required in this solution (covariance is effectively equal to an identity matrix). 
         [0074]    An initial estimate for the parameters of A are s=l, u o =m x  and v o =m y , where m x  and m y  are the normalized coordinates of the image center. Alternatively, an initial estimate for the parameters h 11 , h 22  and k l , may be obtained directly from the linear solution of Equation 10: 
         [0075]    h dieg , k l ) T =T+b, where 
         [0000]    
       
         
           
             
               T 
               = 
               
                 ( 
                 
                   
                     
                       
                         
                           x 
                           ~ 
                         
                         1 
                       
                     
                     
                       
                         
                           
                             x 
                             ~ 
                           
                           1 
                         
                          
                         
                           
                             r 
                             ~ 
                           
                           1 
                           2 
                         
                       
                     
                   
                   
                     
                       
                         
                           y 
                           ~ 
                         
                         1 
                       
                     
                     
                       
                         
                           
                             y 
                             ~ 
                           
                           1 
                         
                          
                         
                           
                             r 
                             ~ 
                           
                           1 
                           2 
                         
                       
                     
                   
                   
                     
                       
                           
                       
                     
                     
                       ⋮ 
                     
                   
                   
                     
                       
                         
                           y 
                           ~ 
                         
                         n 
                       
                     
                     
                       
                         
                           
                             y 
                             ~ 
                           
                           n 
                         
                          
                         
                           
                             r 
                             ~ 
                           
                           n 
                           2 
                         
                       
                     
                   
                 
                 ) 
               
             
             , 
             
                 
             
              
             
               b 
               = 
               
                 ( 
                 
                   
                     
                       
                         
                           
                             u 
                             ~ 
                           
                           1 
                         
                         - 
                         
                           m 
                           x 
                         
                       
                     
                   
                   
                     
                       
                         
                           
                             v 
                             ~ 
                           
                           1 
                         
                         - 
                         
                           m 
                           y 
                         
                       
                     
                   
                   
                     
                       ⋮ 
                     
                   
                   
                     
                       
                         
                           
                             v 
                             ~ 
                           
                           n 
                         
                         - 
                         
                           m 
                           y 
                         
                       
                     
                   
                 
                 ) 
               
             
             , 
           
         
       
     
         [0000]    where {tilde over (x)}=ũ−m x , {tilde over (v)} y ={tilde over (v)}−m y , {tilde over (r)} 2 ={tilde over (x)} 2 +{tilde over (v)} y   2  and (.) +  denotes the pseudo inverse. 
         [0076]    From which the parameter vector including three terms for radial distortion may then be initialized, as in Equation 11: 
         [0000]      φ=( h   dieg ,0 ,−m   x ,0 ,h   dieg   ,−m   y ,0,0,1 ,−m   x   ,−m   y   ,k   i ,0,0) T  
 
         [0077]    Using either method for initialization, it will be appreciated that the solution of equation 8 provides sufficient information to subsequently remove distortion from any captured image by resampling or image warping. 
         [0078]    Resampling or image warping computes new samples on a target image from original samples on a source image. Two frequently used and well known interpolation filters are nearest neighbor and bilinear interpolation, although it will be appreciated that others may be employed. The formation of a new undistorted image I(x) may be formed from an distorted image {hacek over (I)}(x) knowing the forward distortion model parameters from the original image as in Equation 12: 
         [0000]        I ( x )= R ( {hacek over (I)} ( x+D ( x,{circumflex over (k)} )))  12)
 
         [0079]    Equation 12 has an advantage that the calibrated forward distortion model may be used directly, without a need for an inverse function. 
         [0080]    The modeling of distortion, according to Equation 7, does not consider the optimal formation of a new distortion free image. Thus, for barrel distortion, image warping according to Equation 12 results in the stretching of central pixels to occupy the viewing window, and hence the loss of outer perimeter pixels as other techniques do as well. The reverse case is seen when the new image is compressed into the viewing window, due to the use of an inverse distortion model in the resampling. This image stretching effectively results in a reduction of window size, as illustrated in  FIG. 2 , which brings forth two issues. Firstly, there is a reduction in the effective field of view or angle of view. This is counter productive as wide angle lenses are chosen for their wide angle of view. Secondly, there is an increase in noise and a degradation of image quality in comparison to the original image, due to the creation of new pixels by zooming-like action of the warping. 
         [0081]    To address this issue, the image warping of Equation 3 is modified, by taking into account local pixel distortions. These pixel distortions are the result of the increasing pixel area warping, radially from the center of the lens distortion. By introducing the ability to compress pixels in the resampling process, the overall pixel distortions may be balanced or minimized. This is accommodated by introducing all appropriate scaling matrix S into the resampling in Equation 13: 
         [0000]        I ( x )= R ( Ī(   Sx+D ( Sx,{circumflex over (k)} ))),  13)
 
         [0000]    where the scaling matrix s contains one variable s, as 
         [0000]    
       
         
           
             
               S 
               = 
               
                 ( 
                 
                   
                     
                       
                         s 
                         1 
                       
                     
                     
                       0 
                     
                     
                       
                         
                           
                             s 
                             1 
                           
                            
                           
                             
                               u 
                               ^ 
                             
                             0 
                           
                         
                         - 
                         
                           
                             u 
                             ^ 
                           
                           0 
                         
                       
                     
                   
                   
                     
                       0 
                     
                     
                       
                         s 
                         1 
                       
                     
                     
                       
                         
                           
                             s 
                             1 
                           
                            
                           
                             
                               v 
                               ^ 
                             
                             0 
                           
                         
                         - 
                         
                           
                             v 
                             ^ 
                           
                           0 
                         
                       
                     
                   
                   
                     
                       0 
                     
                     
                       0 
                     
                     
                       1 
                     
                   
                 
                 ) 
               
             
             , 
           
         
       
     
         [0000]    and (û 0 ,  v   o ) is the estimated distortion center 
         [0082]    A measure of the local pixel distortion may be compiled by taking the Jacobian of the local, area around point p as in Equation 14: 
         [0000]    
       
         
           
             
               
                 
                   
                     J 
                      
                     
                       ( 
                       p 
                       ) 
                     
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             1 
                             + 
                             
                               
                                 ∂ 
                                 
                                   
                                     D 
                                     x 
                                   
                                    
                                   
                                     ( 
                                     
                                       p 
                                       , 
                                       k 
                                     
                                     ) 
                                   
                                 
                               
                               
                                 ∂ 
                                 x 
                               
                             
                           
                         
                         
                           
                             
                               ∂ 
                               
                                 
                                   D 
                                   x 
                                 
                                  
                                 
                                   ( 
                                   
                                     p 
                                     , 
                                     k 
                                   
                                   ) 
                                 
                               
                             
                             
                               ∂ 
                               y 
                             
                           
                         
                       
                       
                         
                           
                             
                               ∂ 
                               
                                 
                                   D 
                                   y 
                                 
                                  
                                 
                                   ( 
                                   
                                     p 
                                     , 
                                     k 
                                   
                                   ) 
                                 
                               
                             
                             
                               ∂ 
                               x 
                             
                           
                         
                         
                           
                             1 
                             + 
                             
                               
                                 ∂ 
                                 
                                   
                                     D 
                                     y 
                                   
                                    
                                   
                                     ( 
                                     
                                       p 
                                       , 
                                       k 
                                     
                                     ) 
                                   
                                 
                               
                               
                                 ∂ 
                                 y 
                               
                             
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   14 
                   ) 
                 
               
             
           
         
       
     
         [0083]    which gives the size ratio of the newly created pixel at the location p to its original location. If λ 1  and λ 2  are the Eigenvalues of J(p), then the net measure of the local pixel distortion may be obtained by taking its determinant as det(J(p))=λ 1 λ 2 . Because the Eigenvalues of an orthogonal transform are equal to one, the ideal value of the determinant causing no net size change is also one. A compression of pixel size results in a determinant of less than one, while the enlarging of pixel size results in a determinant greater than one. 
         [0084]    Pixel distortion may be minimized by choosing a scaling parameter s l  that minimizes Equation 15. 
         [0000]    
       
         
           
             
               
                 
                   min 
                    
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         ( 
                         
                           
                             det 
                              
                             
                               ( 
                               
                                 
                                   s 
                                   1 
                                 
                                  
                                 
                                   I 
                                   
                                     2 
                                     × 
                                     2 
                                   
                                 
                                  
                                 
                                   J 
                                    
                                   
                                     ( 
                                     
                                       p 
                                       1 
                                     
                                     ) 
                                   
                                 
                               
                               ) 
                             
                           
                           - 
                           1 
                         
                         ) 
                       
                       2 
                     
                   
                 
               
               
                 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0085]    As det(AB)=det(A) det(B) A,BεIR m×m  and det(s 1 I 2×2 )=s 1   2  this minimization can be solved linearly as follows 
         [0000]    
       
         
           
             
               s 
               1 
             
             = 
             
               
                 1 
                 
                   
                     1 
                     n 
                   
                    
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       det 
                        
                       
                         ( 
                         
                           J 
                            
                           
                             ( 
                             
                               p 
                               i 
                             
                             ) 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
           
         
       
     
         [0086]    The point set p i  may be chosen as a grid covering the entire image area. The density of this grid has a very minor influence on the overall scaling parameter s 1 . 
         [0087]    This improved resampling, by considering the local pixel distortions, is illustrated in  FIG. 2 . It may be observed that the scaling solution avoids including peripheral areas of the original image as these areas would induce large pixel distortion after image warping. The balance that is reached is a clear improvement in terms of the resulting field of view over the original unsealed method. This formulation assumes that the new image dimensions are the same as the original. An alternative means of implementing the same effective field of view is to enlarge the destination image. The optimal enlargement in this case is described by the scaling matrix S solved with Equation 15. 
         [0088]    As described above, decentering the distortion parameters to p 1 , p 2  and p 3  do not need to be explicitly included, as the interplay between certain parameters enables the implicit modeling of this type of distortion as will be clear from the proof below, moreover their inclusion may lead to an overparametcrised solution. In particular, considering that the projective error transformation H e  may, at least, introduce a variable center point by the simple adjustment of h 3 →h 3 +Δ x , and h 6 →h 6 +Δ y  resulting in equation 16 below. 
         [0000]    
       
         
           
             
               
                 
                   
                     D 
                      
                     
                       ( 
                       
                         
                           p 
                           + 
                           Δ 
                         
                         , 
                         k 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       D 
                        
                       
                         ( 
                         
                           p 
                           , 
                           k 
                         
                         ) 
                       
                     
                     + 
                     
                       ( 
                       
                         
                           
                             
                               
                                 
                                   k 
                                   1 
                                 
                                  
                                 
                                   
                                     Δ 
                                     x 
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         3 
                                          
                                         
                                           x 
                                           2 
                                         
                                       
                                       + 
                                       
                                         y 
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               + 
                               
                                 2 
                                  
                                 
                                   k 
                                   2 
                                 
                                  
                                 
                                   Δ 
                                   y 
                                 
                                  
                                 x 
                                  
                                 
                                     
                                 
                                  
                                 y 
                               
                               + 
                               … 
                             
                           
                         
                         
                           
                             
                               
                                 2 
                                  
                                 
                                   k 
                                   1 
                                 
                                  
                                 
                                   Δ 
                                   x 
                                 
                                  
                                 x 
                                  
                                 
                                     
                                 
                                  
                                 y 
                               
                               + 
                               
                                 
                                   k 
                                   2 
                                 
                                  
                                 
                                   
                                     Δ 
                                     y 
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         3 
                                          
                                         
                                           y 
                                           2 
                                         
                                       
                                       + 
                                       
                                         x 
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               + 
                               … 
                             
                           
                         
                       
                       ) 
                     
                     + 
                     E 
                   
                 
               
               
                 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0089]    Proof: Considering the formulation of distortion as D(H 0 {tilde over (c)}, k)=D(p, k) and introducing a pure translation into the results in the shifting of x→x+Δx and y→y+Δy. The two parameter radial distortion model then becomes 
         [0000]        D   x ( p+Δ,k )= k   1   xr   2   +k   2   xr   4   +k   1 Δ x (3 x   2   +y   2 )+2 k   1 Δ y   xy+k   2 Δ x (5 x   4 +6 x   2   y   2   +y   4 )+ k   2 Δ y (4 x   2   y+ 4 xy   2 )+k 1 ((3Δ x   2 +Δ 2   y ) x+ 2Δ x Δ y   y+Δ   x Δ 2   y +Δ 3   x +k 2 ((5Δ x   4 +6Δ 2   x Δ 2   y +Δ 4   y ) x +(4Δ 3   x Δ y +4Δ x Δ 3   y ) y+Δ   5   x +2Δ 3   x Δ 2   y +Δ x Δ 7   y + . . . )
 
         [0090]    Radial distortion is modeled as before, while k 1 Δ x , k 1 Δ y , k 2 Δ x  and k 2 Δ x  match the decentering terms derived from the wave aberration equation. The basic introduction of a translation element into H c  thus models decentering distortion with the additional introduction of a small residual E. This residual may additionally be approximated by a small affine transformation E=Δ H . 
         [0091]    The objective error e may be rewritten, implicitly modeling decentering distortion as in Equation 17: 
         [0000]        e ( {hacek over (c)},φ )= H   c   {tilde over (c)}+D ( H   c   {tilde over (c)},k )+Δ H   H   c   {tilde over (c)}−A{hacek over (c)} ).  17)
 
         [0092]    In the least square estimation, the small decentering residual is absorbed by a combination of H e  and A in the search for a global minimum. It should also be remembered that these equations are only approximations to the actual lens distortion, so such small adjustments are likely to have a negligible impact. 
         [0093]    Although, it will be appreciated by those skilled in the art that the partial derivates of Equation 7 may be readily computed using conventional techniques, some further detail is now included. 
         [0094]    Partial derivatives for use in an iterative estimation of distortion may be computed using control points. Each control point contributes to the formation of an objective function which must be minimized, as shown in Equation 18: 
         [0000]      ( {hacek over (c)},φ )= H   e   {tilde over (c)}+D ( H   e   {tilde over (c)},k )− A{tilde over (c)}   18)
 
         [0095]    Performing a first order expansion of the error around the last estimate results in a Gauss-Newton scheme that can be iterated utilizing many robust least square techniques, as shown in Equation 19: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       φ 
                       ^ 
                     
                     
                       k 
                       + 
                       1 
                     
                   
                   = 
                   
                     
                       
                         φ 
                         ^ 
                       
                       k 
                     
                     - 
                     
                       
                         
                           λ 
                            
                           
                             ( 
                             
                               
                                 
                                   ∂ 
                                   
                                     
                                       e 
                                       T 
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           c 
                                           ⋓ 
                                         
                                         , 
                                         
                                           
                                             φ 
                                             ^ 
                                           
                                           x 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                                 
                                   ∂ 
                                   φ 
                                 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     e 
                                      
                                     
                                       ( 
                                       
                                         
                                           c 
                                           ⋓ 
                                         
                                         , 
                                         
                                           
                                             φ 
                                             ^ 
                                           
                                           k 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                                 
                                   ∂ 
                                   
                                     φ 
                                     T 
                                   
                                 
                               
                             
                             ) 
                           
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         
                           ∂ 
                           
                             e 
                              
                             
                               ( 
                               
                                 
                                   c 
                                   ⋓ 
                                 
                                 , 
                                 
                                   
                                     φ 
                                     ^ 
                                   
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           
                             φ 
                             T 
                           
                         
                       
                        
                       
                         e 
                          
                         
                           ( 
                           
                             
                               c 
                               ⋓ 
                             
                             , 
                             
                               
                                 φ 
                                 ^ 
                               
                               k 
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 19 
               
             
           
         
       
     
         [0096]    in an embodiment, the forward distortion model is computed with three radial distortion parameters with estimated lens centric coordinates of the ideal projections. The derivatives are given exactly as in Equation 20: 
         [0000]    
       
         
           
             
               
                 
                   
                       
                   
                    
                   
                     
                       
                         
                           
                             ∂ 
                             
                               e 
                                
                               
                                 ( 
                                 
                                   
                                     c 
                                     ⋓ 
                                   
                                   , 
                                   
                                     
                                       φ 
                                       ^ 
                                     
                                     k 
                                   
                                 
                                 ) 
                               
                             
                           
                           
                             ∂ 
                             
                               φ 
                               T 
                             
                           
                         
                         = 
                         
                           
                             ( 
                             
                               
                                 
                                   
                                     
                                       
                                         e 
                                         x 
                                       
                                        
                                       
                                         ( 
                                         
                                           
                                             c 
                                             ⋓ 
                                           
                                           , 
                                           
                                             
                                               φ 
                                               ^ 
                                             
                                             k 
                                           
                                         
                                         ) 
                                       
                                     
                                     
                                       ∂ 
                                       
                                         φ 
                                         T 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       
                                         e 
                                         y 
                                       
                                       ( 
                                       
                                         
                                           c 
                                           ⋓ 
                                         
                                         , 
                                         
                                           
                                             φ 
                                             ^ 
                                           
                                           k 
                                         
                                       
                                     
                                     
                                       ∂ 
                                       
                                         φ 
                                         T 
                                       
                                     
                                   
                                 
                               
                             
                             ) 
                           
                           = 
                           
                             ( 
                             
                               
                                 
                                   
                                     
                                       
                                         ∂ 
                                         
                                           e 
                                           x 
                                         
                                       
                                       
                                         ∂ 
                                         
                                           H 
                                           e 
                                         
                                       
                                     
                                     , 
                                     
                                       - 
                                       
                                         u 
                                         ⋓ 
                                       
                                     
                                     , 
                                     1 
                                     , 
                                     0 
                                     , 
                                     
                                       
                                         x 
                                         ^ 
                                       
                                        
                                       
                                         
                                           r 
                                           ^ 
                                         
                                         2 
                                       
                                     
                                     , 
                                     
                                       
                                         x 
                                         ^ 
                                       
                                        
                                       
                                         
                                           r 
                                           ^ 
                                         
                                         4 
                                       
                                     
                                     , 
                                     
                                       
                                         x 
                                         ^ 
                                       
                                        
                                       
                                         
                                           r 
                                           ^ 
                                         
                                         6 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       
                                         ∂ 
                                         
                                           e 
                                           y 
                                         
                                       
                                       
                                         ∂ 
                                         
                                           H 
                                           e 
                                         
                                       
                                     
                                     , 
                                     0 
                                     , 
                                     0 
                                     , 
                                     1 
                                     , 
                                     
                                       
                                         y 
                                         ^ 
                                       
                                        
                                       
                                         
                                           r 
                                           ^ 
                                         
                                         2 
                                       
                                     
                                     , 
                                     
                                       
                                         y 
                                         ^ 
                                       
                                        
                                       
                                         
                                           r 
                                           ^ 
                                         
                                         4 
                                       
                                     
                                     , 
                                     
                                       
                                         y 
                                         ^ 
                                       
                                        
                                       
                                         
                                           r 
                                           ^ 
                                         
                                         6 
                                       
                                     
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                       , 
                       
                         
 
                       
                        
                       
                           
                       
                        
                       
                         
                           where 
                            
                           
                             
 
                           
                            
                           
                               
                           
                           ( 
                           
                             
                               
                                 
                                   
                                     ∂ 
                                     
                                       e 
                                       x 
                                     
                                   
                                   
                                     ∂ 
                                     
                                       H 
                                       e 
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     ∂ 
                                     
                                       e 
                                       y 
                                     
                                   
                                   
                                     ∂ 
                                     
                                       H 
                                       e 
                                     
                                   
                                 
                               
                             
                           
                           ) 
                         
                         = 
                         
                           ( 
                           
                             
                               
                                 
                                   
                                     
                                       ∂ 
                                       
                                         x 
                                         ^ 
                                       
                                     
                                     
                                       ∂ 
                                       
                                         H 
                                         e 
                                       
                                     
                                   
                                   + 
                                   
                                     
                                       k 
                                       1 
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             ( 
                                             
                                               
                                                 3 
                                                  
                                                 
                                                   
                                                     x 
                                                     ^ 
                                                   
                                                   2 
                                                 
                                               
                                               + 
                                               
                                                 
                                                   y 
                                                   ^ 
                                                 
                                                 2 
                                               
                                             
                                             ) 
                                           
                                            
                                           
                                             
                                               ∂ 
                                               
                                                 x 
                                                 ^ 
                                               
                                             
                                             
                                               ∂ 
                                               
                                                 H 
                                                 e 
                                               
                                             
                                           
                                         
                                         + 
                                         
                                           2 
                                            
                                           
                                             x 
                                             ^ 
                                           
                                            
                                           
                                             y 
                                             ^ 
                                           
                                            
                                           
                                             
                                               ∂ 
                                               
                                                 y 
                                                 ^ 
                                               
                                             
                                             
                                               ∂ 
                                               
                                                 H 
                                                 e 
                                               
                                             
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   … 
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       
                                         
                                           ∂ 
                                           
                                             y 
                                             ^ 
                                           
                                         
                                         
                                           ∂ 
                                           
                                             H 
                                             e 
                                           
                                         
                                       
                                       + 
                                       
                                         
                                           
                                             k 
                                             1 
                                           
                                            
                                           
                                             ( 
                                             
                                               
                                                 2 
                                                  
                                                 
                                                   x 
                                                   ^ 
                                                 
                                                  
                                                 
                                                   y 
                                                   ^ 
                                                 
                                                  
                                                 
                                                   
                                                     ∂ 
                                                     
                                                       x 
                                                       ^ 
                                                     
                                                   
                                                   
                                                     ∂ 
                                                     
                                                       H 
                                                       e 
                                                     
                                                   
                                                 
                                               
                                               + 
                                               
                                                 
                                                   x 
                                                   ^ 
                                                 
                                                 2 
                                               
                                               + 
                                               
                                                 3 
                                                  
                                                 
                                                   
                                                     y 
                                                     ^ 
                                                   
                                                   2 
                                                 
                                               
                                             
                                             ) 
                                           
                                         
                                          
                                         
                                           
                                             ∂ 
                                             
                                               y 
                                               ^ 
                                             
                                           
                                           
                                             ∂ 
                                             
                                               H 
                                               e 
                                             
                                           
                                         
                                       
                                     
                                     ) 
                                   
                                   + 
                                   … 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       
                         
                           k 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               
                                 ( 
                                 
                                   
                                     5 
                                      
                                     
                                       
                                         x 
                                         ^ 
                                       
                                       4 
                                     
                                   
                                   + 
                                   
                                     6 
                                      
                                     
                                       
                                         x 
                                         ^ 
                                       
                                       2 
                                     
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       2 
                                     
                                   
                                   + 
                                   
                                     
                                       y 
                                       ^ 
                                     
                                     4 
                                   
                                 
                                 ) 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     x 
                                     ^ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     H 
                                     e 
                                   
                                 
                               
                             
                             + 
                             
                               
                                 ( 
                                 
                                   
                                     4 
                                      
                                     
                                       
                                         x 
                                         ^ 
                                       
                                       3 
                                     
                                      
                                     
                                       y 
                                       ^ 
                                     
                                   
                                   + 
                                   
                                     4 
                                      
                                     
                                       x 
                                       ^ 
                                     
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       3 
                                     
                                   
                                 
                                 ) 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     y 
                                     ^ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     H 
                                     e 
                                   
                                 
                               
                             
                           
                           ) 
                         
                       
                       + 
                       
                         
                           k 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               ( 
                               
                                 
                                   4 
                                    
                                   
                                     
                                       x 
                                       ^ 
                                     
                                     3 
                                   
                                    
                                   
                                     y 
                                     ^ 
                                   
                                 
                                 + 
                                 
                                   4 
                                    
                                   
                                     x 
                                     ^ 
                                   
                                    
                                   
                                     
                                       y 
                                       ^ 
                                     
                                     3 
                                   
                                 
                               
                               ) 
                             
                             + 
                             
                               
                                 ∂ 
                                 
                                   x 
                                   ^ 
                                 
                               
                               
                                 ∂ 
                                 
                                   H 
                                   e 
                                 
                               
                             
                             + 
                             
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ^ 
                                     
                                     4 
                                   
                                   + 
                                   
                                     6 
                                      
                                     
                                       
                                         x 
                                         ^ 
                                       
                                       2 
                                     
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       2 
                                     
                                   
                                   + 
                                   
                                     5 
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       4 
                                     
                                   
                                 
                                 ) 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     y 
                                     ^ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     H 
                                     e 
                                   
                                 
                               
                             
                           
                           ) 
                         
                       
                       + 
                       
                         
                           k 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               ( 
                               
                                 
                                   4 
                                    
                                   
                                     
                                       x 
                                       ^ 
                                     
                                     3 
                                   
                                    
                                   
                                     y 
                                     ^ 
                                   
                                 
                                 + 
                                 
                                   4 
                                    
                                   
                                     x 
                                     ^ 
                                   
                                    
                                   
                                     
                                       y 
                                       ^ 
                                     
                                     3 
                                   
                                 
                               
                               ) 
                             
                             + 
                             
                               
                                 ∂ 
                                 
                                   x 
                                   ^ 
                                 
                               
                               
                                 ∂ 
                                 
                                   H 
                                   e 
                                 
                               
                             
                             + 
                             
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ^ 
                                     
                                     4 
                                   
                                   + 
                                   
                                     6 
                                      
                                     
                                       
                                         x 
                                         ^ 
                                       
                                       2 
                                     
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       2 
                                     
                                   
                                   + 
                                   
                                     5 
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       4 
                                     
                                   
                                 
                                 ) 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     y 
                                     ^ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     H 
                                     e 
                                   
                                 
                               
                             
                           
                           ) 
                         
                       
                       + 
                       
                         
                           k 
                           3 
                         
                          
                         
                           ( 
                           
                             
                               
                                 
                                   
                                     
                                       ( 
                                       
                                         
                                           7 
                                            
                                           
                                             
                                               x 
                                               ^ 
                                             
                                             6 
                                           
                                         
                                         + 
                                         
                                           15 
                                            
                                           
                                             
                                               x 
                                               ^ 
                                             
                                             4 
                                           
                                            
                                           
                                             
                                               y 
                                               ^ 
                                             
                                             2 
                                           
                                         
                                         + 
                                         
                                           9 
                                            
                                           
                                             x 
                                             ^ 
                                           
                                            
                                           2 
                                            
                                           
                                             
                                               y 
                                               ^ 
                                             
                                             4 
                                           
                                         
                                         + 
                                         
                                           
                                             y 
                                             ^ 
                                           
                                           6 
                                         
                                       
                                       ) 
                                     
                                      
                                     
                                       
                                         ∂ 
                                         
                                           x 
                                           ^ 
                                         
                                       
                                       
                                         ∂ 
                                         
                                           H 
                                           e 
                                         
                                       
                                     
                                   
                                   + 
                                 
                               
                             
                             
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         6 
                                          
                                         
                                           
                                             x 
                                             ^ 
                                           
                                           5 
                                         
                                          
                                         
                                           y 
                                           ^ 
                                         
                                       
                                       + 
                                       
                                         12 
                                          
                                         
                                           
                                             x 
                                             ^ 
                                           
                                           3 
                                         
                                          
                                         
                                           
                                             y 
                                             ^ 
                                           
                                           3 
                                         
                                       
                                       + 
                                       
                                         6 
                                          
                                         
                                           x 
                                           ^ 
                                         
                                          
                                         
                                           
                                             y 
                                             ^ 
                                           
                                           5 
                                         
                                       
                                     
                                     ) 
                                   
                                    
                                   
                                     
                                       ∂ 
                                       
                                         y 
                                         ^ 
                                       
                                     
                                     
                                       ∂ 
                                       
                                         H 
                                         e 
                                       
                                     
                                   
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                         
                     
                      
                     
                       
                         k 
                         3 
                       
                        
                       
                         ( 
                         
                           
                             
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         6 
                                          
                                         
                                           
                                             x 
                                             ^ 
                                           
                                           5 
                                         
                                          
                                         
                                           y 
                                           ^ 
                                         
                                       
                                       + 
                                       
                                         12 
                                          
                                         
                                           
                                             x 
                                             ^ 
                                           
                                           3 
                                         
                                          
                                         
                                           
                                             y 
                                             ^ 
                                           
                                           3 
                                         
                                       
                                       + 
                                       
                                         6 
                                          
                                         
                                           x 
                                           ^ 
                                         
                                          
                                         
                                           
                                             y 
                                             ^ 
                                           
                                           5 
                                         
                                       
                                       + 
                                       
                                         
                                           y 
                                           ^ 
                                         
                                         6 
                                       
                                     
                                     ) 
                                   
                                    
                                   
                                     
                                       ∂ 
                                       
                                         x 
                                         ^ 
                                       
                                     
                                     
                                       ∂ 
                                       
                                         H 
                                         e 
                                       
                                     
                                   
                                 
                                 + 
                               
                             
                           
                           
                             
                               
                                 
                                   ( 
                                   
                                     
                                       
                                         
                                           x 
                                           ^ 
                                         
                                         6 
                                       
                                        
                                       9 
                                        
                                       
                                         
                                           x 
                                           ^ 
                                         
                                         4 
                                       
                                        
                                       
                                         
                                           y 
                                           ^ 
                                         
                                         2 
                                       
                                     
                                     + 
                                     
                                       15 
                                        
                                       
                                         
                                           x 
                                           ^ 
                                         
                                         2 
                                       
                                        
                                       
                                         
                                           y 
                                           ^ 
                                         
                                         4 
                                       
                                     
                                     + 
                                     
                                       7 
                                        
                                       
                                         
                                           y 
                                           ^ 
                                         
                                         6 
                                       
                                     
                                   
                                   ) 
                                 
                                  
                                 
                                   
                                     ∂ 
                                     
                                       y 
                                       ^ 
                                     
                                   
                                   
                                     ∂ 
                                     
                                       H 
                                       e 
                                     
                                   
                                 
                               
                             
                           
                         
                         ) 
                       
                     
                      
                     
                       
 
                     
                      
                     
                         
                     
                      
                     
                       
                         Where 
                          
                         
                           
 
                         
                          
                         
                             
                         
                         ( 
                         
                           
                             
                               
                                 
                                   ∂ 
                                   
                                     x 
                                     ^ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     H 
                                     e 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   ∂ 
                                   
                                     y 
                                     ^ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     H 
                                     e 
                                   
                                 
                               
                             
                           
                         
                         ) 
                       
                       = 
                       
                         
                           
                             
                               ( 
                               
                                 
                                   
                                     
                                       
                                         x 
                                         ~ 
                                       
                                       , 
                                       
                                         y 
                                         ~ 
                                       
                                       , 
                                       1 
                                       , 
                                       0 
                                       , 
                                       0 
                                       , 
                                       0 
                                       , 
                                       
                                         
                                           
                                             - 
                                             
                                               x 
                                               ~ 
                                             
                                           
                                            
                                           
                                             x 
                                             ~ 
                                           
                                         
                                         - 
                                         
                                           
                                             x 
                                             ~ 
                                           
                                            
                                           
                                             y 
                                             ~ 
                                           
                                         
                                       
                                     
                                   
                                 
                                 
                                   
                                     
                                       0 
                                       , 
                                       0 
                                       , 
                                       0 
                                       , 
                                       
                                         x 
                                         ~ 
                                       
                                       , 
                                       
                                         y 
                                         ~ 
                                       
                                       , 
                                       1 
                                       , 
                                       
                                         
                                           
                                             - 
                                             
                                               y 
                                               ~ 
                                             
                                           
                                            
                                           
                                             y 
                                             ~ 
                                           
                                         
                                         - 
                                         
                                           
                                             x 
                                             ~ 
                                           
                                            
                                           
                                             y 
                                             ~ 
                                           
                                         
                                       
                                     
                                   
                                 
                               
                               ) 
                             
                             / 
                             
                               h 
                               31 
                             
                           
                            
                           
                             x 
                             ~ 
                           
                         
                         + 
                         
                           
                             h 
                             32 
                           
                            
                           
                             y 
                             ~ 
                           
                         
                         + 
                         1 
                       
                     
                   
                 
               
               
                 
                   20 
                   ) 
                 
               
             
           
         
       
     
         [0097]    It will be appreciated that these equations may readily be solved using conventional software programming techniques. In particular, the techniques of the present application may be applied irx a variety of different ways in both cameras and projection devices. In the case of a camera, the correction method is applied after an image has been sensed at the camera sensor, whereas in the projection device, it is applied before being presented to the projecting elements. 
         [0000]    An exemplary process for correcting a subsequently acquired image using the previously determined parameters. Once an image is acquired, the distortion model is then applied.
 
It will be appreciated that whilst the important factor is that the model is based on measurements taken, the compact nature of the model is such that the model may be applied within the camera. However, the method need not be applied directly within the camera and may be applied to the captured images using external image processing software. The external software may be specifically for the purpose of correcting images or it may be provided as a plug-in for more general image processing software, such as for example Adobe Photoshop™.
 
In one arrangement, a kit is provided to a user including a reference image (checkerboard) and the software to produce correction information for their individual lenses. This information may then be stored and applied as required to images taken using a particular lens to correct for distortion.
 
Where the correction process is included in the camera, less expensive lenses may be employed to achieve comparable results to more expensive lenses where the correction process is not employed. Thus for example, the process may readily be employed in compact digital cameras and mobile phones to improve image quality without increasing the cost of the optics. To achieve this, the cameras may be calibrated during or at the end of the manufacturing process to determine the correction parameters which may subsequently be employed to correct acquired images.
 
In more expensive cameras, such as digital SLR&#39;s where the lenses may be changed, the firmware of the camera may be configured to include the above described correction process. In this arrangement, the camera firmware may be configured initially or updated to determine the correction model parameters. In this arrangement, the correction model parameters may be determined by running through a calibration routine performed by the firmware for each lens of the user. The determined calibration settings may then be associated with the individual lens, e.g. by reference to the identification of the lens when it connects to the camera or alternatively by selection of the user from a menu. It will be appreciated that users may prefer not to have this complexity or they may prefer to share the information between several cameras. In this scenario, the parameters for the correction may be stored in a memory card or similar and loaded into the camera as required. This type of scenario is known where user&#39;s custom settings may be saved and retrieved from a memory card.
 
In another arrangement, the lenses are calibrated during their manufacturing process to determine appropriate correction parameters and these parameters are stored as meta data within the lens for loading by a camera subsequently when connected. The correction of an image taken with a lens could then be implemented onboard the devices hardware (similar to the white balance function) or on an external processor.
 
In addition to imaging systems for cameras, the technology may also be applied to industrial inspection systems and image projection systems. In the case of image projection systems it will be appreciated that the distortion occurs in reverse to a camera, i.e. the original image is perfect and it is the projection through the lens that introduces distortion. To address this, the corrections would be applied to the data sent to the projector (or indeed within the projector) such that when the corrected image is transmitted through the lens, the viewer sees the original and thus uncorrected image The image processing path is modified slightly within this processing path as would be appreciated by the person skilled in the art. Similarly, the method is not restricted to stills cameras and may be applied to video. Thus for example, correction for distortion could be applied to frames from a webcam before transmission from a computer.
 
         [0098]    Moreover, the potential impact of a commercially available method to calibrate and optimally remove lens distortion is quite vast, and it is difficult to touch on every conceivable application area Some general things to note is that the equations and method are applicable to any lens system, such as infrared cameras and laser scanning systems. The developed method is directly applicable to these technologies, only limited by the calibration target design. With regard to the application to images, it is important to be aware that although this method is not a full calibration technique, the absence of lens distortion vastly simplifies the subsequent complete calibration. In this sense, the method influences such areas where full calibration is required. The following is a incomplete overview of the areas where there is obvious commercial potential relating just to camera technologies. 
         [0099]    Theoretically, any imaging system that makes image measurements assuming a pinhole or perspective image formation model will benefit from this invention. For example, specific advantageous are gained for the various existing and developing 3D camera sensors such as stereo, depth from focus, defocus, shading, shadow and more. For precise operation these methods at least need to be free of lens aberrations. In medical imaging field, the method has direct application to the correction of endoscopic images. 
         [0100]    Vision inspection systems are widely used within industry due to their unique capabilities and reliability. They are employed in many different areas, from pharmaceuticals to automated computer manufacturing. With the advent of precise distortion calibration, the constraints on the lens are relaxed, allowing the use of lower focal lengths with wider field of view to position the cameras closer to the objects. This both reduces the cost of the optical system and yields a much smaller and compact inspection stage. The straightforward calibration procedure allows easy on site calibration without expert knowledge or precise positioning equipment. 
         [0101]    Another related idea is the use of very low focal length lenses in TV systems, to avoid having to elevate a camera (and operator) to large heights to capture birds eye views such as often seen in sports coverage. Much lower elevations may be used with fish-eye type lenses followed by correction for distortion and optimal image re-formatting as described by the present invention. The resulting image will appear to have been taken from an enormous height if the lens field of view is up to 160 to 170 degrees. 
         [0102]    Digital camera technology is evolving to the stage where the image undergoes significant processing within the camera. The developed methods, including the optimal image regeneration may be included to correct for lens aberrations within the camera DSP. Such an ability to post-correct an image will allow less emphasis to be placed on the lens. This has a clear expanding market in compact phone cameras, where the limiting factor is the physical dimensions of the lens. Additionally, the calibration may be offered to professional photographers in the form of a stand alone software to increase the quality of their images. 
         [0000]    In addition to visible light frequencies, many lens systems exist that measure different sets of frequencies, such as Infra-red cameras and laser measurements cameras. These devices are equally subject to lens distortions, especially if the lenses are not fully optimized for the particular wavelengths used. The present invention is directly applicable to such problems. This may involve altering the nature of the input calibration grid to enable suitable control point detection within the particular imaging modality. The correction systems could then equally be applied within the capturing device, or subsequently on external processing equipment. 
         [0103]    To demonstrate the effectiveness of the method (METHOD 1) described herein, a comparison was performed with three other methods (METHODS 2-4). 
         [0104]    The assessment was conducted in terms of evaluating how accurate the estimated parameters are in describing lens distortion throughout the image. Generally, it is not enough to merely find the value or the parameters with respect to the objective criteria. It is also important to evaluate the uncertainty attached to the result, taking into account the uncertainty in the data. The three methods were taken from the literature for comparison purposes. These include two full calibration methods and one truism based method. 
         [0105]    From a least squares or nonlinear least squares estimation problem the residual error vector may be calculated. However, instead of calculating this residual, an alternative one is compiled directly using new data. Under the assumption that data error has a zero mean normal random distribution Λ/(0, σ (2,n) ), the estimation algorithm is asymptotically efficient, implying that with enough data points the exact solution may be recovered. The parameter uncertainty may be estimated from the Fisher information matrix, in Equation 21: 
         [0000]    
       
         
           
             
               
                 
                   
                     F 
                      
                     
                       ( 
                       
                         φ 
                         ^ 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         1 
                         
                           σ 
                           i 
                           2 
                         
                       
                        
                       
                         
                           ∂ 
                           
                             
                               e 
                               T 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     c 
                                     ⋓ 
                                   
                                   i 
                                 
                                 , 
                                 
                                   
                                     φ 
                                     ^ 
                                   
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           
                             φ 
                             ^ 
                           
                         
                       
                        
                       
                         
                           ∂ 
                           
                             e 
                              
                             
                               ( 
                               
                                 
                                   
                                     c 
                                     ⋓ 
                                   
                                   i 
                                 
                                 , 
                                 
                                   
                                     φ 
                                     ^ 
                                   
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           
                             
                               φ 
                               ^ 
                             
                             T 
                           
                         
                       
                     
                   
                 
               
               
                 
                   21 
                   ) 
                 
               
             
           
         
       
     
         [0106]    F −1 ({circumflex over (φ)}) is then used to characterize the uncertainty in the parameters, by forming an estimate of the associated Standard Deviation (SD) as the square root of the i th  diagonal element as: SD({circumflex over (φ)} i )=√{square root over (diag i (F −1 ({circumflex over (φ)}))} 
         [0107]    In the special case where all the r n   2 &#39;s are equal and possibly unknown: 
         [0000]    
       
         
           
             
               
                 
                   
                     F 
                      
                     
                       ( 
                       
                         
                           φ 
                           ^ 
                         
                         i 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         1 
                         
                           σ 
                           i 
                           2 
                         
                       
                        
                       
                         
                           ∂ 
                           
                             
                               e 
                               T 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     c 
                                     ⋓ 
                                   
                                   i 
                                 
                                 , 
                                 
                                   
                                     φ 
                                     ^ 
                                   
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           
                             φ 
                             ^ 
                           
                         
                       
                        
                       
                         
                           ∂ 
                           
                             e 
                              
                             
                               ( 
                               
                                 
                                   
                                     c 
                                     ⋓ 
                                   
                                   i 
                                 
                                 , 
                                 
                                   
                                     φ 
                                     ^ 
                                   
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           
                             
                               φ 
                               ^ 
                             
                             T 
                           
                         
                       
                     
                   
                 
               
               
                 
                   21 
                   ) 
                 
               
             
           
         
       
     
         [0108]    F −1 ({circumflex over (φ)}) is then used to characterize the uncertainty in the parameters, by forming an estimate of the associated Standard Deviation (SD) as the square root of the i th  diagonal element as SD(  φ )=√{square root over (diag i (F −1 ({circumflex over (φ)})))} 
         [0109]    In the special case where all of the σ n   2 &#39;s are equal and possibly unknown: 
         [0000]    
       
         
           
             
               
                 σ 
                 ^ 
               
               2 
             
             = 
             
               
                 1 
                 
                   n 
                   - 
                   m 
                 
               
                
               
                 
                   ∑ 
                   
                     i 
                     = 
                     1 
                   
                   n 
                 
                  
                 
                   
                     ( 
                     
                       
                         p 
                         ⋓ 
                       
                       - 
                       p 
                       - 
                       
                         D 
                          
                         
                           ( 
                           
                             p 
                             , 
                             
                               k 
                               ^ 
                             
                           
                           ) 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
             
           
         
       
     
         [0000]    F −1 ({circumflex over (φ)}) is the approximated by: 
         [0000]    
       
         
           
             
               F 
                
               
                 ( 
                 
                   
                     φ 
                     ^ 
                   
                   i 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 
                   
                     σ 
                     ^ 
                   
                   2 
                 
               
                
               
                 
                   ∑ 
                   
                     i 
                     = 
                     1 
                   
                   n 
                 
                  
                 
                   
                     
                       ∂ 
                       
                         
                           e 
                           T 
                         
                          
                         
                           ( 
                           
                             
                               
                                 c 
                                 ⋓ 
                               
                               i 
                             
                             , 
                             
                               
                                 φ 
                                 ^ 
                               
                               k 
                             
                           
                           ) 
                         
                       
                     
                     
                       ∂ 
                       
                         φ 
                         ^ 
                       
                     
                   
                    
                   
                     
                       ∂ 
                       
                         e 
                         ( 
                         
                           
                             
                               c 
                               ⋓ 
                             
                             i 
                           
                           , 
                           
                             
                               φ 
                               ^ 
                             
                             k 
                           
                         
                       
                     
                     
                       ∂ 
                       
                         
                           φ 
                           ^ 
                         
                         T 
                       
                     
                   
                 
               
             
           
         
       
     
         [0110]    With the proposed solution, as Method 1, the initial comparison technique is referred to as Method 2. The full calibration technique takes multiple views of a planar pattern as input. Although distortion calibration is not the main focus of this technique (no decentering and a low order radial (2 parameters) model is used), it provides a useful comparison for lower distortion levels. It is not expected to be highly accurate for larger distortion levels. The method estimates distortion by the numerical solution of the back projection problem in n views with m control points in each view. The available implementation does not return the parameter standard deviations. 
         [0111]    Method 3 is also a full calibration method. This method also requires multiple views of a planar calibration object, though 3D coordinates with one image may also be used. Distortion is given prominent focus in this implementation, with the reverse model assumed including decentering distortion. A simplified approximation of its Taylor expansion is used as an inverse. The implementation returns the parameter SD&#39;s. 
         [0112]    Method 4 is a truism based method, where the estimation is based on the criterion that straight lines in object space must be imaged as straight lines. The input data is formed from the collinear coordinates of the chessboard pattern. This method is implemented by calculating the lines joining the horizontal chessboard intersections as follows:
       1. Initialize the principal point, and 4 parameters of the reverse distortion model.   2. A moment matrix is formed representing the algebraic line fit to the input data (the Matrix is shown in Equation 22).       
 
         [0000]    
       
         
           
             
               
                 
                   M 
                   = 
                   
                     ( 
                     
                       
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 x 
                                 ⋓ 
                               
                               1 
                               2 
                             
                           
                         
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 
                                   x 
                                   ⋓ 
                                 
                                 1 
                               
                                
                               
                                 
                                   y 
                                   ⋓ 
                                 
                                 1 
                               
                             
                           
                         
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 x 
                                 ⋓ 
                               
                               i 
                             
                           
                         
                       
                       
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 
                                   x 
                                   ⋓ 
                                 
                                 1 
                               
                                
                               
                                 
                                   y 
                                   ⋓ 
                                 
                                 1 
                               
                             
                           
                         
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 y 
                                 ⋓ 
                               
                               i 
                               2 
                             
                           
                         
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 y 
                                 ⋓ 
                               
                               i 
                             
                           
                         
                       
                       
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 x 
                                 ⋓ 
                               
                               i 
                             
                           
                         
                         
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               n 
                             
                              
                             
                               
                                 y 
                                 ⋓ 
                               
                               i 
                             
                           
                         
                         
                           n 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   22 
                   ) 
                 
               
             
           
         
       
       
         
           
             3. Calculate the least square line fit from the Eigenvector associated with the smallest Eigenvalue. 
             4. Using this line and the input data form the error criterion. 
             5. Minimize this using the Levenberg-Marquardt (LM) method for the sum of all lines. 
           
         
       
     
         [0118]    Parameter SD&#39;s are available upon convergence. A summary of the different properties of each method is given in the table of  FIG. 3 . The majority of these methods do not include decentering distortion. In order to compare like-with-like decentering distortion is not included in the distortion model of the proposed algorithm, (Method 1). 
         [0119]    Comparisons on simulated data are made with respect to varying control point locations and increasing levels of control point noise. Distortion is simulated using a nonstandard formulation in order that the resulting profile does not exactly match with any of the calibration models. Considering a divisional model as described in GB2380887 extra nonlinear terms may be added as follows: 
         [0000]    {hacek over (c)}=c/(1−k 1 r 2 −k 2 r 4 ), where c=(u, v, 1) T  are the undistorted points, {hacek over (c)} are the distorted counterparts and r 2 =(u−u o )2+(v−v o ) 2 . The center of distortion t=(u n , v o , 1) T  is fixed at approximately u o =732.33 and v o =812.21. Distortion parameter k 1  is varied in the range of −2 to 1.4 with k 2  specified as k 2 =−k 1 /2, representing a wide range of barrel and pincushion distortions. The lowest level of distortion is k 1 =0.01, effectively showing on the graphs as zero. 
         [0120]    The calibration data is comprised of a 10×10 planar grid of equally spaced points (spacing=100 (pix)). Random positions of these points are simulated using a 3D rotation randomly drawn from a specific range of rotation angles, with limited translation. Noise is added to these control points with a normal distribution N (0, σ 2 ), where σ 2  is in the range approximately between 0 and 1 (pix), well in excess of the expected noise range. The evaluation data includes a 20×20 grid (grid spacing=75 (pix)) covering the entire image window. 
         [0121]    The method described herein is compared with three alternative methods for robustness to control point positions. One hundred random control point positions are generated for each distortion level and the accuracy and stability of each method is evaluated. Accuracy is measured using the estimated parameters on the evaluation data set. The stability of each estimated parameter is quantified by its variance throughout the one hundred samples. 
         [0122]    The accuracy of the four methods are compared in  FIG. 17 . The ability to correctly distort a model is primarily linked with the underlying distortion model. As  FIG. 17  shows, the reverse model in Method 3 and 4 is more unstable than the forward model used in Method 1 and 2. Method 4 is shown to be highly dependent on the location of the control points. Method 1 outperforms all other methods with much lower distortion residuals, indicating that the proposed algorithm is not dependent on the location of control points and its use of a higher order model than Method 2 does not lead to instabilities. 
         [0123]    Each method involves estimating the distortion center.  FIG. 18  illustrates the x and y errors for the estimated center point for the four methods over 100 random placements of the calibration data and subject to varying distortion. This shows that the center point in the line based method is quite sensitive to the location of the calibration data. The performance of Methods 2 and 3 are roughly similar (excluding the peak errors at k 1 =0.01 for Method 3). The method of the present invention shows a very low center point error in comparison. This demonstrates the high stability of the algorithm and the high accuracy afforded by the use of an appropriate distortion model. 
         [0124]    The parameter values and standard deviations of each method are shown in  FIGS. 19-22 . These show the variation of the parameters with distortion and their integrity with respect to varying control point positions. As expected, the present method and method 2 which employ forward distortion models show bounded parameter values. In contrast, the parameter values for methods using the reverse model are much larger. The line based method shows large parameter and SD values, indicating in conjunction with its poor residual accuracy that this algorithm fails to converge for many of the position samples. 
         [0125]    The proposed algorithm is compared with the three alternative methods for robustness to noise in control point positions. The 3D position of the control points are fixed throughout. For each simulated distortion level, noise with a distribution of N (0, σ 2 ) is added for 100 samples. The noise variance σ 2  is then varied through 0→1 (pix). As this generates a significant quantity of data, only the residual distortion is presented, for the range of barrel distortion only. 
         [0126]    The residual errors are presented in  FIGS. 4-7 .  FIG. 4  presents the residual results for the proposed method, (Method 1). It can be noted from these results that for zero distortion levels, a larger residual error is induced than for the other distortion levels. This is due to the incorrect classification of noise in the data as actual distortion. Excluding this zero level distortion, the residual SD increases in direct proportion with the induced noise. All residuals remain in the subpixel range. It can be confidently concluded that the proposed algorithm copes successfully with noise. 
         [0127]    In comparison, Method 2 shows a larger residual error. As this method also uses the forward model of distortion, its increase in error is proportional with the increase in noise variance. Method 3 uses the reverse model of distortion, and the results in  FIG. 6  show that the residual error is larger than that of Method 2. However, in terms of robustness to noise, the algorithm appears to cope successfully. The final line based method, Method 4, also uses the reverse model, but to a higher order. The high order reverse model has been shown to have instability tendencies, so the increase in noise levels induces a large increase in residual error. Indeed for some samples, the algorithm failed to converge and in others, convergence is questionable. 
         [0128]    The comparison of the present method with the line based method shows a very considerable improvement. The line based method fails to reach this performance despite using a high order model. One reason for this is that no geometric relationship exists between the objective error and the distortion. The ill conditioning induced by the reverse model at high distortion levels hampers its performance further, all culminating in the tendency to lodge in local minima and in some cases fail to converge due to singularities in the estimation moment or co-factor matrix. The poor estimation performance may be additionally observed in the widely varying estimates for the center of distortion. It is not suitable for larger distortion levels. 
         [0129]    In comparison with the full calibration technique of Method 3, the proposed technique shows a significant performance increase. This method used the reverse model and hence failed to achieve comparable residual results. This algorithm is restricted to low levels of distortion as an increase in distortion model order would lead directly to increased sensitivity and ultimately poorer performance. The side-by-side analysis with the full calibration technique of Method 2, primarily indicates the proposed method achieves smaller residual error. This may be expected as both techniques use the forward distortion model, only to a higher order in Method 1. Despite the use of this higher order model, no adverse consequences arise from its use such as instabilities in the estimation problem. Actually, the comparisons on the recovered centers of distortion show that the proposed method achieves far superior stability in its estimation than Method 2. 
         [0130]    The experiments conducted on simulated data clearly show that the proposed algorithm outperforms the comparison techniques on an accuracy front. The improvement in accuracy may be attributed to the use of an appropriate distortion model, the estimation algorithm still performs equally as well as the methods that require multiple inputs of data points. The simulations also show that the proposed algorithm at least matches the stability of full calibration methods, and surpasses them in many cases such as in the estimation of the distortion center. In summary, it is shown to be suitable for distortion levels of all kinds, with good invariance to control point location and noise. 
         [0131]    Comparisons on real data are compiled with seven different samples of distortion, arranged in increasing order.  FIG. 8  gives a brief description of the camera type and image resolution of each sample. Three images were input into the full calibration techniques of Methods 2 and 3, while the first of these was used in the single image methods. As an example, sample number 5 from this data set is shown in  FIG. 9 . One additional image is used for the residual distortion evaluation of all four methods. These residuals are compiled, with one exception, by undistorting the evaluation image and estimating a radially weighted homography on this data. The residuals for the line based Method 4 are compiled directly by undistorting the data. A radially weighted homography is then computed on these coordinates. This avoids the addition of extra inaccuracies through the use of an inverse approximation to undistort the image. All chessboard intersection points are estimated from an initial guess using the nonlinear line intersection method described in the accompanying additional information document, with a small local support in order to avoid the introduction of bias. 
         [0132]    The number of iterations required for each method to converge is also presented in  FIG. 8 . This shows that there is a less computational overhead with the proposed method. It should also be noted that no optimization is conducted within the Gauss-Newton method (used by Method 1), unlike the comparison methods which use a combination of a Gradient Decent and Gauss-Newton (LM) to speed up convergence. 
         [0133]    Firstly, each method is examined for the residual distortion remaining after correction. These residuals are presented in  FIG. 10  in mean (SD). 
         [0134]      FIG. 10  shows that the proposed method achieves a lower residual error than any of the comparison methods. Methods 3 and 4 show slightly erratic performances. As the improvement in performance of the proposed method may be attributable to the higher order model used, an extra comparison was conducted using a two parameter distortion model in Method 1. This is the same model as used in Method 2. The results are presented in  FIG. 11  for comparison with those of Method 2. These results show that the proposed method still achieves an overall lower residual error. This comes despite the fact that Method 2 uses three times the amount of input data than Method 1 in these experiments. The undistorted images for Sample  5  are shown in  FIGS. 12A ,  12 B and  12 C.  FIG. 12A  shows Method 1,  FIG. 12B  shows Method 2 and  FIG. 12C  shows Method 3. A residual distortion is observable in the image undistorted with Method 3. 
         [0135]    The values and uncertainties of each estimated parameter is presented for Methods 1-4 in  FIGS. 13-16  respectively. Method 4 shows as expected large parameter values and uncertainty for larger distortion levels. Method 3, using a two parameter version of the reverse model, exhibits a similar trend, only with a lower magnitude. Method 2, using a two parameter version of the forward model, shows bounded values. Method 1 also shows bounded parameter magnitudes with small error bands. This confirms the results obtained on simulated data, and indicates the suitability of a high order forward model for distortion calibration. 
         [0136]    The estimates of the distortion center for each method are presented in  FIG. 23 . These show that Method 1 recovers the center point very close to that of the full calibration Method 2. This indicates a close relationship between the center point of distortion and the principal point (as recovered by Method 2). Method 3 recovers a similar principal point except in the samples where the distortion is poorly modeled, e.g. sample no. 5. 
         [0137]    Following the results obtained with simulated data, the experiments with real images aim to confirm these findings. In this sense, Method 4 is shown to have erratic accuracy and a tendency for high uncertainty in its parameters. In comparison, Method 1 significantly improves upon the performance of Method 3, from a distortion removal point of view. As in the simulated case, there is also a clear improvement in the accuracy of Method 1 in comparison with Method 2. 
         [0138]    It was slightly unclear if the proposed algorithm would match the performance of Method 2 using a lower order distortion model. This was investigated with the comparison of both methods using the same distortion model. It revealed that on average Method 1 achieved a slightly lower distortion residual. This indicates the robustness of the proposed approach, considering that Method 2 uses, in this case, three times the amount of input data. The center point is reliably estimated, with very similar locations to that of the full calibration techniques that require more than one image for its recovery. However, this is not the case for the line based Method 4, which shows unreliable center point estimates. 
         [0139]    In conclusion, the experiments with real and simulated data clearly demonstrate that the present method outperforms all comparison methods in terms of accuracy in calibrating and removing distortion. This level of accuracy is achieved while using less input data, requiring only one view. The parameter estimates are shown to be reliable, and lend themselves to a well conditioned problem. Additionally, the real experiments show that there is less computational overhead than the comparison methods. These factors in combination with the more accessible closed form solution, appropriate distortion modeling and unique minimization of pixel distortions in resampling, make this method a highly suitable non-metric method for removing lens distortion of all levels in perspective camera. 
         [0140]    A novel aspect of this approach is the formulation to recover the previously unknown projections of the true undistorted coordinates of the particular calibration object. This allows the objective derivatives to be readily computed and estimated using standard non-numerical techniques. A unique feature of the formulation is its ability to model decentering distortion of lens assemblies without its explicit parametric inclusion. The basic idea may be visualized as a ‘planarity of planes’ approach in contrast to the ‘straightness of lines’ method. 
         [0141]    Secondly, a new idea is proposed to optimally form a new aberration free image in order to reduce the unavoidable resampling distortions such as stretching and shearing. The end result is that the new image contains less noise than an unoptimized image, while also having a wider field of view for normal barrel lens distortion. 
         [0142]    Due to the new formulation of the problem, certain key advantages are gained over the existing collection of solutions. The forward model of lens distortion is used, in comparison with other nonmetric approaches which are forced to use the reverse model or a variation, and cannot avail of its advantages. Decentering distortion is naturally modeled by the particular formulation without the need for additional parameters. The precision to which lens distortion may be modeled and removed is very high. The accuracy is shown to outperform other alleged nonmetric approaches and, match and often outperform the performance of complete bundle adjustment methods. In addition to this accuracy, the distortion calibration is shown to be very stable unlike many non-metric alternatives. This precision and stability is not limited to a small domain of lens distortions, but effectively covers all possible or practical levels of lens distortions in perspective cameras, from very low focal lenses such as fish-eye, to very high focal length lenses. In contrast, alternative full calibration and nonmetric methods are only suited to mild levels of distortion. 
         [0143]    Complete calibration methods, and their associated relative complexity are not suitable for all applications. Many situations exist wherein only the nonlinear distortion calibration is required. The current means of calibrating distortion only relies on existing nonmetric approaches. These algorithms are not without their own complexity, involving a cumbersome phase of line segmentation and recovery. In contrast the proposed method utilizes the existing relatively straightforward planar detection methods associated with full calibration methods. Only one view of this planar target is required to completely solve the problem. The two constraints that are imposed on the target, that of planarity and known structure up to scale (these constraints, and more, apply to the full calibration methods), are easily attained. 
         [0144]    The distortions introduced during the removal of lens distortion through interpolation are also considered for the first time. This is an integral part of the distortion calibration process if undistorted images are the desired end result. These optimized images contain less noise and retain more pixel information. 
         [0000]    The different elements of the process will now be explained with reference to an exemplary calibration process which is employed initially. The data obtained from the calibration step is subsequently employed in the correction process.
 
The calibration process comprises a series of steps, as illustrated in the process flow of Figure ?. The initial step comprises the setting up of the imaging apparatus such as a camera in a test configuration. The camera may be set up on a tripod or other support and directed at a reference (e.g. chessboard) image. As will be explained below, the reference object is suitably selected to simplify the subsequent processing of the data. The reference object is positioned a distance away from camera. However as explained above this is not critical but merely requires the target to be fully encompassed with the image.
 
As, a measure of distortion is being obtained it is important to capture an image of a specific known target so that the method attempts to correct the captured image appropriately in determining the model. Thus the reference object (target) is suitably selected to facilitate the subsequent image analysis aspect of the calibration process. An example of a suitable reference object is a planar surface with a checkerboard pattern defined thereon. A checkerboard pattern is suitable since the positions of the corners of the individual squares may readily be identified using conventional corner detection techniques. Suitably, the number of squares in the pattern would ensure that each square represented a pixel area in the image of x by x pixels, where x is suitably a value in the range of 40 to 200 pixels depending on the sensor size to meet the minimum number of control points required.
 
Once the camera, lens and target have been appropriately set up, an image is acquired by the camera and the mathematical methods described above applied to determine the appropriate parameters for a correction model. This correction model, as will be appreciated from above, allows for correction to be applied to any subsequent images captured by the imaging system.
 
         [0145]    Other ways of implementation apply as long as the elements of the present invention are included. 
         [0146]    In addition to the description of specific, non-limited examples of embodiments of the invention provided herein, it should be appreciated that the invention can be implemented in numerous other applications involving the different configurations of video-processing equipment. Although the invention is described hereinbefore with respect to illustrative embodiments thereof, it will be appreciated that the foregoing and various other changes, omissions and additions in the form and detail thereof may be made without departing from the spirit and scope of the invention.
The present application relates to a high precision method for calibrating and removing distortion from a lens, and more particularly, a method for calibrating and removing distortion by arranging sensor readings to compensate for its presence and simultaneously optimize the resulting image magnification for best image quality.