# Assignment #3 Homography solved

\$35.00

Category:

## Description

2 Camera Calibration
(a) Vanishing points (b) Checkerboard pattern
Figure 1: (a) You will use the vanishing points in a single image to calibrate your
cameras. (b) You will use multiple images of checkerboard patterns to calibrate your
camera.
You will calibrate your camera (focal length, principal points, and lens distortion parameters).
Write-up:
(1) (Single Image Calibration) Take a single image where you can estimate three vanishing points vX inf, vY inf, and vZ inf as shown in Figure 3(c). Compute f, px, and py
using the vanishing points.
(2) (Multiple Image Calibration) Print out the checkerboard pattern as shown in Figure 1(b) (http://www-users.cs.umn.edu/~hspark/CSci5980/code/pattern.pdf). Derive f, px, and py based on homographies from multiple images (at least 5 images).
Compute the intrinsic parameters by solving the least squares system.
(3) (MATLAB Toolbox Calibration) Use the existing MATLAB Calibration Toolbox
(https://www.vision.caltech.edu/bouguetj/calib_doc/) to compute the intrinsic
parameters (at least 20 images from different views). Verify the estimate with your
solutions in (1) and (2).
2
CSCI 5980: Assignment #3
Homography
3 Rotation Interpolation
(a) Left image (b) Right image
(c) Interpolated View
Figure 2: Using two images of pure rotation (a and b), you will generate interpolated
view by sampling rotation (c)
In HW 2, we generate a panoramic image from multiple images. In this problem, you
will use two images of pure rotation (Figure 2(a) and 2(b)) to generate many views by
interpolating between rotations as shown in Figure 2(c).
Write-up:
(1) Compute the pure rotation, RR
L
from the homography between two images, RHL.
(2) Interpolate between two rotations, {
iRL}
N
i=1, from I3 (Left image) to R (Right
image) where N > 20 is the number of interpolated rotations using SLERP.
(3) Generate interpolated images similar to Figure 2(c).
• Given iRL, compute homography from Left image to the interpolated image, iHL
and warp it, im1 = ImageWarping(imageLeft, iHL).
• Compute homography from Right image to the interpolated image, i.e., iHR =i
HR
LH−1
L
. Warp image, im2 = ImageWarping(imageRight, iHR).
• Composite two images based on distance, imInterpolated = w*im1+(1-w)*im2
where w is weight, inversely proportional to the distance.
3
CSCI 5980: Assignment #3
Homography
(a) Source image (b) Rectified image
u11 u12
u21 u22
v11 v12
v21 v22
p
(c) Vanishing point (d) 3D reconstruction
(e) Tour into picture
Figure 3: (a) Given a single image taken by a cellphone, you will navigate into the
image. (b) You rectify the image such that the Y axis of the camera aligns with the
surface normal of the ground plane. (c) You define the five principal planes using
vanishing points. (d) A 3D box can be texture mapped.
Take an photo with your camera of a scene where you can observe the Z vanishing
point. You will virtually tour into your photo that creates 3D sensation.
Write-up:
(1) Rectification: Rectify your image such that the surface normal of the ground plane
is aligned with the Y axis of your camera using the homography between ground plane
and the camera. Derive and compute the homography for the rectification. Visualize
4
CSCI 5980: Assignment #3
Homography
rectified image similar to Figure 3(b).
(2) Z vanishing point: Given the rectified image, derive and compute the Z vanishing
point, p (Figure 3(c)) using the four edges from the ground and ceiling planes using
linear least squares (the intersection of four lines), i.e., Ax = b.
(3) 3D box generation:
1. Define the four corners (u11, u12, u21, u22) of the purple plane (Figure 3(c)) in
the image.
2. Define the depth of the four corner, e.g., d=1 and compute the 3D locations of
the corners, U = dK−1u.
3. Express the 3D locations of frontal plane, V11, V12, V21, and V22 using d, p, K,
u11, u12, u21, u22, v11, v12, v21, v22.
4. Express a 3D point, X, in the 3D plane (U11, U12, U21, and U22), using two
parameters, e.g., X = a1µ1 + a2µ2 + a3. Apply this for the rest four planes.
(4) Homography mapping:
1. Derive and compute the homography per plane to the rectified image, i.e., sHplane1,
sHplane2,
sHplane3,
sHplane4,
sHplane5.
Hint: λu = KX = K

a1 a2 a3

µ1
µ2
1

 = sHplane

µ1
µ2
1

.
2. Derive and compute the homography per plane to a target image of pure rotation
about Y axis of the camera with 20 degree (tHplane1,
tHplane2,
tHplane3,
tHplane4,
tHplane5). Derive and compute the homography from the rectified image to the
target image. Hint:
tHs =t Hplane
sH−1
plane.
3. Derive and compute the homography per plane to a target image of pure translation along Z axis of the camera with 0.2d. Derive and compute the homography
from the rectified image to the target image.
(4) Generate camera trajectory by interpolating rotation and translation (at least 5
discrete rotation and translation) and generate a video of navigation.
5