Description
1 Transformations [25pt]
We have seen that a 3D rotation can be formed as the product of three
matrices
R = Rx(α)Ry(β)Rz(γ),
where
Rx(α) =
1 0 0
0 cos α − sin α
0 sin α cos α
(1)
Ry(β) =
cos β 0 sin β
0 1 0
− sin β 0 cos β
(2)
Rz(γ) =
cos γ − sin γ 0
sin γ cos γ 0
0 0 1
(3)
are rotations around the x, y, and z axis, respectively. This is called the XY-Z Euler angle representation, indicating the order of matrix multiplication
However, representing rotations in this form can lead to ambiguities, since
the result depends on the order in which the transforms are performed. Let
1
p
0 be the point obtained by rotating a point p with a rotation matrix R, so
p
0 = Rp. Give an expression for p
0 obtained by rotating p in the following
two ways:
• First rotate β around y axis, then rotate γ around z axis.
• First rotate γ around z axis, then rotate β around y axis.
[10pt] Show that these rotations produce different values of p
0
.
[15pt] To avoid the representation ambiguity introduced in part a, we can
fix the rotation order. However, even if the order of rotation is fixed, this
rotation system may still result in a degenerate representation. For instance,
let α, β, and γ be three different angles. We can represent an arbitrary
rotation with respect to the X-Y-X axes as the product Rx(α)Ry(β)Rx(γ),
(note that the axes here are X-Y-X, not X-Y-Z). This representation of a
rotation matrix should have three degrees of freedom. However if we set
β = 0, something unusual happens. How many degrees of freedom are left?
Hint: some trigonometric identities may be useful.
2 Panoramic Imaging Theory [15pt]
Assume that we have two cameras with camera matrices M1 and M2
M1 = K1[R1T1] and M2 = K2[R2T2],
where
K1 = K2 = K
R1 = I = Identity matrix
R2 = R
T1 = T2 =
0 0 0T
Suppose that the cameras generate image 1 and 2, respectively, as shown
in the figure below, where p
0
1
, p0
2
, p0
3
, p0
4
and p1, p2, p3, p4 are corresponding
points across the two images.
Prove that the homographic transformation H defined by p
0
1
, p0
2
, p0
3
, p0
4
and
p1, p2, p3, p4 can be expressed as H = KRK−1
.
2
Computing H [30pt]
Write a function Homography that takes a set of at least 4 image point
correspondences between two images (manually selected) and returns an
estimate of the homographic transformation between the images. Use the
DTL algorithm to compute the homography.
What to return in this problem:
• Your code for the function Homography with comments.
• Numerical values for H given the point correspondences in file 4points.txt
(4points.txt file can be read using readPoints.m function).
Convolution [30pt]
In class we discussed Gaussian blurring and convolution. Implement in
MATLAB WITHOUT any built in functions (i.e. conv2, imconv, fspecial,
etc.). The construction of a Gaussian kernel with a variable σ parameter
and the code to apply that kernel to an image through convolution again
WITHOUT using the built in convolution functions. Apply your Gaussian
kernel to one of the images in the midterm folder (garden1,garden2) with 3
σ values and discuss the results.
You must return:
• The source code.
• The visual results (images) after blurring
• Comments about your results.
3