Assignment 3: Projective Geometry
Transcript of Assignment 3: Projective Geometry
Projective Geometry
Computer Vision
National Taiwan University
Fall 2018
Assignment 3:
Part 1: Estimating Homography
2
Recap of Homography
β’ Matrix form:
β’ Equations:
3
Recap of Homography
β’ Degree of freedomβ’ There are 9 numbers in π». Are there 9 DoF?
β’ No. Note that we can multiply all βππ by nonzero π without changing the equations:
4
Enforcing 8 DoF
β’ Solution 1: set β33 = 1
β’ Solution 2: impose unit vector constraint
Subject to
5
Solution 1
β’ Set β33 = 1
β’ Multiply by denominator
β’ Rearrange
6
Solution 1 (cont.)
β’ Solve linear system
7
2π Γ 8 8 Γ 1 2π Γ 1
Point 1
Point 2
Point 3
Point 4
Additional points
Solution 1 (cont.)
β’ What might be wrong with solution 1?
β’ If β33 is actually 0, we can not get the right answer
8
Solution 2
β’ A more general solution by confining
β’ Multiply by denominator
β’ Rearrange
9
Solution 2
β’ Similarly, we have a linear system like this:
β’ Here, b is all zero, so above equation is a homogeneous system
β’ Solve:β’ π΄β = 0
β’ π΄ππ΄β = π΄π0 = 0
β’ SVD of π΄ππ΄ = πΞ£ππ
β’ Let β be the column of π (unit eigenvector) associated with the smallest eigenvalue in Ξ£
10
A h = b2π Γ 9 2π Γ 19 Γ 1
Part 2: Unwarp the Screen
11
Make the QR code frontal parallel
Backward Warping
β’ Why?β’ Prevent holes in output space
β’ Pixel value at sub-pixel location like (30.21, 22.74)?β’ Bilinear interpolation
β’ Nearest neighbor
12
Part 3: Unwarp the 3D Illusion
β’ 3D illusion art
13
Part 3: Unwarp the 3D Illusion
β’ Input:
14
Part 3: Unwarp the 3D Illusion
β’ Ground-truth top view:
15
Can you unwarp the input image to match the ground-truth top view?
Assignment Description
β’ Part 1β’ Implement solution 1 or 2 for estimating homography.β’ Map 5 images of different people to the target surfaces (given in
main.py). You can use whatever images you like. Include these images in your submission.
β’ Include the function solve_homography(u, v) in your report.
β’ Part 2β’ Choose the unwarp region yourself.β’ The output image should contain the detectable QR code.β’ Include the QR code and the decoded link in your report.
β’ Part 3β’ Unwarp the image to the top view.β’ Can you get the parallel bars from the top view?β’ If not, why? Discuss in your report.
16
Bonus (Optional)
β’ Simple ARβ’ Given a short video (~6 sec) and a template
β’ Paste an image (itβs up to you) on the surface to stick to the marker
β’ Include your algorithm in your report
17
Submissionβ’ Code: main.py (Python 3.5+)
β’ Input images for part 1
β’ Output imagesβ’ part1.png, part2.png, part3.png
β’ A PDF report, containingβ’ Your student ID, name
β’ Your answers to each part
β’ (Optional) algorithm to the simple AR
β’ (Optional) Input image and output video of the bonus part
β’ Compress all above files in a zip file named StudentID.zipβ’ e.g. R07654321.zip
β’ Submit to CEIBA
β’ Deadline: 12/4 11:00 pm
18