CameraTransform:

Path: SCPro/ProSensors

% Generate a camera transformation.

   Transforms from the scene frame to the pixel frame. Does not do
   depth buffering. The points you give it must be visible to the camera
   This outputs the transformed points and the transformation matrix.

   types are 'perspective', 'affine', 'infinite' and 'weak perspective'.
   With 'infinite' the input points should be unit vectors. They are
   unitized internally.

   The radial distortion model is xd = x*(1 + k(1)r^2 + k(2)r^4)
   where r^2 = x^2 + y^2

   Type CameraTransform for a demo. The first three apply the
   'perspective', 'affine' and 'weak perspective' transforms to the
   vertices of a triangle. The last applies the infinite transform
   to a point on the boresight.

--------------------------------------------------------------------------
   Form:

   [pT, m] = CameraTransform( type, d, p )

   or

   m = CameraTransform( type, d )

--------------------------------------------------------------------------

   ------
   Inputs
   ------
   type           (1,:) Transformation type
   d              (1,1) Data structure
                        .t (3,1) Location of camera
                        .r (3,3) Rotation matrix from scene to camera frame                                
                        .o (2,1) Origin of the pixel frame (pixels)
                        .n (2,1) Dimensions of the pixel array
                        .f (1,1) Focal length (m)
                        .s (2,1) Scaling (m/pixel)
                        .k (1,2) Distortion coefficients
   p              (3,:) Points to transform

   -------
   Outputs
   -------
   pT             (2,:) Transformed points or m if p not entered
   m              (3,3) Transformation matrix
   j              (1,m) Removed points

--------------------------------------------------------------------------
   Reference: E. Trucco and A. Verri, "Introductory Techniques for 3-D
              Computer Vision, Prentice-Hall, 1998.
--------------------------------------------------------------------------

Children:

Common: General/DeBlankLT
Common: Graphics/NewFig
Common: Graphics/PltStyle
Common: Graphics/TitleS
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Graphics/ZLabelS
Math: Linear/Unit

Back to the SCPro Module page