7. Image Transforms
7. Image Transforms
Perspective Matters!!
Taj Mahal
Taj Mahal
Taj Mahal
Perspective Transforms
• Parallel lines in the world intersect in the
projected image at a “vanishing point”.
• Parallel lines on the same plane in the world
converge to vanishing points on a “vanishing
line”.
Vanishing Point Vanishing Point
Vanishing Line
Paris town hall
“Anamorphosis”
Lake Sørvágsvatn in Faroe Islands
3D world 2D image
Point of observation
p = (x,y) p’ = (x’,y’)
Transformation T is a coordinate-changing machine:
p’ = T(p)
Original
Transformed
2
Scaling
• Non-uniform scaling: different scalars per component:
X 2,
Y 0.5
Scaling
Polar coordinates…
x = r cos (f)
y = r sin (f)
x’ = r cos (f + )
(x’, y’) y’ = r sin (f + )
Trig Identity…
(x, y) x’ = r cos(f) cos() – r sin(f) sin()
y’ = r sin(f) cos() + r cos(f) sin()
Substitute…
f
x’ = x cos() - y sin()
y’ = x sin() + y cos()
2-D Rotation
This is easy to capture in matrix form:
x' s x 0 x x' 1 x x
y ' = 0 s y y y ' =
y 1 y
Scale Shear
x
x' cos − sin x x 1 0 t x
y ' = sin cos y y = 0 1 t y
y
1
Rotate Translate
x
x a b c Affine is any combination of
y = d e
f
y translation, scale, rotation, and shear
1
Affine
Affine Transformations
x
x a b c
Affine transformations are combinations of y = d e
f
y
• Linear transformations, and
1
• Translations
or
‘Homography’
Szeliski 2.1
3D Rigid Body Transform
Rotation
Rotation
Rotation ZRotate(θ)
y
• About z axis p'
θ p
x
z
Slides from James Hays, Derek Hoiem, Alexei Efros, Steve Seitz, and David Forsyth
Image Formation: Orthographic Projection
• Means of representing 3-dimensional objects
in 2-Dimensions.
• It is a form of parallel projection, in which all
the projection lines are orthogonal to
the projection plane
Orthographic Projections
• A simple orthographic projection onto the plane z = 0 can be
defined by the following matrix:
• For each point v = (vx, vy, vz), the transformed point Pv would
be
https://en.wikipedia.org/wiki/Orthographic_projection
Orthographic Projections
• In computer graphics, one of the most common
matrices used for orthographic projection can be
defined by a 6-tuple, (left, right, bottom, top,
near, far), which defines the clipping planes.
• These planes form a box with the minimum
corner at (left, bottom, -near) and the maximum
corner at (right, top, -far).
• The box is translated so that its center is at the
origin, then it is scaled to the unit cube which is
defined by having a minimum corner at
(−1,−1,−1) and a maximum corner at (1,1,1).
Orthographic Projections
Pinhole camera model
f
Real
object
f = Focal length
c = Optical center of the camera
Image
. P = Y
center Z
.
(u0, v0)
f
. Z Y
V
Camera
.U
Center
(0, 0, 0)
U
p= f f
V U = −X * V = −Y *
Z Z
p = distance from
image center
What is the effect if f and Z are equal?
Perspective Projection:
• https://www.youtube.com/watch?v=17kqhGR
DHc8
Important Definitions
• Frame of reference: a measurements are made with respect to
a particular coordinate system called the frame of reference.
• World Frame: a fixed coordinate system for representing
objects (points, lines, surfaces, etc.) in the world.
• Camera Frame: coordinate system that uses the camera center
as its origin (and the optic axis as the Z-axis)
• Image or retinal plane: plane on which the image is formed,
note that the image plane is measured in camera frame
coordinates (mm)
• Image Frame: coordinate system that measures pixel locations
in the image plane.
• Intrinsic Parameters: Camera parameters that are internal and
fixed to a particular camera/digitization setup
• Extrinsic Parameters: Camera parameters that are external to
the camera and may change with respect to the world frame.
HW Questions
• Read and define a few parmeters with respect
to camera that are:
1. Intrinsic
2. Extrinsic
Camera Model & Calibration
Due to extensive Mathematical Computations
please study the links:
Video Lecture Links
1. Web link:Projective geometry, camera
models and calibration, IIT Delhi:
http://www.cse.iitd.ernet.in/~suban/vision/geo
metry/index.html
Next Class
• Please Read the content of the lectures to
understand the mathematics of forming
• Camera Matrix
• Ping me the points which you are not able to
understand….
• So that I can send you solutions to those
points.