selected the software then choose one of local distortion parameters k 1 and k 2 that best fits the equations of all points in the image as the global distortion parameter k specifically the software uses k 1 instead of k 2 to fit corners 32 to 37 on line 38 the software thus varies the value of u03b1 2 r 2 to achieve the smallest error as follows e 1 u2211 i 1 3 u2062 u2062 uf603 u03c1 i u2061 1 k 1 u2062 u03c1 i 2 u2062 cos u2061 u03b8 i u03b1 2 r 2 uf604 2 2 7 in equation 2 7 e 1 is the error achieved using k 1 instead of k 2 to fit corners 32 to 37 on line 38 and u03c1 i u03b8 i are the polar coordinates of the three farthest corners on line 38 in one embodiment the levenberg marquardt method is used to minimize error e 1 similarly the software uses k 2 instead of k 1 to fit corners 25 to 30 on line 31 again the software varies the value of u03b1 1 r 1 to achieve the smallest error as follows e 2 u2211 i 1 3 u2062 u2062 uf603 u03c1 i u2061 1 k 2 u2062 u03c1 i 2 u2062 cos u2061 u03b8 i u03b1 1 r 1 uf604 2 2 8 in equation 2 8 e 2 is the error achieved using k 2 instead of k 1 to fit corners 25 to 30 on line 31 and u03c1 i u03b8 i are the polar coordinates of the three farthest corners on line 31 in one embodiment.