Image transformations and image warping
CS5670: Computer Vision
Reading
Announcements
Image alignment
Image alignment
Why don’t these image line up exactly?
What is the geometric relationship between these two images?
?
Answer: Similarity transformation (translation, rotation, uniform scale)
What is the geometric relationship between these two images?
?
What is the geometric relationship between these two images?
Very important for creating mosaics!
First, we need to know what this transformation is.
Second, we need to figure out how to compute it using feature matches.
Image Warping
Image Stitching
9
Richard Szeliski
f
x
h
g
x
f
x
h
g
x
Image Warping
Image Stitching
10
Richard Szeliski
h
h
f
f
g
g
Parametric (global) warping
Image Stitching
11
Richard Szeliski
translation
rotation
aspect
Parametric (global) warping
p’ = T(p)
T
p = (x,y)
p’ = (x’,y’)
Common linear transformations
(0,0)
(0,0)
What is the inverse?
Common linear transformations
(0,0)
(0,0)
What is the inverse?
For rotations:
θ
2x2 Matrices
2D mirror across Y axis?
2D mirror across line y = x?
2x2 Matrices
2D mirror across Y axis?
2D mirror across line y = x?
2x2 Matrices
2D Translation?
Can a 2D translation by (tx,ty) be represented with a 2x2 matrix transformation?
ⓘ Start presenting to display the poll results on this slide.
2x2 Matrices
2D Translation?
Translation is not a linear operation on 2D coordinates
NO!
All 2D Linear Transformations
Homogeneous coordinates
Trick: add one more coordinate:
homogeneous image
coordinates
Converting from homogeneous coordinates
x
y
w
(x, y, w)
w = 1
(x/w, y/w, 1)
homogeneous plane
Translation
Affine transformations
any transformation represented by a 3x3 matrix with last row [ 0 0 1 ] we call an affine transformation
Basic affine transformations
Translate
2D in-plane rotation
Shear
Scale
Affine transformations
Is this an affine transformation?
Where do we go from here?
affine transformation
what happens when we mess with this row?
Projective Transformations aka Homographies aka Planar Perspective Maps
Called a homography
(or planar perspective map)
Homographies
What happens when the denominator is 0?
Points at infinity
Image warping with homographies
image plane in front
image plane below
black area
where no pixel
maps to
Homographies
Homographies
Alternate formulation for homographies
where the length of the vector [h00 h01 … h22] is 1
2D image transformations
These transformations are a nested set of groups
Implementing image warping
f(x,y)
g(x’,y’)
x
x’
T(x,y)
y
y’
Forward Warping
x
x’
T(x,y)
y
y’
f(x,y)
g(x’,y’)
Forward Warping
x
x’
T(x,y)
y
y’
f(x,y)
g(x’,y’)
Inverse Warping
x
x’
T-1(x,y)
y
y’
f(x,y)
g(x’,y’)
Inverse Warping
x
x’
y
y’
f(x,y)
g(x’,y’)
T-1(x,y)
Interpolation
(with prefiltering)
Questions?