Abstract:
Systems and methods for calibrating an image projection system, using image capture devices are disclosed. In particular, Wide-Angle (WA) and Ultra Wide-Angle (UWA) lenses can be utilized to eliminate need for traditional test patterns and tedious alignment settings. That is particularly useful for automatic calibration of projection sources that may require frequent adjustments on the field. Geometric mapping techniques combined with image analytics allow identifying parallel lines in an image captured from a scene. Coordinates of vanishing points corresponding to pairs of parallel lines provide sufficient information to determine orientation of the image projection system in space.

Description:
FIELD OF INVENTION 
       [0001]    The embodiments described herein relate generally to electronic image and video processing, and specifically to calibration of image projection systems. 
       BACKGROUND 
       [0002]    Image projection systems are known to be highly susceptible to geometric image distortions due to their positional freedom. Essentially, any deviation from perpendicularity of the axis that connects the light source of a projector to a viewing surface (normally the optical axis) causes a so-called keystone distortion. Although occurring in rear-projection configurations too, this effect is more pronounced in front-projection configurations that have typically a long throw ratio. 
         [0003]    Several prior art patents address electronic correction of geometric distortions, in addition to older mechanical solutions. A majority of the electronic correction methods exploit some form of calibration test patterns that consist of precisely positioned objects (lines, circles, rectangles, etc.) on the projection surface; or use a fixed reference such as physical bezels of the projection surface. These solutions are generally suitable for calibrations in controlled environments, where devices are stationary or have limited displacements. Also, they may require precise alignment jobs. The U.S. Pat. No. 8,406,562 teaches a comprehensive test pattern and reference based calibration techniques applicable to most image systems including rear and front view projectors, and various surface geometries. Another class of calibration methods, for example as taught in the U.S. Pat. No. 6,877,863; relies on position and orientation measurement sensors to quantify distortion parameters. That in turn requires extra components and tools. 
         [0004]    In some set-ups, such as a car Heads-Up-Display (HUD) or a Helmet-Mounted-Display (HMD), the projectors are susceptible to constant displacements from the ideal (also referred to as reference) position. Yet, it is crucial to have an undistorted image at all time. Therefore, there is a need for fast, frequent, and automatic calibration on the run. Further, it would be desirable to eliminate additional resources (test patterns, test pattern generators) and alignment tasks needed to perform the calibration. 
         [0005]    The present invention takes advantage of digital imaging combined with image analytic techniques to extract projectors&#39; rotational angles from naturally occurring scenes, instead of calibration patterns. Capture devices equipped with Wide-Angle (WA) and particularly Ultra Wide-Angle (UWA) lenses, lenses having a field of view of at least 180°, almost guarantee capture of useful information from a scene. This approach would be at the expense of complexity of UWA mapping calculations and performing heavier image processing. The co-pending patent application PCTUS2012/027189 teaches techniques of UWA lens mapping; content of which will be used as a reference. 
       SUMMARY 
       [0006]    The embodiments described herein provide in one aspect, a method to correct for rotational distortions of an image projected from a projection source on a viewing surface, said method comprising: 
         [0000]    acquiring an image of a scene containing the viewing surface, using at least one image capture device with a known orientation relative to the projection source; identifying at least a first pair of parallel lines in the image; identifying at least a second pair of parallel lines, orthogonal to the at least first pair of parallel lines, in the image; obtaining coordinates of vanishing points corresponding to the at least first and the at least second pair of parallel lines; computing angles of rotation of the at least one capture device with respect to a frame of reference, using the coordinates of the vanishing points; and constructing a correction transformation using the rotational angles and the orientation of the at least one capture device relative to the projection source. 
         [0007]    The embodiments described herein provide in another aspect a calibration system to correct for rotational distortions of an image projected from a projection source on a viewing surface, said system comprising: 
         [0000]    at least one image capture device positioned at a known orientation relative to the projection source, to acquire an image of a scene; means to identify at least a first pair of parallel lines, and least a second pair of parallel lines orthogonal to the at least first pair of parallel lines, in the image; means to obtain coordinates of vanishing points corresponding to the at least first and the at least second pairs of parallel lines; means to compute a rotational angle of the capture device using the coordinates of the vanishing points; and means to construct a correction transformation using the rotational angles and the orientation of the at least one capture device relative to the projection source. 
         [0008]    The embodiments described herein provide in another aspect a calibration method for use with an image projection set-up having a source and a viewing surface, said method being carried out by at least one electronic processor configured to: 
         [0000]    receive input image data acquired, from a scene containing the viewing surface, by at least one capture device; receive input data representing orientation of the at least one capture device relative to the projection source; identify at least a first pair of parallel lines in the image; identify at least a second pair of parallel lines, orthogonal to the at least first pair of parallel lines, in the image; compute coordinates of vanishing points corresponding to the at least first and the at least second pair of parallel lines; compute angles of rotation of the at least one capture device with respect to a frame of reference, using the coordinates of the vanishing points; and construct a correction transformation using the computed angles of rotation and the orientation of the at least one capture device relative to the projection source. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0009]    For a better understanding of the embodiments and/or related implementations described herein and to show more clearly how they may be carried into effect, reference will now be made, by way of example only, to the accompanying drawings which show at least one exemplary embodiment and/or related implementation in which: 
           [0010]      FIG. 1  illustrates an exemplary embodied set-up, comprising a projector, a camera and a viewing surface. The convention for a coordinate system is also shown; 
           [0011]      FIG. 2  illustrates geometric distortions resulting from rotation of the projection source about one of the three coordinate axis (a-c) and an arbitrary rotation (d); 
           [0012]      FIG. 3  illustrates orientation of a lens with respect to a spherical and a Cartesian coordinate system; 
           [0013]      FIG. 4  illustrates steps of calibrating a projector in accordance with the embodied methods; 
           [0014]      FIG. 5  illustrates an outdoor image acquired through a UWA lens as rotated about z axis ( 5   a ) with respect to the reference position ( 5   b ); 
           [0015]      FIGS. 6   a  and  6   b  respectively illustrate mapping of a selected portion of  FIGS. 5   a  and  5   b  to a projective plane; 
           [0016]      FIG. 7   a  illustrates an outdoor image acquired through a UWA lens as rotated about an arbitrary axis with respect to the reference position in  FIG. 5   b;    
           [0017]      FIG. 7   b  illustrates mapping of a selected portion of  FIG. 7   a  to a projective plane; 
           [0018]      FIG. 8  illustrates an indoor image acquired through a UWA lens as rotated about z axis ( 8   a ) with respect to the reference position in ( 8   b ); 
           [0019]      FIGS. 9   a  and  9   b  respectively illustrate mapping of a selected portion of  FIGS. 8   a  and  8   b  to a projective plane; 
           [0020]      FIG. 10   a  illustrates an indoor image acquired through a UWA lens as rotated about an arbitrary axis with respect to the reference position in  FIG. 5   b ; and 
           [0021]      FIG. 10   b  illustrates mapping of a selected portion of  FIG. 10   a  to a projective plane; 
       
    
    
       [0022]    It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. 
       DETAILED DESCRIPTION 
       [0023]    It will be appreciated that numerous specific details are set forth in order to provide a thorough understanding of the exemplary embodiments described herein. 
         [0024]    However, it will be understood by those of ordinary skill in the art that the embodiments and/or implementations described herein may be practiced without these specific details. In other instances, well-known methods, procedures and components have not been described in detail so as not to obscure the embodiments and/or implementations described herein. Furthermore, this description is not to be considered as limiting the scope of the embodiments described herein, but rather to describe the structure and operation of the various embodiments and/or implementations described herein. 
         [0025]      FIG. 1  illustrates an image projection source  10  positioned in front of a viewing surface  12 . A capture device  14  is also placed in front of the viewing surface. Although a camera is merely one exemplary capture device, the terms capture device and camera will be used interchangeably hereinafter. The image projection source  10  is generally referred to any module that produces an image in the form of an envelope of light rays on a surface; regardless of size, source of light and other structural characteristics of the device. It can be part of a front as well as a rear projection configuration. Furthermore, it should be noted that the viewing surface  12  can be virtual as well as real. For instance, in car HUD applications, the image is formed on a virtual 2D screen viewable by the driver or passengers in the car. A virtual image cannot be formed on a real screen. Furthermore, the viewing surface  12  can be curved, in which case the curvature and other geometric characteristics must be accounted for. 
         [0026]      FIG. 1  also shows a 3D reference frame associated with the calibration system. xz is a horizontal plane and +y defines up in the vertical direction. The optical axis of the camera is taken along the z-axis with the camera  14  looking along the negative z-axis, as shown. If more than one camera exists, e.g. a configuration of N arbitrarily placed cameras, each camera will be identified by a label n=1, . . . , N; and has associated with it a 3D right-handed coordinate frame, referred to as Frame-n, with the camera at the origin (0, 0, 0) of that frame. All real world points in Frame-n are labeled by a last subscript of n, for example (x n , y n , z n ); if more than one point are being discussed then the last subscripts are mn, where m identifies the specific point in Frame-n, for example (x mn , y mn , z mn ), Letters (x, y, z), or vector {right arrow over (x)}, are used to refer to frame or real world coordinates. When no frame of reference is provided, the absolute coordinates relative to some absolute frame, are implied. The same notation will be applied to multiple positions of a single camera, in particular when a camera is displaced and/or rotated with respect to a reference position. Furthermore, the letters (u, v) are reserved for image coordinates in the 2D camera space, and the same use of subscripts is made. The image origin is taken to be the center of the image, which may not coincide with the optical axis, with the +u-axis to the left and the +v-axis to the top. Spherical and polar coordinates associated with the frame (3D) and image (2D) being (r, θ, φ) and (r′, φ′) respectively. 
         [0027]    In an ideal configuration, the optical axis of the projector  10  is set to be perpendicular to the viewing surface  12  such that the projected image is formed within a rectangular boundary, referred to as the undistorted image. Any deviation from this perpendicularity, in addition to a rotation about the optical axis, results in a geometric image distortion.  FIG. 2  illustrates four types of image distortions corresponding to three independent degrees of rotational freedom of the projector, formed on a flat surface.  FIG. 2   a  illustrates a pure rotation about z axis, where the rectangular boundary is preserved but the entire image appears rotated.  FIGS. 2   b  and  2   c  respectively illustrate a vertical and horizontal pan resulting in a vertical and horizontal keystone distortion of the image. An exemplary combination of all three is illustrated in  FIG. 2   d . Such a transform is mathematically equivalent to a rotation about an arbitrary axis in 3D that can also be represented by a rotation matrix. According to this interpretation,  FIGS. 2   a - c  are special cases where the axis of rotation coincides with one of the coordinate axes. In what follows, there is no distinction between what is traditionally known in the art as keystone and rotation. Computing the rotation angles (or rotation matrix) of a projector relative to its ideal distortion-free orientation would be the main objective of calibration in this general framework. 
         [0028]    According to one embodiment of the invention, at least one capture device  14  is an essential component of a calibration system that is employed to determine the orientation of the image projection source with respect to an ideal orientation. That is, provided the orientation of the capture device relative to the projection source is known. In one embodiment, the capture device is physically attached to the projector. In another embodiment, the capture device  14  is integrated with the projection assembly, such that the orientation of the capture device never changes with respect to the projection source and no additional set-up would be required. Yet in general, the capture device is an independent unit, such as a DSLR camera. In that case, the capture device  14  can be freely positioned, as long as its relative position and orientation with respect to the projection source  12  is known. The relative position and orientation is preferably represented as a matrix to be used in computations. 
         [0029]    Since no specific calibration test pattern is intended to be used, unlike traditional calibration methods, one needs to collect useful information from a series of objects in naturally occurring scenes, in order to determine the orientation of the camera. According to one embodiment, a set of parallel lines and vanishing points associated with the parallel lines are used to calculate the rotation matrix. That is based on an observation that it would be relatively straightforward to detect and extract parallel lines, such as horizontal or vertical lines, from recognizable objects in a scene. If a projector is placed indoor, edge lines of the walls, ceiling and floor inside a room; tables, desks, light fixtures, and computer monitors, among other objects, would be good candidates. For outdoor usage, e.g. in a car HUD assembly, building walls, windows, door frames, street lights, traffic signs, road lines, and etc. can be detected and identified for this purpose. Albeit, one needs to make a valid assumption about orientation of the detected objects. For instance, it would be safe to assume that most buildings are vertically erected, or road markings defining a parking spot are drawn in parallel. 
         [0030]    Although it may be more likely to identify and pick horizontal and vertical lines in a scene, this is not a requirement. Any two pairs of parallel lines, where the two pairs are orthogonal in the 3D space, can be utilized to do the task as long as their angles with respect to the horizon are known or can be determined. 
         [0031]    In a preferred embodiment, the capture device  14  is equipped with a lens having a large field of view (FOV) to assure enough useful information is captured from the scene in a given direction, hence avoiding repetition of the procedure. Accordingly, it would be advantageous to use wide angle (WA) and particularly ultra-wide angle (UWA) lenses to maximize the chance of inclusion of objects of interest.  FIG. 3  shows a lens  20  at the center of a Cartesian coordinate system xyz. It is more natural, especially for UWA lenses (such as fisheyes), to use a spherical (polar in 2D) coordinate system. Spherical and polar coordinates associated with the frame and image will be denoted as (r, θ, φ) and (r′, φ′) respectively. The lens mapping between the image and frame coordinates is generically of the form: 
         [0000]        r′=F   r′ (θ,φ),φ′= F   φ′ (θ,φ)
 
         [0000]      θ= F   θ ( r ′,φ′),φ= F   φ ( r ′,φ′)  (1)
 
         [0000]    In practice, the lens mapping takes (to a good approximation) a simpler one variable form: 
         [0000]        r′=F   r′ (φ),φ′= F   φ′ (φ)
 
         [0000]      θ= F   θ ( r ′),φ= F   φ (φ′)  (2)
 
         [0000]    In the case of a linear (equidistant) fisheye, the above reduces to: 
         [0000]        r′=fθ,φ′=φ   (3)
 
         [0000]    where f is a constant that can be viewed as the focal length. Note that θ is defined as positive from the optical axis, which may not be the +z-axis of the frame, in which case the appropriate angle adjustments need to be made. Mapping for the generic case of Eq. (1) is described in the co-pending application PCTUS2012/027189, in which case the mapping should be determined a priori. 
         [0032]      FIG. 4  illustrates the processing steps taken to correct for rotational image distortions, in accordance with an embodied method. At least one image capture device  14  captures an image of a scene  100 . The captured image is then sent to be processed, e.g. through an electronic chip or a computer-readable medium. A number of parallel lines (at least two pairs) are then identified in the image space  120 . That is accomplished by object recognition techniques practiced in the art. Depending on the viewing angle of the cameras, parallel lines in the 3D real world may appear to converge into a point known as a vanishing point. Steps  100  and  120  should be repeated if the captured scene is not satisfactory. If it is not possible to repeat step  100 , namely where the projection system cannot be moved, then the processing of step  120  should be continued until the correct number of parallel lines have been identified. In one embodiment, the capture device is equipped with an UWA lens. The choice of a UWA lens significantly reduces this possibility of having a non-satisfactory scene. Because of its large FOV, it is possible to detect a sufficient number of parallel lines from objects found in most common calibration environments. Once parallel lines are identified, the spatial coordinates of the corresponding vanishing points can be calculated  140  from the equations of the lines in the image space. It will be shown that a rotation matrix can be computed  160  from the coordinates of the vanishing points. In one embodiment, where a UWA lens is used, an intermediate step may be taken to facilitate the computations. That is, the UWA lens transformation is applied to the image  130  (fisheye type) to map selected parts of the image onto a plane where the lines appear as straight rather than curvilinear. Effectively, the calculations will be done in a more familiar Cartesian space rather than the UWA lens space. 
         [0033]    Finally, a correction transformation  180  can be constructed by combining the rotation matrix of the camera with another matrix that describes orientation of the camera relative to the projection source. In one embodiment, the correction transformation is applied in a forward direction to the output image. In another embodiment the inverse of the correction transformation is computed and applied to the source image so that the output appears undistorted. The latter is preferred, for example when the transformation is applied via a processing chip. 
         [0034]    Referring to  FIG. 5 , we now provide examples in accordance with the embodiments of the invention.  FIG. 5  shows a schematic outdoor image of a city view as if captured through an 180° UWA lens. The objective is to determine a mapping between two images, one as shown in  FIG. 5   a  distorted with respect to the reference image of  FIG. 5   b . In one embodiment, this is accomplished by using vanishing points of parallel lines. The street and building features in  FIG. 5   a  are quite typical. For example, the building in the middle of the image consists of distinguishable horizontal floors, supposedly parallel to the x axis but appearing rotated. Line  30  which is in x direction, indicates this rotation. Street lines  32  are also parallel lines on a horizontal plane, but to the z axis. Lines  32  appear to merge into a vanishing point  34 , in this case in the middle of the image. Other parallel lines orthogonal to  32  in x and y directions do not intersect each other in the image space, i.e. the corresponding vanishing points are at infinity. Therefore, one concludes this is a pure rotation about the z axis that can be corrected to achieve an undistorted  FIG. 5   b  where line  36  is horizontal. In this simplified example, the correction angle is essentially the angle between lines  30  and  36 . Street lines  38  maintain their vanishing point in the middle of the image. 
         [0035]    Alternatively, according to another embodiment, an intermediate step  130  can be performed. As illustrated in  FIG. 6   a , a portion of the image in  FIG. 5   a  is selected and mapped to a projective plane. That can be achieved by applying the given UWA lens transformation so that the lines appear straight. A UWA transformation preserves the general orientation of objects in an image. Line  50  has the same angular rotation with respect to the horizon ( 56  in  FIG. 6   b ) as the original fisheye image in  FIG. 5 . In other words, mapping from  FIG. 6   a  to  FIG. 6   b  obeys the same rotational transformation as  FIG. 5   a  to  FIG. 5   b . Two sets of parallel lines  52  and  54  are selected that are orthogonal to each other. The former is on a plane parallel to the xz plane and the latter on a plane parallel to the yz plane. Both pairs of lines are parallel to the z axis, and all meet in a single vanishing point  58 . The fact that other horizontal and vertical lines orthogonal to  52 , along x or y axis, do not intersect in the image space means their vanishing points are at infinity, indicating no rotation about x and y axes. 
         [0036]    In another example,  FIG. 7  illustrates an image captured from the same scene as in  FIG. 5  while the camera view is changed. Two sets of parallel lines, one set horizontal and one set vertical, are identified in  FIG. 7   a  and extrapolated to the corresponding vanishing points. To get around calculations in the fisheye image space in this case, it would be preferred to map a portion of the image, in accordance with the intermediate step  130 , to a projective plane as shown in  FIG. 7   b . Two sets of parallel lines,  62  and  64  are drawn, each set extrapolated to intersect at a corresponding vanishing point (That of  62  falls outside the page and not shown). Any other line parallel to either of  62  or  64  will appear as merging into the same corresponding vanishing points. Also shown, is a third pair of supposedly vertical lines  66 , orthogonal to both  92  and  94 , extrapolated to a third vanishing point. This geometry suggests a vertical keystone or rotation of about x axis in the image. 
         [0037]    According to one embodiment, the calibration is performed indoors, e.g. inside a room or a lab environment.  FIG. 8  shows a schematic image of a meeting room as if captured through an 180° UWA lens. The objective is to determine a mapping between two images, one as shown in  FIG. 8   a  distorted with respect to the reference image of  FIG. 8   b . Again, this is accomplished by using vanishing points of parallel lines. The walls, ceiling, windows/door frames provide reliable parallel lines along the coordinate axes.  FIG. 8   a  appears rotated; line  70  indicates this rotation. Window frames  72  are parallel to the z axis on a vertical plane, so are table lines  73  but on a horizontal plane. Lines  72  and  73  appear to merge into the same vanishing point  74 , in this case in the middle of the image. Parallel lines orthogonal to  32  would not intersect each other in the image, i.e. the corresponding vanishing points are at infinity. Therefore, one concludes this is a pure rotation about the z axis that can be corrected to achieve an undistorted  FIG. 8   b  where line  76  is horizontal. In this simplified example, the correction angle is essentially the angle between lines  70  and  76 . Lines  78  and  79  maintain their vanishing point in the middle of the image. 
         [0038]    Alternatively, according to another embodiment, the intermediate step  130  can be performed to avoid dealing with curvilinear lines in a fisheye image. As illustrated in  FIG. 9   a , a portion of the image in  FIG. 8   a  is selected and mapped to a projective plane. That can be achieved by applying the given UWA lens transformation so that the lines appear straight. Line  80  has the same angular rotation with respect to the horizon ( 86  in  FIG. 9   b ) as the original fisheye image in  FIG. 8 . In other words, mapping from  FIG. 9   a  to  FIG. 9   b  obeys the same transformation as  FIG. 8   a  to  FIG. 8   b . Two sets of parallel lines  82  and  84  are selected from two different planes parallel to the yz and xz planes respectively. Both pairs are parallel to the z axis and meet at the same vanishing  80  point in the middle of the image. The fact that other parallel lines along x and y axis and orthogonal to  82  do not intersect in the image space, means their vanishing points are at infinity, indicating no rotation about x and y axes. 
         [0039]      FIG. 10   a  illustrates an image captured from the same room as in  FIG. 8  while the camera view is changed. It would be preferred in this case to map a portion of the image, in accordance with the intermediate step  130 , to a projective plane as shown in  FIG. 10   b . Two sets of parallel lines  92  and  94 , orthogonal to each other, are drawn. Each set is extrapolated to intersect at a corresponding vanishing point (That of  92  falls outside the page and not shown). Any other line parallel to either of  92  or  94  would appear as merging into the same corresponding vanishing points. Also shown, is a third pair of supposedly vertical lines  96 , orthogonal to both  92  and  94 , extrapolated to a third vanishing point (out of the page). This geometry suggests a rotation about x and/or y axes. As will be shown next, identifying any two vanishing points corresponding to two sets of parallel lines, the two sets being orthogonal to each other, would be adequate to calculate the rotation matrix associated with the capture device. 
         [0040]    We now provide algebraic calculations that enable implementation of the embodiments in a hardware processor or for a computer-readable medium. It is worth observing that  FIGS. 6 ,  7   b ,  9  and  10   b  simulate what a projective camera (having a normal lens) would capture. As mentioned, rotational disorders are independent from the type of lens used for the capture. Therefore, before dealing with complications of UWA imagery, it would be beneficial to illustrate how the rotation matrix and the vanishing points can be obtained by a projective camera. For notational purposes, a line is indicated by the superscript L. Line m in Frame n is represented by the set of points {(x mn   L , y mn   L , z mn   L )}, and as {(u mn   L , v mn   L )} in the corresponding 2D image. For lines parallel to the x, y and z axes, a superscript of x, y and z are added respectively, for example: 
         [0041]    {(x mn   L , y mn   L , z mn   L )}, Line m in Frame-n parallel to x-axis with: 
         [0000]      −∞&lt; x=x   mn   Lx   &lt;+∞,y=y   mn   Lx   ,z=z   mn   Lx   (4)
 
         [0000]    We use x mn   Lx  instead of x, to make explicit which line is being addressed.
 
The image taken by a projective camera is formed in a flat image space referred to as the projective space. Consider a projective camera, with position 2 (corresponding to frame 2) rotated about an arbitrary axis relative to the ideal position 1 (corresponding to frame 1). The centers of the two positions are taken to coincide, i.e. no shift.  FIGS. 6 ,  7   b ,  9  and  10   b  can be consulted again, as if taken by a projective camera. Points in the two frames are related by:
 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         x 
                         ⇀ 
                       
                       2 
                     
                     = 
                     
                       R 
                        
                       
                         
                           x 
                           ⇀ 
                         
                         1 
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         
                           x 
                           ⇀ 
                         
                         1 
                       
                       = 
                       
                         [ 
                         
                           
                             
                               
                                 x 
                                 1 
                               
                             
                           
                           
                             
                               
                                 y 
                                 1 
                               
                             
                           
                           
                             
                               
                                 z 
                                 1 
                               
                             
                           
                         
                         ] 
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         
                           x 
                           ⇀ 
                         
                         2 
                       
                       = 
                       
                         [ 
                         
                           
                             
                               
                                 x 
                                 2 
                               
                             
                           
                           
                             
                               
                                 y 
                                 2 
                               
                             
                           
                           
                             
                               
                                 z 
                                 2 
                               
                             
                           
                         
                         ] 
                       
                     
                     , 
                     
                         
                     
                      
                     
                       R 
                       ≡ 
                       
                         [ 
                         
                           
                             
                               
                                 R 
                                 xx 
                               
                             
                             
                               
                                 R 
                                 xy 
                               
                             
                             
                               
                                 R 
                                 xz 
                               
                             
                           
                           
                             
                               
                                 R 
                                 yx 
                               
                             
                             
                               
                                 R 
                                 yy 
                               
                             
                             
                               
                                 R 
                                 yz 
                               
                             
                           
                           
                             
                               
                                 R 
                                 zx 
                               
                             
                             
                               
                                 R 
                                 zy 
                               
                             
                             
                               
                                 R 
                                 yy 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0042]    Applying this transform to points on a line gives: 
         [0000]    
       
      
       x 
       m2 
       L 
       =R 
       xx 
       x 
       m1 
       L 
       +R 
       xy 
       y 
       m1 
       L 
       +R 
       xz 
       z 
       m1 
       L  
      
     
         [0000]    
       
      
       y 
       m2 
       L 
       =R 
       yx 
       x 
       m1 
       L 
       +R 
       yy 
       y 
       m1 
       L 
       +R 
       yz 
       z 
       m1 
       L  
      
     
         [0000]        z   m2   L   =R   zx   x   m1   L   +R   zy   y   m1   L   +R   zz   z   m1   L   (6)
 
         [0043]    Projecting this onto the camera image in position 2, gives the line points in Image-2: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       u 
                       
                         m 
                          
                         
                             
                         
                          
                         2 
                       
                       L 
                     
                     = 
                     
                       
                         - 
                         
                           f 
                           P 
                         
                       
                        
                       
                         
                           
                             
                               R 
                               xx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               xy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               xz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                         
                         
                           
                             
                               R 
                               zx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       v 
                       
                         m 
                          
                         
                             
                         
                          
                         2 
                       
                       L 
                     
                     = 
                     
                       
                         - 
                         
                           f 
                           P 
                         
                       
                        
                       
                         
                           
                             
                               R 
                               yx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               yy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               yz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                         
                         
                           
                             
                               R 
                               zx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0000]    wherein f p &gt;0, is the focal length and the negative sign indicates the camera looking down the negative z-axis. To relate the line points with the vanishing points, one may consider lines that are parallel to the three axes, and take the infinite limit for the parallel component. This gives six equations defining the vanishing points: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       [ 
                       
                         
                           
                             
                               u 
                               ∞2 
                               Lx 
                             
                           
                         
                         
                           
                             
                               v 
                               ∞2 
                               Lx 
                             
                           
                         
                       
                       ] 
                     
                     ≡ 
                     
                       
                         lim 
                         
                           
                             x 
                             
                               m 
                                
                               
                                   
                               
                                
                               1 
                             
                             Lx 
                           
                           → 
                           
                             ± 
                             ∞ 
                           
                         
                       
                        
                       
                         [ 
                         
                           
                             
                               
                                 u 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 Lx 
                               
                             
                           
                           
                             
                               
                                 v 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 Lx 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                   = 
                   
                     
                       
                         
                           [ 
                           
                             
                               
                                 
                                   
                                     - 
                                     
                                       f 
                                       P 
                                     
                                   
                                    
                                   
                                     
                                       R 
                                       xx 
                                     
                                     
                                       R 
                                       zx 
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     - 
                                     
                                       f 
                                       P 
                                     
                                   
                                    
                                   
                                     
                                       R 
                                       yx 
                                     
                                     
                                       R 
                                       zx 
                                     
                                   
                                 
                               
                             
                           
                           ] 
                         
                          
                         
                           
 
                         
                         [ 
                         
                           
                             
                               
                                 u 
                                 ∞2 
                                 Ly 
                               
                             
                           
                           
                             
                               
                                 v 
                                 ∞2 
                                 Ly 
                               
                             
                           
                         
                         ] 
                       
                       ≡ 
                       
                         
                           lim 
                           
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               Ly 
                             
                             → 
                             
                               ± 
                               ∞ 
                             
                           
                         
                          
                         
                           [ 
                           
                             
                               
                                 
                                   u 
                                   
                                     m 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                   Ly 
                                 
                               
                             
                             
                               
                                 
                                   v 
                                   
                                     m 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                   Ly 
                                 
                               
                             
                           
                           ] 
                         
                       
                     
                     = 
                     
                       
                         
                           
                             [ 
                             
                               
                                 
                                   
                                     
                                       - 
                                       
                                         f 
                                         P 
                                       
                                     
                                      
                                     
                                       
                                         R 
                                         xy 
                                       
                                       
                                         R 
                                         zy 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       - 
                                       
                                         f 
                                         P 
                                       
                                     
                                      
                                     
                                       
                                         R 
                                         yy 
                                       
                                       
                                         R 
                                         zy 
                                       
                                     
                                   
                                 
                               
                             
                             ] 
                           
                            
                           
                             
 
                           
                           [ 
                           
                             
                               
                                 
                                   u 
                                   ∞2 
                                   Lz 
                                 
                               
                             
                             
                               
                                 
                                   v 
                                   ∞2 
                                   Lz 
                                 
                               
                             
                           
                           ] 
                         
                         ≡ 
                         
                           
                             lim 
                             
                               
                                 z 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                                 Lz 
                               
                               → 
                               
                                 ± 
                                 ∞ 
                               
                             
                           
                            
                           
                             [ 
                             
                               
                                 
                                   
                                     u 
                                     
                                       m 
                                        
                                       
                                           
                                       
                                        
                                       2 
                                     
                                     Lz 
                                   
                                 
                               
                               
                                 
                                   
                                     v 
                                     
                                       m 
                                        
                                       
                                           
                                       
                                        
                                       2 
                                     
                                     Lz 
                                   
                                 
                               
                             
                             ] 
                           
                         
                       
                       = 
                       
                         [ 
                         
                           
                             
                               
                                 
                                   - 
                                   
                                     f 
                                     P 
                                   
                                 
                                  
                                 
                                   
                                     R 
                                     xz 
                                   
                                   
                                     R 
                                     zz 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   - 
                                   
                                     f 
                                     P 
                                   
                                 
                                  
                                 
                                   
                                     R 
                                     yz 
                                   
                                   
                                     R 
                                     zz 
                                   
                                 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0044]    The right side of (8) is independent of the line, i.e. does not depend on index m; hence any line parallel to the corresponding axis meets at the same vanishing point. This can be seen, for instance, in  FIG. 6  where all four horizontal lines selected from the image, in parallel with the z axis meet at one point. Alternatively, all lines parallel to the x, y and z axes, intersect at the vanishing points (u ∞2   Lx , v ∞2   Lx ), (u ∞2   Ly , v ∞2   Ly ), and (u ∞2   Lz , v ∞2   Lz ), respectively in Image-2; these will also be referred to as the x, y and z vanishing points. It is important to note if there is no rotation or the rotation leaves some axes fixed, then the corresponding vanishing points are at infinity (e.g. x and y vanishing points in  FIG. 6   b ). 
         [0045]    The vanishing points can also be computed directly from Image-2 by looking at the images of a pair of parallel lines. Two distinct lines parallel to the x-axis will intersect at the x vanishing point (u ∞2   Lx , v ∞2   Lx ) in Image-2. Taking a pair of points on each line (as seen in Image-2), constructing a line through the pair and computing the intersection of the two constructed lines, gives the x vanishing point coordinates; similarly the y and z vanishing points can be computed. Again, if some of the axes remains fixed, the corresponding parallel lines will continue to remain parallel in Image-2 and the intersection is at infinity; these cases need to be individually handled. Knowing the vanishing points, the above equations can be re-written as (dropping the L superscript and 2 subscript): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         R 
                         zx 
                       
                       = 
                       
                         
                           
                             - 
                             
                               f 
                               p 
                             
                           
                           
                             u 
                             ∞ 
                             x 
                           
                         
                          
                         
                           R 
                           xx 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         yx 
                       
                       = 
                       
                         
                           
                             
                               v 
                               ∞ 
                               x 
                             
                             
                               - 
                               
                                 f 
                                 p 
                               
                             
                           
                            
                           
                             R 
                             zx 
                           
                         
                         = 
                         
                           
                             
                               v 
                               ∞ 
                               x 
                             
                             
                               u 
                               ∞ 
                               x 
                             
                           
                            
                           
                             R 
                             xx 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         zy 
                       
                       = 
                       
                         
                           
                             - 
                             
                               f 
                               p 
                             
                           
                           
                             v 
                             ∞ 
                             y 
                           
                         
                          
                         
                           R 
                           yy 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         xy 
                       
                       = 
                       
                         
                           
                             
                               u 
                               ∞ 
                               y 
                             
                             
                               - 
                               
                                 f 
                                 p 
                               
                             
                           
                            
                           
                             R 
                             zy 
                           
                         
                         = 
                         
                           
                             
                               u 
                               ∞ 
                               y 
                             
                             
                               v 
                               ∞ 
                               y 
                             
                           
                            
                           
                             R 
                             yy 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         xz 
                       
                       = 
                       
                         
                           
                             u 
                             ∞ 
                             z 
                           
                           
                             - 
                             
                               f 
                               P 
                             
                           
                         
                          
                         
                           R 
                           zz 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         yz 
                       
                       = 
                       
                         
                           
                             v 
                             ∞ 
                             z 
                           
                           
                             - 
                             
                               f 
                               P 
                             
                           
                         
                          
                         
                           R 
                           zz 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0046]    Furthermore, for a rotation there are additional constraints on the elements from the matrix being orthogonal: 
         [0000]        RR   T   =R   T   R= 1  (10)
 
         [0047]    Equations (9) and (10) are sufficient to determine the rotation matrix. In fact the system is over constrained. Solving the equations gives: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         R 
                         xx 
                       
                       = 
                       
                         
                           I 
                           xx 
                           R 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         
                           I 
                           xx 
                           R 
                         
                         ≡ 
                         
                           
                             ( 
                             
                               R 
                               xx 
                             
                             ) 
                           
                           2 
                         
                       
                       = 
                       
                         
                           1 
                           + 
                           
                             
                               
                                 v 
                                 ∞ 
                                 y 
                               
                               
                                 u 
                                 ∞ 
                                 y 
                               
                             
                              
                             
                               
                                 v 
                                 ∞ 
                                 z 
                               
                               
                                 u 
                                 ∞ 
                                 z 
                               
                             
                           
                         
                         
                           
                             ( 
                             
                               
                                 
                                   v 
                                   ∞ 
                                   x 
                                 
                                 
                                   u 
                                   ∞ 
                                   x 
                                 
                               
                               - 
                               
                                 
                                   v 
                                   ∞ 
                                   y 
                                 
                                 
                                   u 
                                   ∞ 
                                   y 
                                 
                               
                             
                             ) 
                           
                            
                           
                             ( 
                             
                               
                                 
                                   v 
                                   ∞ 
                                   x 
                                 
                                 
                                   u 
                                   ∞ 
                                   x 
                                 
                               
                               - 
                               
                                 
                                   v 
                                   ∞ 
                                   z 
                                 
                                 
                                   u 
                                   ∞ 
                                   z 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         yy 
                       
                       = 
                       
                         
                           I 
                           yy 
                           R 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         
                           I 
                           yy 
                           R 
                         
                         ≡ 
                         
                           
                             ( 
                             
                               R 
                               yy 
                             
                             ) 
                           
                           2 
                         
                       
                       = 
                       
                         
                           1 
                           + 
                           
                             
                               
                                 v 
                                 ∞ 
                                 x 
                               
                               
                                 u 
                                 ∞ 
                                 x 
                               
                             
                              
                             
                               
                                 v 
                                 ∞ 
                                 z 
                               
                               
                                 u 
                                 ∞ 
                                 z 
                               
                             
                           
                         
                         
                           
                             ( 
                             
                               
                                 
                                   v 
                                   ∞ 
                                   y 
                                 
                                 
                                   u 
                                   ∞ 
                                   y 
                                 
                               
                               - 
                               
                                 
                                   v 
                                   ∞ 
                                   x 
                                 
                                 
                                   u 
                                   ∞ 
                                   x 
                                 
                               
                             
                             ) 
                           
                            
                           
                             ( 
                             
                               
                                 
                                   v 
                                   ∞ 
                                   y 
                                 
                                 
                                   u 
                                   ∞ 
                                   y 
                                 
                               
                               - 
                               
                                 
                                   v 
                                   ∞ 
                                   z 
                                 
                                 
                                   u 
                                   ∞ 
                                   z 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         zz 
                       
                       = 
                       
                         
                           I 
                           zz 
                           R 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
 
                     
                      
                     
                       
                         
                           I 
                           zz 
                           R 
                         
                         ≡ 
                         
                           
                             ( 
                             
                               R 
                               zz 
                             
                             ) 
                           
                           2 
                         
                       
                       = 
                       
                         
                           
                             
                               v 
                               ∞ 
                               y 
                             
                             
                               v 
                               ∞ 
                               x 
                             
                           
                           + 
                           
                             
                               u 
                               ∞ 
                               y 
                             
                             
                               u 
                               ∞ 
                               x 
                             
                           
                         
                         
                           
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   
                                     u 
                                     ∞ 
                                     y 
                                   
                                   
                                     u 
                                     ∞ 
                                     x 
                                   
                                 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   
                                     v 
                                     ∞ 
                                     z 
                                   
                                   
                                     v 
                                     ∞ 
                                     x 
                                   
                                 
                               
                               ) 
                             
                           
                           - 
                           
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   
                                     v 
                                     ∞ 
                                     y 
                                   
                                   
                                     v 
                                     ∞ 
                                     x 
                                   
                                 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   
                                     u 
                                     ∞ 
                                     z 
                                   
                                   
                                     u 
                                     ∞ 
                                     x 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
         [0048]    In the above, the positive square root has been taken based on the following representation for R. In general, a rotation matrix can be written in terms of a unit vector {circumflex over (ω)}=(ω x , ω y , ω z ), being the axis of rotation, and an angle α giving the rotation angle about ŵ. This is known as Rodrigues&#39; rotation formula: 
         [0000]        R   ij =ω i ω j −ε ijk ω k  sin α+(1−ω i ω j )cos α  (12)
 
         [0049]    i, j=1, 2, 3, with the correspondence 1         x, 2         y, 3         z 
         [0050]    The fully anti-symmetric tensor ε ijk  is used in (13). For the diagonal elements, the parameterization becomes: 
         [0000]        R   xx =ω x   2 +(1−ω x   2 )cos α
 
         [0000]        R   yy =ω y   2 +(1−ω y   2 )cos α
 
         [0000]        R   zz =ω z   2 +(1−ω z   2 )cos α  (14)
 
         [0000]    
       
         
           
             
               
                 Since 
                  
                 
                     
                 
                 - 
                 1 
               
               ≤ 
               
                 ω 
                 i 
               
               ≤ 
               1 
             
             , 
             
               
                 for 
                  
                 
                     
                 
                 - 
                 
                   π 
                   2 
                 
               
               ≤ 
               α 
               ≤ 
               
                 π 
                 2 
               
             
             , 
           
         
       
     
         [0000]    that is typical for most practical applications, we have the diagonal elements as being positive. The diagonal elements are independent of the focal length, which is expected since the rotation matrix cannot depend on the scale of the image. A more compact form for the diagonal elements can be written using dot and cross products of the vanishing points. Defining the following vanishing points in 3D: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         x 
                         ⇀ 
                       
                       ∞ 
                     
                     ≡ 
                     
                       [ 
                       
                         
                           
                             
                               u 
                               ∞ 
                               x 
                             
                           
                         
                         
                           
                             
                               v 
                               ∞ 
                               x 
                             
                           
                         
                         
                           
                             0 
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                       
                   
                    
                   
                     
                       
                         y 
                         ⇀ 
                       
                       ∞ 
                     
                     ≡ 
                     
                       [ 
                       
                         
                           
                             
                               u 
                               ∞ 
                               y 
                             
                           
                         
                         
                           
                             
                               v 
                               ∞ 
                               y 
                             
                           
                         
                         
                           
                             0 
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                       
                   
                    
                   
                     
                       
                         z 
                         ⇀ 
                       
                       ∞ 
                     
                     ≡ 
                     
                       [ 
                       
                         
                           
                             
                               u 
                               ∞ 
                               z 
                             
                           
                         
                         
                           
                             
                               v 
                               ∞ 
                               z 
                             
                           
                         
                         
                           
                             0 
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0051]    Then: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       R 
                       xx 
                     
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                 
                                   x 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               · 
                               
                                 i 
                                 ^ 
                               
                             
                             ) 
                           
                           2 
                         
                          
                         
                           
                             ( 
                             
                               
                                 
                                   y 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               · 
                               
                                 
                                   z 
                                   ⇀ 
                                 
                                 ∞ 
                               
                             
                             ) 
                           
                           
                             
                               ( 
                               
                                 
                                   
                                     x 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                                 × 
                                 
                                   
                                     y 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                               
                               ) 
                             
                             · 
                             
                               ( 
                               
                                 
                                   
                                     x 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                                 × 
                                 
                                   
                                     z 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       R 
                       yy 
                     
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                 
                                   y 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               · 
                               
                                 j 
                                 ^ 
                               
                             
                             ) 
                           
                           2 
                         
                          
                         
                           
                             ( 
                             
                               
                                 
                                   x 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               · 
                               
                                 
                                   z 
                                   ⇀ 
                                 
                                 ∞ 
                               
                             
                             ) 
                           
                           
                             
                               ( 
                               
                                 
                                   
                                     y 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                                 × 
                                 
                                   
                                     x 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                               
                               ) 
                             
                             · 
                             
                               ( 
                               
                                 
                                   
                                     y 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                                 × 
                                 
                                   
                                     z 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       R 
                       zz 
                     
                     = 
                     
                       
                         
                           
                             k 
                             ^ 
                           
                           · 
                           
                             ( 
                             
                               
                                 
                                   x 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               × 
                               
                                 
                                   y 
                                   ⇀ 
                                 
                                 ∞ 
                               
                             
                             ) 
                           
                         
                         
                           
                             k 
                             ^ 
                           
                           · 
                           
                             [ 
                             
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   × 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                               + 
                               
                                 ( 
                                 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   × 
                                   
                                     
                                       z 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                               + 
                               
                                 ( 
                                 
                                   
                                     
                                       z 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   × 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                             
                             ] 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         i 
                         ^ 
                       
                       = 
                       
                         [ 
                         
                           
                             
                               1 
                             
                           
                           
                             
                               0 
                             
                           
                           
                             
                               0 
                             
                           
                         
                         ] 
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         j 
                         ^ 
                       
                       = 
                       
                         [ 
                         
                           
                             
                               0 
                             
                           
                           
                             
                               1 
                             
                           
                           
                             
                               0 
                             
                           
                         
                         ] 
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         k 
                         ^ 
                       
                       = 
                       
                         [ 
                         
                           
                             
                               0 
                             
                           
                           
                             
                               0 
                             
                           
                           
                             
                               1 
                             
                           
                         
                         ] 
                       
                     
                   
                 
               
               
                 
                   ( 
                   16 
                   ) 
                 
               
             
           
         
       
     
         [0052]    The elements not involving the z index can be computed from equation (9): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       R 
                       xy 
                     
                     = 
                     
                       
                         
                           u 
                           ∞ 
                           y 
                         
                         
                           v 
                           ∞ 
                           y 
                         
                       
                        
                       
                         R 
                         yy 
                       
                     
                   
                   , 
                   
                       
                   
                    
                   
                     
                       R 
                       yx 
                     
                     = 
                     
                       
                         
                           v 
                           ∞ 
                           x 
                         
                         
                           u 
                           ∞ 
                           x 
                         
                       
                        
                       
                         R 
                         xx 
                       
                     
                   
                 
               
               
                 
                   ( 
                   17 
                   ) 
                 
               
             
           
         
       
     
         [0053]    This also shows independence from the focal length. Instead of using equation (9) for the remaining elements, which seem to include the focal length, we compute those using additional relations from equation (10). It follows from (10) that: 
         [0000]        R   xz   2 =1− R   xx   2   −R   xy   2   ,R   yz   2 =1− R   yy   2   −R   yx   2   (18)
 
         [0000]    Combining with (9) to obtain the sign gives the following, focal length independent result: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       R 
                       xz 
                     
                     = 
                     
                       
                         sign 
                          
                         
                           ( 
                           
                             - 
                             
                               u 
                               ∞ 
                               z 
                             
                           
                           ) 
                         
                       
                        
                       
                         
                           1 
                           - 
                           
                             R 
                             xx 
                             2 
                           
                           - 
                           
                             R 
                             xy 
                             2 
                           
                         
                       
                     
                   
                   , 
                   
                     
 
                   
                    
                   
                     
                       R 
                       yz 
                     
                     = 
                     
                       
                         sign 
                          
                         
                           ( 
                           
                             - 
                             
                               v 
                               ∞ 
                               z 
                             
                           
                           ) 
                         
                       
                        
                       
                         
                           1 
                           - 
                           
                             R 
                             yy 
                             2 
                           
                           - 
                           
                             R 
                             yx 
                             2 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0054]    Similarly, it can be shown that: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       R 
                       zx 
                     
                     = 
                     
                       
                         ( 
                         
                           
                             
                               
                                 R 
                                 xy 
                               
                                
                               
                                 R 
                                 yz 
                               
                             
                             - 
                             
                               
                                 R 
                                 yy 
                               
                                
                               
                                 R 
                                 xz 
                               
                             
                           
                           
                             
                               
                                 R 
                                 xx 
                               
                                
                               
                                 R 
                                 yy 
                               
                             
                             - 
                             
                               
                                 R 
                                 xy 
                               
                                
                               
                                 R 
                                 yx 
                               
                             
                           
                         
                         ) 
                       
                        
                       
                         R 
                         zz 
                       
                     
                   
                   , 
                   
                       
                   
                    
                   
                     
                       R 
                       zy 
                     
                     = 
                     
                       
                         ( 
                         
                           
                             
                               
                                 R 
                                 yx 
                               
                                
                               
                                 R 
                                 xz 
                               
                             
                             - 
                             
                               
                                 R 
                                 xx 
                               
                                
                               
                                 R 
                                 yz 
                               
                             
                           
                           
                             
                               
                                 R 
                                 xx 
                               
                                
                               
                                 R 
                                 yy 
                               
                             
                             - 
                             
                               
                                 R 
                                 xy 
                               
                                
                               
                                 R 
                                 yx 
                               
                             
                           
                         
                         ) 
                       
                        
                       
                         R 
                         zz 
                       
                     
                   
                 
               
               
                 
                   ( 
                   20 
                   ) 
                 
               
             
           
         
       
     
         [0000]    This can be computed using the previously determined elements. 
         [0055]    As mentioned above, the system of equations is over constrained. In particular this implies that it is not necessary to know all three vanishing points to compute the rotation matrix. The various constraints from (10) lead to relations that allow computation of the rotation matrix from two vanishing points. Consider the following constraint: 
         [0000]        R   xx   R   xy   +R   yx   R   yy   +R   zx   R   zy =0  (21)
 
         [0056]    Using (9) gives: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             u 
                             ∞ 
                             y 
                           
                           
                             v 
                             ∞ 
                             y 
                           
                         
                          
                         
                           R 
                           xx 
                         
                          
                         
                           R 
                           yy 
                         
                       
                       + 
                       
                         
                           
                             v 
                             ∞ 
                             x 
                           
                           
                             u 
                             ∞ 
                             x 
                           
                         
                          
                         
                           R 
                           xx 
                         
                          
                         
                           R 
                           yy 
                         
                       
                       + 
                       
                         
                           
                             f 
                             P 
                             2 
                           
                           
                             
                               u 
                               ∞ 
                               x 
                             
                              
                             
                               v 
                               ∞ 
                               y 
                             
                           
                         
                          
                         
                           R 
                           xx 
                         
                          
                         
                           R 
                           yy 
                         
                       
                     
                     = 
                     0 
                   
                   , 
                 
               
               
                 
                   ( 
                   22 
                   ) 
                 
               
             
           
         
       
     
         [0057]    This implies: 
         [0000]        f   p   2 =−( {right arrow over (x)}   ∞   ·{right arrow over (y)}   ∞ ) or  f   p =√{square root over (−( {right arrow over (x)}   ∞   ·{right arrow over (y)}   ∞ ))}  (23)
 
         [0058]    The focal length is hence determined by the x and y vanishing points. This result can be used to determine the diagonal elements, and in turn all the elements, in terms of the x and y vanishing points. The diagonal elements are determined as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         R 
                         xx 
                         2 
                       
                       + 
                       
                         R 
                         yx 
                         2 
                       
                       + 
                       
                         R 
                         zx 
                         2 
                       
                     
                     = 
                     
                       
                         1 
                         ⇒ 
                         
                           R 
                           xx 
                           2 
                         
                       
                       = 
                       
                         
                           
                             1 
                             
                               1 
                               + 
                               
                                 
                                   ( 
                                   
                                     
                                       v 
                                       ∞ 
                                       x 
                                     
                                     
                                       u 
                                       ∞ 
                                       x 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                               + 
                               
                                 
                                   ( 
                                   
                                     
                                       f 
                                       P 
                                       2 
                                     
                                     
                                       u 
                                       ∞ 
                                       x 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                             
                           
                            
                           
                             
 
                           
                           ∴ 
                           
                             R 
                             xx 
                           
                         
                         = 
                         
                           
                             
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   · 
                                   
                                     i 
                                     ^ 
                                   
                                 
                                 ) 
                               
                               2 
                             
                             
                               
                                 
                                   x 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               · 
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   - 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         xy 
                         2 
                       
                       + 
                       
                         R 
                         yy 
                         2 
                       
                       + 
                       
                         R 
                         zy 
                         2 
                       
                     
                     = 
                     
                       
                         1 
                         ⇒ 
                         
                           R 
                           yy 
                           2 
                         
                       
                       = 
                       
                         
                           
                             1 
                             
                               1 
                               + 
                               
                                 
                                   ( 
                                   
                                     
                                       u 
                                       ∞ 
                                       y 
                                     
                                     
                                       v 
                                       ∞ 
                                       y 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                               + 
                               
                                 
                                   ( 
                                   
                                     
                                       f 
                                       P 
                                     
                                     
                                       v 
                                       ∞ 
                                       y 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                             
                           
                            
                           
                             
 
                           
                           ∴ 
                           
                             R 
                             yy 
                           
                         
                         = 
                         
                           
                             
                               
                                 ( 
                                 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   · 
                                   
                                     j 
                                     ^ 
                                   
                                 
                                 ) 
                               
                               2 
                             
                             
                               
                                 
                                   y 
                                   ⇀ 
                                 
                                 ∞ 
                               
                               · 
                               
                                 ( 
                                 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   - 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         zx 
                         2 
                       
                       + 
                       
                         R 
                         zy 
                         2 
                       
                       + 
                       
                         R 
                         zz 
                         2 
                       
                     
                     = 
                     
                       
                         1 
                         ⇒ 
                         
                           R 
                           zz 
                           2 
                         
                       
                       = 
                       
                         
                           
                             1 
                             - 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       f 
                                       P 
                                     
                                     
                                       u 
                                       ∞ 
                                       x 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                                
                               
                                 R 
                                 xx 
                                 2 
                               
                             
                             - 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       f 
                                       P 
                                     
                                     
                                       v 
                                       ∞ 
                                       y 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                                
                               
                                 R 
                                 yy 
                                 2 
                               
                             
                           
                            
                           
                             
 
                           
                           ∴ 
                           
                             R 
                             zz 
                           
                         
                         = 
                         
                           
                             1 
                             + 
                             
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   · 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                               
                                 
                                   
                                     x 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                                 · 
                                 
                                   ( 
                                   
                                     
                                       
                                         x 
                                         ⇀ 
                                       
                                       ∞ 
                                     
                                     - 
                                     
                                       
                                         y 
                                         ⇀ 
                                       
                                       ∞ 
                                     
                                   
                                   ) 
                                 
                               
                             
                             + 
                             
                               
                                 ( 
                                 
                                   
                                     
                                       x 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                   · 
                                   
                                     
                                       y 
                                       ⇀ 
                                     
                                     ∞ 
                                   
                                 
                                 ) 
                               
                               
                                 
                                   
                                     y 
                                     ⇀ 
                                   
                                   ∞ 
                                 
                                 · 
                                 
                                   ( 
                                   
                                     
                                       
                                         y 
                                         ⇀ 
                                       
                                       ∞ 
                                     
                                     - 
                                     
                                       
                                         x 
                                         ⇀ 
                                       
                                       ∞ 
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   24 
                   ) 
                 
               
             
           
         
       
     
         [0059]    From their explicit form, we see that there is no dependence on {right arrow over (z)} ∞ , the z vanishing point. Four of the remaining elements are given by (again independent of {right arrow over (z)} ∞ ): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         R 
                         zx 
                       
                       = 
                       
                         
                           
                             
                               - 
                               
                                 f 
                                 p 
                               
                             
                             
                               u 
                               ∞ 
                               x 
                             
                           
                            
                           
                             R 
                             xx 
                           
                         
                         = 
                         
                           
                             
                               - 
                               
                                 
                                   - 
                                   
                                     ( 
                                     
                                       
                                         
                                           x 
                                           ⇀ 
                                         
                                         ∞ 
                                       
                                       - 
                                       
                                         
                                           y 
                                           ⇀ 
                                         
                                         ∞ 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               u 
                               ∞ 
                               x 
                             
                           
                            
                           
                             R 
                             xx 
                           
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         yx 
                       
                       = 
                       
                         
                           
                             v 
                             ∞ 
                             x 
                           
                           
                             u 
                             ∞ 
                             x 
                           
                         
                          
                         
                           R 
                           xx 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         zy 
                       
                       = 
                       
                         
                           
                             
                               - 
                               
                                 f 
                                 p 
                               
                             
                             
                               v 
                               ∞ 
                               y 
                             
                           
                            
                           
                             R 
                             yy 
                           
                         
                         = 
                         
                           
                             
                               - 
                               
                                 
                                   - 
                                   
                                     ( 
                                     
                                       
                                         
                                           x 
                                           ⇀ 
                                         
                                         ∞ 
                                       
                                       - 
                                       
                                         
                                           y 
                                           ⇀ 
                                         
                                         ∞ 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               v 
                               ∞ 
                               y 
                             
                           
                            
                           
                             R 
                             yy 
                           
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         xy 
                       
                       = 
                       
                         
                           
                             u 
                             ∞ 
                             y 
                           
                           
                             v 
                             ∞ 
                             y 
                           
                         
                          
                         
                           R 
                           yy 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   25 
                   ) 
                 
               
             
           
         
       
     
         [0060]    The last two elements can be computed from equations analogous to (20): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       R 
                       xz 
                     
                     = 
                     
                       - 
                       
                         ( 
                         
                           
                             
                               
                                 R 
                                 xx 
                               
                                
                               
                                 R 
                                 zx 
                               
                             
                             + 
                             
                               
                                 R 
                                 xy 
                               
                                
                               
                                 R 
                                 zy 
                               
                             
                           
                           
                             R 
                             zz 
                           
                         
                         ) 
                       
                     
                   
                   , 
                   
                       
                   
                    
                   
                     
                       R 
                       yz 
                     
                     = 
                     
                       - 
                       
                         ( 
                         
                           
                             
                               
                                 R 
                                 yx 
                               
                                
                               
                                 R 
                                 zx 
                               
                             
                             + 
                             
                               
                                 R 
                                 yy 
                               
                                
                               
                                 R 
                                 zy 
                               
                             
                           
                           
                             R 
                             zz 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   26 
                   ) 
                 
               
             
           
         
       
     
         [0061]    Therefore, the rotation matrix is completely determined using only the x and y vanishing points. This suggests that the z vanishing point may be constrained by the x and y vanishing points. Comparing the two formulas for R xx , it can be shown that: 
         [0000]        {right arrow over (z)}   ∞   −{right arrow over (y)}   ∞ )· {right arrow over (z)}   ∞ =0  (27)
 
         [0062]    Mention should again be made of the special cases where some of the rotation matrix elements are zero because of vanishing points at infinity. This leads to “division by 0” situations in some of the equations. These cases need to be identified prior to the above analysis and the equations appropriately adjusted. 
         [0063]    Up to this stage, it has been assumed that the two camera positions coincide at the center, differing only in orientation. In fact, a translation of the camera does not change the vanishing point analysis. To demonstrate this, consider a general translation vector {right arrow over (v)} s : 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         x 
                         ⇀ 
                       
                       2 
                     
                     = 
                     
                       
                         R 
                          
                         
                           
                             x 
                             ⇀ 
                           
                           1 
                         
                       
                       + 
                       
                         
                           v 
                           ⇀ 
                         
                         s 
                       
                     
                   
                   , 
                   
                       
                   
                    
                   
                     
                       
                         v 
                         ⇀ 
                       
                       s 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               x 
                               s 
                             
                           
                         
                         
                           
                             
                               y 
                               s 
                             
                           
                         
                         
                           
                             
                               z 
                               s 
                             
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   28 
                   ) 
                 
               
             
           
         
       
     
         [0000]    Analogous to (7), the projective map becomes: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       u 
                       
                         m 
                          
                         
                             
                         
                          
                         2 
                       
                       L 
                     
                     = 
                     
                       
                         - 
                         
                           f 
                           P 
                         
                       
                        
                       
                         
                           
                             
                               R 
                               xx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               xy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               xz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             x 
                             s 
                           
                         
                         
                           
                             
                               R 
                               zx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             z 
                             s 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       v 
                       
                         m 
                          
                         
                             
                         
                          
                         2 
                       
                       L 
                     
                     = 
                     
                       
                         - 
                         
                           f 
                           P 
                         
                       
                        
                       
                         
                           
                             
                               R 
                               yx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               yy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               yz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             y 
                             s 
                           
                         
                         
                           
                             
                               R 
                               zx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               L 
                             
                           
                           + 
                           
                             z 
                             s 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   29 
                   ) 
                 
               
             
           
         
       
     
         [0064]    In taking the infinite limits along the three axes, equation (8) is unchanged; hence the computations that follow are also unchanged. In particular, the same equations can be used for computing the rotation matrix. However, the translation vector itself cannot be computed using this approach. 
         [0065]    The results for projective cameras can be extended to UWA cameras, in accordance with a preferred embodiment of the invention. Unless lined in some certain directions, a straight line {(x mn   L , y mn   L , z mn   L )} in 3D will normally be imaged as a curved line in the UWA image space (see  FIG. 5 ), also referred to as fisheye space. Parallel lines will again intersect in the UWA image, although determining the vanishing points is made difficult by the fact that the lines are now curved. In one embodiment, to get around this technicality, selected portions of the fisheye image the curved parallel lines are mapped onto a projective plane  130 , as if they were taken by a corresponding projective camera having the same orientation and position as the UWA camera. In the projective plane, the lines appear straight and the vanishing points can be determined by looking for intersections of parallel lines aligned to the coordinate frame axes, precisely as for the projective camera above. The rotation matrix is the same for both the UWA camera and the corresponding projective camera. Once the vanishing points are known; the matrix can then be computed using the equations for the projective camera. 
         [0066]    Let {(u m2   L , v m2   L )} be the coordinates of a straight 3D line, as imaged by the rotated UWA camera in position 2 (e.g.  FIG. 5   a ); appearing as a curved line. The real world 3D coordinates of the line can be described as: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       x 
                       ⇀ 
                     
                     
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                     L 
                   
                   = 
                   
                     
                       [ 
                       
                         
                           
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                           
                         
                         
                           
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                           
                         
                         
                           
                             
                               
                                 z 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 L 
                               
                                
                               
                                   
                               
                             
                           
                         
                       
                       ] 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               
                                 
                                   r 
                                   
                                     m 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                   L 
                                 
                                  
                                 sin 
                                  
                                 
                                     
                                 
                                  
                                 
                                   θ 
                                   
                                     m 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                   L 
                                 
                                  
                                 
                                     
                                 
                                  
                                 cos 
                                  
                                 
                                     
                                 
                                  
                                 
                                   φ 
                                   
                                     m 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                   L 
                                 
                               
                                
                               
                                   
                               
                             
                           
                         
                         
                           
                             
                               
                                 r 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 L 
                               
                                
                               sin 
                                
                               
                                   
                               
                                
                               
                                 θ 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 L 
                               
                                
                               
                                   
                               
                                
                               sin 
                                
                               
                                   
                               
                                
                               
                                 φ 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 L 
                               
                             
                           
                         
                         
                           
                             
                               
                                 r 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 L 
                               
                                
                               cos 
                                
                               
                                   
                               
                                
                               
                                 θ 
                                 
                                   m 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 L 
                               
                             
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   30 
                   ) 
                 
               
             
           
         
       
     
         [0067]    The radial coordinate is not known, whereas the angular coordinates {(θ m2   L , φ m2   L )} can be computed from {(u m2   L , v m2   L )} using the UWA lens transformation. Next, a projection onto a projective camera identified as n=2′ with focal length f p  is made, giving the 2D coordinates: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       u 
                       
                         m 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                       L 
                     
                     = 
                     
                       
                         
                           - 
                           
                             f 
                             P 
                           
                         
                          
                         
                           
                             x 
                             
                               m 
                                
                               
                                   
                               
                                
                               2 
                             
                             L 
                           
                           
                             z 
                             
                               m 
                                
                               
                                   
                               
                                
                               2 
                             
                             L 
                           
                         
                       
                       = 
                       
                         
                           - 
                           
                             f 
                             P 
                           
                         
                          
                         
                           
                             sin 
                              
                             
                                 
                             
                              
                             
                               θ 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                              
                             cos 
                              
                             
                                 
                             
                              
                             
                               φ 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                           
                           
                             cos 
                              
                             
                                 
                             
                              
                             
                               θ 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       v 
                       
                         m 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                       L 
                     
                     = 
                     
                       
                         
                           - 
                           
                             f 
                             P 
                           
                         
                          
                         
                           
                             y 
                             
                               m 
                                
                               
                                   
                               
                                
                               2 
                             
                             L 
                           
                           
                             z 
                             
                               m 
                                
                               
                                   
                               
                                
                               2 
                             
                             L 
                           
                         
                       
                       = 
                       
                         
                           - 
                           
                             f 
                             P 
                           
                         
                          
                         
                           
                             sin 
                              
                             
                                 
                             
                              
                             
                               θ 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                              
                             sin 
                              
                             
                                 
                             
                              
                             
                               φ 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                           
                           
                             cos 
                              
                             
                                 
                             
                              
                             
                               θ 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                               L 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   31 
                   ) 
                 
               
             
           
         
       
     
         [0068]    Selecting a specific value for f p , e.g.  1 , these equations can be used to compute the line coordinates {(u m2′   L , v m2′   L )} in the projective camera (starting from the UWA image coordinates {(u m2   L , v m2   L )}), which will from a straight line. Taking pairs of lines (m 1 , m 2 ) parallel to the x, y and z axis, then their projective camera coordinates: {(u m     1     2′   Lx , v m     1     2′   Lx )} and {(u m     2     2′   Lx , v m     2     2′   Lx )} for x, {(u m     1     2′   Ly , v m     1     2′   Ly )} and {(u m     2     2′   Ly , v m     2     2′   Ly )} for y, and {(u m     1     2′   Ly , v m     1     2′   Ly )} and {(u m     2     2′   Ly , v m     2     2′   Ly )} for z; can be used to find the line intersections in Image-2′ and hence the vanishing points in the projective Image-2′: 
         [0000]    
       
         
           
             
               
                 
                   
                     [ 
                     
                       
                         
                           
                             u 
                             
                               ∞2 
                               ′ 
                             
                             Lx 
                           
                         
                       
                       
                         
                           
                             v 
                             
                               ∞2 
                               ′ 
                             
                             Lx 
                           
                         
                       
                     
                     ] 
                   
                   = 
                   
                     
                       Intersection 
                        
                       
                           
                       
                        
                       of 
                        
                       
                           
                       
                        
                       Lines 
                        
                       
                           
                       
                        
                       
                         { 
                         
                           ( 
                           
                             
                               u 
                               
                                 
                                   m 
                                   1 
                                 
                                  
                                 
                                   2 
                                   ′ 
                                 
                               
                               Lx 
                             
                             , 
                             
                               v 
                               
                                 
                                   m 
                                   1 
                                 
                                  
                                 
                                   2 
                                   ′ 
                                 
                               
                               Lx 
                             
                           
                           ) 
                         
                         } 
                       
                        
                       
                           
                       
                        
                       and 
                        
                       
                           
                       
                        
                       
                         
                           { 
                           
                             ( 
                             
                               
                                 u 
                                 
                                   
                                     m 
                                     2 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Lx 
                               
                               , 
                               
                                 v 
                                 
                                   
                                     m 
                                     2 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Lx 
                               
                             
                             ) 
                           
                           } 
                         
                          
                         
                           
 
                         
                         [ 
                         
                           
                             
                               
                                 u 
                                 
                                   ∞2 
                                   ′ 
                                 
                                 Ly 
                               
                             
                           
                           
                             
                               
                                 v 
                                 
                                   ∞2 
                                   ′ 
                                 
                                 Ly 
                               
                             
                           
                         
                         ] 
                       
                     
                     = 
                     
                       
                         Intersection 
                          
                         
                             
                         
                          
                         of 
                          
                         
                             
                         
                          
                         Lines 
                          
                         
                             
                         
                          
                         
                           { 
                           
                             ( 
                             
                               
                                 u 
                                 
                                   
                                     m 
                                     1 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Ly 
                               
                               , 
                               
                                 v 
                                 
                                   
                                     m 
                                     1 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Ly 
                               
                             
                             ) 
                           
                           } 
                         
                          
                         
                             
                         
                          
                         and 
                          
                         
                             
                         
                          
                         
                           
                             { 
                             
                               ( 
                               
                                 
                                   u 
                                   
                                     
                                       m 
                                       2 
                                     
                                      
                                     
                                       2 
                                       ′ 
                                     
                                   
                                   Ly 
                                 
                                 , 
                                 
                                   v 
                                   
                                     
                                       m 
                                       2 
                                     
                                      
                                     
                                       2 
                                       ′ 
                                     
                                   
                                   Ly 
                                 
                               
                               ) 
                             
                             } 
                           
                            
                           
                             
 
                           
                           [ 
                           
                             
                               
                                 
                                   u 
                                   
                                     ∞2 
                                     ′ 
                                   
                                   Lz 
                                 
                               
                             
                             
                               
                                 
                                   v 
                                   
                                     ∞2 
                                     ′ 
                                   
                                   Lz 
                                 
                               
                             
                           
                           ] 
                         
                       
                       = 
                       
                         Intersection 
                          
                         
                             
                         
                          
                         of 
                          
                         
                             
                         
                          
                         Lines 
                          
                         
                             
                         
                          
                         
                           { 
                           
                             ( 
                             
                               
                                 u 
                                 
                                   
                                     m 
                                     1 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Lz 
                               
                               , 
                               
                                 v 
                                 
                                   
                                     m 
                                     1 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Lz 
                               
                             
                             ) 
                           
                           } 
                         
                          
                         
                             
                         
                          
                         and 
                          
                         
                             
                         
                          
                         
                           { 
                           
                             ( 
                             
                               
                                 u 
                                 
                                   
                                     m 
                                     2 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Lz 
                               
                               , 
                               
                                 v 
                                 
                                   
                                     m 
                                     2 
                                   
                                    
                                   
                                     2 
                                     ′ 
                                   
                                 
                                 Lz 
                               
                             
                             ) 
                           
                           } 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   32 
                   ) 
                 
               
             
           
         
       
     
         [0069]    The ideal un-rotated UWA camera position 1 (e.g.  FIG. 5   b ) also has associated with it the same type projective camera, identified as n=1′, with identical orientation and position. In the 3D frame of camera position-1′, which is identical to the frame of position 1, the line coordinates are {(x m1′   L , y m1′   L , z m1′   L )}. Under the transformation (28) between the two UWA cameras, which is the same transformation undergone by the projective cameras 1′ and 2′, the Frame-1′ coordinates are mapped to the Image-2′ coordinates according to (29): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       u 
                       
                         m 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                       L 
                     
                     = 
                     
                       
                         - 
                         
                           f 
                           P 
                         
                       
                        
                       
                         
                           
                             
                               R 
                               xx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               xy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               xz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             x 
                             s 
                           
                         
                         
                           
                             
                               R 
                               zx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             z 
                             s 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       v 
                       
                         m 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                       L 
                     
                     = 
                     
                       
                         - 
                         
                           f 
                           P 
                         
                       
                        
                       
                         
                           
                             
                               R 
                               yx 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               yy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               yz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             y 
                             s 
                           
                         
                         
                           
                             
                               R 
                               zz 
                             
                              
                             
                               x 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zy 
                             
                              
                             
                               y 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             
                               R 
                               zz 
                             
                              
                             
                               z 
                               
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 
                                   1 
                                   ′ 
                                 
                               
                               L 
                             
                           
                           + 
                           
                             z 
                             s 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   33 
                   ) 
                 
               
             
           
         
       
     
         [0070]    Taking the infinite limit for lines parallel to the three axes gives the three vanishing points for Image-2′ as in (8). Since the vanishing points are already known from (33), the final result is the same six equations relating the rotation matrix elements (9), re-written below, maintaining the projective camera index to explicitly show that the vanishing points are computed from the projective images not the original UWA images: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         R 
                         zx 
                       
                       = 
                       
                         
                           
                             - 
                             
                               f 
                               p 
                             
                           
                           
                             u 
                             
                               ∞2 
                               ′ 
                             
                             x 
                           
                         
                          
                         
                           R 
                           xx 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         yx 
                       
                       = 
                       
                         
                           
                             
                               v 
                               
                                 ∞2 
                                 ′ 
                               
                               x 
                             
                             
                               - 
                               
                                 f 
                                 p 
                               
                             
                           
                            
                           
                             R 
                             zx 
                           
                         
                         = 
                         
                           
                             
                               v 
                               
                                 ∞2 
                                 ′ 
                               
                               x 
                             
                             
                               u 
                               
                                 ∞2 
                                 ′ 
                               
                               x 
                             
                           
                            
                           
                             R 
                             xx 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         zy 
                       
                       = 
                       
                         
                           
                             - 
                             
                               f 
                               p 
                             
                           
                           
                             v 
                             
                               ∞2 
                               ′ 
                             
                             y 
                           
                         
                          
                         
                           R 
                           yy 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         xy 
                       
                       = 
                       
                         
                           
                             
                               u 
                               
                                 ∞2 
                                 ′ 
                               
                               y 
                             
                             
                               - 
                               
                                 f 
                                 p 
                               
                             
                           
                            
                           
                             R 
                             zy 
                           
                         
                         = 
                         
                           
                             
                               u 
                               
                                 ∞2 
                                 ′ 
                               
                               y 
                             
                             
                               v 
                               
                                 ∞2 
                                 ′ 
                               
                               y 
                             
                           
                            
                           
                             R 
                             yy 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         R 
                         xz 
                       
                       = 
                       
                         
                           
                             u 
                             
                               ∞2 
                               ′ 
                             
                             z 
                           
                           
                             - 
                             
                               f 
                               p 
                             
                           
                         
                          
                         
                           R 
                           zz 
                         
                       
                     
                     , 
                     
                         
                     
                      
                     
                       
                         R 
                         yz 
                       
                       = 
                       
                         
                           
                             v 
                             
                               ∞2 
                               ′ 
                             
                             z 
                           
                           
                             - 
                             
                               f 
                               p 
                             
                           
                         
                          
                         
                           R 
                           zz 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   34 
                   ) 
                 
               
             
           
         
       
     
         [0071]    The same focal length f p  should be used for computing the vanishing points. From here onwards, the derivation for the rotation matrix is identical to that of the projective camera. In particular, the rotation matrix is given by equations (16) to (20) or (24) to (26). The translation cannot be computed from vanishing points alone, and normally is not the issue when the projection source is in a fixed position. 
         [0072]    Finally, once the rotation matrix associated with the capture device  14  is obtained, a correction transformation can be computed  180  to undo misorientation of the projection source  10 . Given the rotation of the projector relative to camera is known, its&#39; absolute (relative to the ideal) rotation can be calculated as follows: 
         [0000]        R   IP   =R   IC   ×R   CP (35) 
         [0000]    where R IC  is the camera rotation matrix, as computed; R CP  represents the rotation matrix relating the projector to the camera; and R IP  is the matrix representing rotation of the projector with respect to the ideal orientation. R CP  may be an identity matrix, for instance if the capture device is integrated with the projection source. Furthermore, in analogy with what was demonstrated in Eqs. (27) and (28) regarding the camera displacement factor, the relative displacement of the projector from the camera does not affect R CP . 
         [0073]    A correction transformation  180  constructed upon the rotation matrix R IP  can be applied to the output image in a forward direction to correct for the image distortions. Alternatively, an inverse transformation can be calculated and applied to the source or input image, such that the output image appears substantially undistorted. The latter would be preferred when the calibration is performed in real-time using a processing chip. 
         [0074]    In one embodiment, orientation of the projection source changes as in time, requiring frequent calibration. The above procedure can be repeated as often and as fast as needed to dynamically compute a rotation matrix for varying rotational angles. 
         [0075]    In one embodiment, the projection source is part of a car HUD assembly, where the image is formed on a virtual screen a few feet in front of the car&#39;s windshield. During the calibration process, the optical rays for both the projection source and the capture device pass through the windshield which is normally curved, adding extra distortions. The windshield curvature, as well as other distortions in the system that are optical in nature, are generally decoupled from the geometric (rotation) and fisheye distortions. That also applies to real viewing surface distortions, be it intrinsic curvatures or a specific geometry. Techniques taught for example in the U.S. Pat. No. 8,406,562 can be used, usually once, and the correction components associated with each of the above distortions may get concatenated with the geometric correction R IP  as disclosed. 
         [0076]    While the above description provides examples of the embodiments, it will be appreciated that some features and/or functions of the described embodiments are susceptible to modification without departing from the spirit and principles of operation of the described embodiments. Accordingly, what has been described above has been intended to be illustrative of the invention and non-limiting and it will be understood by persons skilled in the art that other variants and modifications may be made without departing from the scope of the invention as defined in the claims appended hereto.