18
Projective Geometry Computer Vision National Taiwan University Fall 2018 Assignment 3:

Assignment 3: Projective Geometry

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Assignment 3: Projective Geometry

Projective Geometry

Computer Vision

National Taiwan University

Fall 2018

Assignment 3:

Page 2: Assignment 3: Projective Geometry

Part 1: Estimating Homography

2

Page 3: Assignment 3: Projective Geometry

Recap of Homography

β€’ Matrix form:

β€’ Equations:

3

Page 4: Assignment 3: Projective Geometry

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

Page 5: Assignment 3: Projective Geometry

Enforcing 8 DoF

β€’ Solution 1: set β„Ž33 = 1

β€’ Solution 2: impose unit vector constraint

Subject to

5

Page 6: Assignment 3: Projective Geometry

Solution 1

β€’ Set β„Ž33 = 1

β€’ Multiply by denominator

β€’ Rearrange

6

Page 7: Assignment 3: Projective Geometry

Solution 1 (cont.)

β€’ Solve linear system

7

2𝑁 Γ— 8 8 Γ— 1 2𝑁 Γ— 1

Point 1

Point 2

Point 3

Point 4

Additional points

Page 8: Assignment 3: Projective Geometry

Solution 1 (cont.)

β€’ What might be wrong with solution 1?

β€’ If β„Ž33 is actually 0, we can not get the right answer

8

Page 9: Assignment 3: Projective Geometry

Solution 2

β€’ A more general solution by confining

β€’ Multiply by denominator

β€’ Rearrange

9

Page 10: Assignment 3: Projective Geometry

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

Page 11: Assignment 3: Projective Geometry

Part 2: Unwarp the Screen

11

Make the QR code frontal parallel

Page 12: Assignment 3: Projective Geometry

Backward Warping

β€’ Why?β€’ Prevent holes in output space

β€’ Pixel value at sub-pixel location like (30.21, 22.74)?β€’ Bilinear interpolation

β€’ Nearest neighbor

12

Page 13: Assignment 3: Projective Geometry

Part 3: Unwarp the 3D Illusion

β€’ 3D illusion art

13

Page 14: Assignment 3: Projective Geometry

Part 3: Unwarp the 3D Illusion

β€’ Input:

14

Page 15: Assignment 3: Projective Geometry

Part 3: Unwarp the 3D Illusion

β€’ Ground-truth top view:

15

Can you unwarp the input image to match the ground-truth top view?

Page 16: Assignment 3: Projective Geometry

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

Page 17: Assignment 3: Projective Geometry

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

Page 18: Assignment 3: Projective Geometry

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