Digital Image
and
Imaging Geometry
             What is a Digital Image?
• A 2D function f(x,y)
• Spatial(plane) coordinates x,y
• Amplitude of f at any coordinate is the intensity or
  gray level
• A digital image is composed of finite number of
  elements each of which has a particular location and
  value.
• Picture elements - Pixels
 Matrix representation of an MxN image
An image of size M x N pixels
ie., M rows, N columns
1-D function representation
           y
               * y=f(x)
               x
2-D Function Representation
              2
          2   3   2
              2
                    Imaging Geometry
• Transformations used in imaging
• Camera model
• Stereo imaging problem
                     Basic Transformations
• Unified representations for problems like
   • Image rotation
   • Image scaling
   • image translation
• All transformations are expressed in 3D cartesian coordinate system
   • A point has coordinates (X,Y,Z)
   • World coordinates
                                                  2D coordinates (x,y)
Translation
                                  Translation
The task:
                    (X0,Y0,Z0)
(X,Y,Z)                             (X*,Y*,Z*)
X*        = X+ X0
y*        = y+ y0
Z*        = Z+ Z0
                                    v*     =     Av
                                                A - Transformation matrix
                                 v – column vector with original coordinates
                               Translation
Use of square matrix simplifies the representation
                             v*      =      Tv
                                     T - Translation matrix
                             v – column vector with original coordinates
Scaling
                                  Scaling
• Scaling by Sx, Sy, Sz in directions X,Y,Z is given by the transformation matrix
• Can you write the matrix equation for scaling operation?
                            Rotation
Consider a 2D case where you have a point (x,y) and you want to
rotate to θ degrees counter clockwise to get x′,y′).
• Convert to polar coorindates.                      (x’,y’)
 x=rcos(α)                                        r        (x,y)
 y=rsin(α)                                       θ    r      rsin(α)
                                                  rcos(α)
• Rotate by θ degrees counterclockwise and covert back to Cartesian
  coordiantes.
x′= rcos(α + θ)
  = rcos(α)cos(θ) − rsin(α)sin(θ)
  So          x’= xcos(θ) − ysin(θ)
 similarly y′ = xsin(θ) + ycos(θ)
                           Rotation
• In Geometry, any rotation is a motion of a certain space that
  preserves at least one point.
• In two dimensions, the point (x, y) to be rotated
  counterclockwise is written as a column vector, then multiplied
  by a rotation matrix.
• To rotate by θ,
                      • x′= xcos(θ) − ysin(θ)
                      • y′= xsin(θ) + ycos(θ)
                       Rotation of a point
Rotation of a point about each     Rotation of a point about Z
Coordinate axis in clockwise       coordinate axis by θ is achieved by
direction when looking at the      using the transformation matrix
origin from the point on Z axis.
                           Concatenation
Translation, rotation and scaling are linear transformations.
• The application of several transformations can be represented by a single
  4x4 matrix.
• Ex. Translation, scaling and rotation about Z axis of a point v can be
  represented as follows.
• Non-commutable matrices. So order is important.
                  Inverse transformation matrix
• Many of the transformations discussed have inverse matrices that perform the
  opposite transformation.
Ex.     Translation matrix
                                                       Inverse translation matrix
              Perspective Transformation
               (Imaging Transformation)
• Projects 3D points into a plane
• Provide an approximation to the manner in which an image is formed
  by viewing a 3D world.
Image formation in the eye
                    Basic model of imaging process
• world coordinate system (X,Y,Z)
• Camera coordinate system (x,y,z)
   •   The image plane coincides with XY plane
   •   The optical axis established by the centre of the lens, along the z axis.
   •   The centre of the image plane is at origin.
   •   Centre of the lens is at (0,0,λ).
   •   Here λ is the focal length of the lens.
Assumption:
• Camera coordinate system is
 aligned with world coordinate system
• Z > λ always.
The image plane coordinates (x,y) of the projected 3D
point at (X,Y,Z)
         Non-linear because of the division by coordinate Z
           Homogeneous coordinates
Cartesian coordinates             Homogeneous coordinates
k is an arbitrary non-zero constant.
Perspective transformation
• To obtain 2D coordinates from 3D coordinates,
Define a perspective transformation Matrix
 Camera coordinates
in homogeneous form
Cartesian coordinates of any point in camera
coordinate system
By dividing the first three element by the fourth in the previous matrix,
                                             The third component z is
                                             of no interest now
       Inverse Perspective Transformation
Perspective transformation   The inverse perspective
matrix                       transformation matrix maps
                             an image point back into 3D
   Recovering 3D coordinates
• Suppose the image point has coordinates (x0,y0,0)
   • 0 is the z location -> image plane is located at z=0.
• Obtain homogeneous coordinates
• Cartesian coordinates
     Difficulty in Inverse perspective
     transformation
• For any 3D point, Z=0.
• This is because the projection of a 3D point onto the image plane is a
  many-to-one transformation.
• The image point (x0,y0)
 corresponds to a set of collinear
 3D points that lie on the line passing
 through (x0,y0,0) and (0,0,λ).
Recovering 3D coordinates
• The equations of the line mentioned above in world coordinate system
   • Recovering a 3D point from its image
    using inverse perspective transformation requires
    knowledge of at least one of the world coordinates of the point.
                         Stereo Imaging
• Mapping of a 3D scene onto an image plane is a many to one
  transformation.
• An image point does not uniquely determine the location of the
  corresponding world point.
• The missing depth information can be obtained using stereoscopic
  imaging techniques.
• Get two separate image views of a single world point w
• The objective: Find (X,Y,Z) of the point w having image points (x1,y1)
  and (x2,y2).
              Model of the stereo imaging process
• The objective: Find (X,Y,Z) of the point w having image points (x1,y1) and (x2,y2).
• The assumption:
   • The cameras are identical.
   • The coordinate system of both cameras
     are perfectly aligned
   Difficulty: Finding two corresponding points
    in different images of the same scene.
   Approach: Select a point in a small region in
   one image view and find the best matching
   region in the other image using correlation techniques.
Camera model assuming both the coordinate
systems coincide
• Basic equations representing the mathematical model of an imaging
  camera
   General Imaging geometry with two
   coordinate systems
• Camera coordinates (x,y,z)
• World coordinates (X,Y,Z)
• 3D point w
• point on imaging plane c
• Pan- angle between x and X axis
• Tilt - angle between z and Z axis
• Offset of the mount from the origin
Of the world coordinate system
The method –
Align camera and world coordinate system
Apply perspective transformation to get (x,y)