Lec11 Transformations
Lec11 Transformations
for
Vision, Graphics and Robotics
Lecture 11, February 27, 2006
Projective, Affine and Similarity
Transformations
Overview of Today’s Lecture
• Complete the discussion from Lecture 10 on homogeneous representations,
including the line at infinity and conics.
• Transformations: projective, similarity, affine.
• Undoing distortions
Projective Transformations
The study of transformations and their properties (especially their invariants)
is fundamental to geometry.
• A projective transformation is an invertible mapping that preserves colin-
earity
• Projective transformations are also known as homographies, projectivities
and colineations.
• One may prove (not easily) that projective transformations may be rep-
resented by a 3 × 3 invertible matrix:
x0 = Hx (1)
• Designate four locations for these to map to: (0, 0, 1)T , (1, 0, 1)T , (0, r, 1)T
and (1, r, 1)T . Note that we are creating an arbitrary Euclidean coordinate
in the image.
• These four “correspondences” allow us to compute a unique transforma-
tion, H.
• We apply this transformation to the entire image. It undoes the effects of
the projective distortion.
Transformation Groups
• The set of projective transformations, together with matrix multiplication,
forms a group.
– A group is a set of elements together with a composition operation
satisfying four fundamental properties: (1) associativity, (2) transi-
tivity, (3) existence of an identity element, and (4) existence of a
unique inverse for each element.
• We then naturally explore subgroups, which are simpler versions of pro-
jective transformations.
2
Euclidean and Similarity Transformations: Motivation
• Changes in coordinate systems in the world are generally Euclidean trans-
formations.
• When the image plane of a camera is parallel to a planar surface and
when the camera is moved parallel to or perpendicular to the surface,
the image geometry of objects on the surface is changed by a similarity
transformation.
• Metric properties are retained by similarity transformations.
3
• A must be full rank.
• t is the translation.
• The decomposition is easily seen using the SVD (singular value decompo-
sition).
• Both sx and sy are non-zero.
4
• A transformation is no longer affine when it moves the line at infinity.
• We will look at an example of this in class.
5
Projective to Affine
• Recall the following important facts:
– On a planar surface in the world (in other words prior to projective
distortions) parallel lines intersect on the line at infinity.
– Projections of parallel lines meet at vanishing points.
– Projective transformations preserve colinearity.
• Therefore, we need to
• We form the dual absolute conic from the circular points and note that
the affine transformation of this conic has a particularly simple form, just
involving the matrix K from (9).
• We then form constraints on this dual absolute conic from the image
angles between lines that are supposed to be perpendicular in the world.
It turns out that knowing two sets of perpendicular lines is enough to fully
constrain the matrix K.
We will discuss some of the details, especially the circular points and line conics.
Most of the rest will be left uncovered and you will not be responsible for it.
6
Circular Points
• Consider the similarity matrix
sR t
HS = (11)
0T 1
7
C∗∞ — The Conic Dual to the Circular Points
• We can form the conic dual to the circular points. The result is
1 0 0
C∗∞ = 0 1 0 (15)
0 0 0
Note: we are doing this in a coordinate system that has not been projec-
tively or affinely distorted
• Let’s look at projective transformations of this conic. Start by reversing
the order of the decomposition in equation 9:
0
t0
I 0 K 0 sR t A
H = HP HA HS = = T (16)
vT v 0T 1 0T 1 v0 v0
T
where A0 = sKR, t0 = Kt, v0 = svT KR, and v 0 = vT Kt + v.
– This decomposition, like the one above, is unique. The terms are
different (and a bit more complicated).
• Using this, the effect of a projective transformation on C∗∞ is
C∗∞ 0 = HC∗∞ HT
= HP HA HS C∗∞ HTS HTA HTP
= HP HA C∗∞ HTA HTP
KKT KKT v
= . (17)
vT KKT vT KKT v
KKT
∗ 0 0
C∞ = . (18)
0T 0
8
• We can measure the angle between these two lines with respect to the dual
absolute conic:
lT C∗∞ m l1 m1 + l2 m2
cos θlm = = 2
(lT C∗∞ l)1/2 (mT C∗∞ m)1/2 (l1 + l22 )1/2 + (m21 + m22 )1/2
(19)
• If we apply a projective transformation to the lines, we can see that this
relation still holds:
T
l0 C∗∞ 0 m0
cos θlm = . (20)
(l0 T C∗∞ l0 )1/2 (m0 T C∗∞ m0 )1/2
• Here, C∗∞ 0 is the parameter matrix of the dual absolute conic after the
transformation, and l0 and m0 are the tranformed vectors of line parame-
ters. The angle cos θlm is the angle in the original, undistorted coordinate
system.
9
• This gives enough information to solve for S.
• We can therefore solve for K, which gives us the affine transformation
matrix.
Summary
• Projective transformations: 3 × 3 invertible matrix.
• Projective transformations model image formation for planar surfaces.
10
Practice Problems and Potential Test Questions
1. Prove that for projective transformation matrix H, line conics transform
as C∗ 0 = HC∗ HT .
2. Show that similarity transformations satisfy the properties of a group.
3. Find the line conic that is dual to the points (0, 0, 1) and (1, 1, 1). What
is the nullspace of this conic? Give its geometric meaning.
4. Suppose we have computed a transformation matrix H and we want to
apply this transformation to an image, I. Sketch a procedure for doing so.
What problems might you run into along the way? Is there any advantage
to using the inverse mapping H−1 ?
5. Prove that any circle contains the circular points. Do this by first forming
the general conic matrix for a circle.
6. Prove that the decomposition in equation 16 is unique if s > 0 and det K =
1.
7. Find the inverse of a similarity transformation as a function of s, R and
t. Give a geometric interpretation in terms of translation, rotation and
scaling.
8. As described above, the 2 × 2 affine matrix A may be factored as
s 0
A = R(θ)R(−φ) x R(φ).
0 sy
What happens to the affine transformation if sx = sy ?
Homework 6 Problems
Solutions to the following problems are due at the start of class on Monday,
March 6, 2006.
1. (15 points)
(a) Given n points xi in P 2 , find necessary and sufficient conditions to
show that these points are collinear.
(b) Given n lines li in P 2 , find necessary and sufficient conditions to
show that these lines intersect at a single point.
(c) Show that these two problems are “duals” of each other in the sense
that if you interchange the roles of lines and points in the proofs, the
proofs are identical.
2. (10 points) How many intersection points are there between a line and a
conic? Find them. To do this, let x and y be two points on the line and
let C be the conic matrix. Write the line parametrically, and solve from
there.
11