04 Multi-View Geometry
04 Multi-View Geometry
Multi-View Geometry
Shenlong Wang
UIUC
Some materials borrowed from Matthew O’Toole, Kris Kitani, Jianxiong Xiao, Derek Hoeim, Sanja Fidler 1
Logistics
● Camera Calibration
● Structure from Motion
● Other Cameras
3
Big picture: 3 key components in 3D
3D Points
(Structure)
Camera
Correspondences
(Motion)
Angjoo Kanazawa
Camera Calibration
How do I know K?
3D object
Image Plane
Camera Center
intrinsic extrinsic
parameters parameters
5
Camera Calibration
● Inputs : A collection of images with points whose 2D image coordinates and 3D world
coordinates are known.
● Outputs: The 3×3 camera intrinsic matrix, the rotation and translation of each image.
6
Image credit: OpenCV
Camera Calibration
● Minimizing the reprojection error
7
Camera Calibration
https://www.mathworks.com/help/vision/camera-calibration.html
https://github.com/ethz-asl/kalibr
8
https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html
Structure-from-Motion
10
Image credit: Jianxiong Xiao
Structure-from-Motion
11
Two View Reconstruction
Bundle
Match
Adjustment
12
Keypoints Detection
● Step 1: Detect distinctive keypoints that are suitable for matching
13
Descriptor for each point
● Step 2: Compute visual descriptors (SIFT features)
SIFT
SIFT
14
Descriptor for each point
● Step 3: Measure pairwise distance / similarity between features
SIFT SIFT
SIFT SIFT
15
Match Points
● Step 3: Measure pairwise distance / similarity between features
SIFT SIFT
SIFT SIFT
16
Match Points
SIFT (scale-invariant feature transform)
● Step 1: Detect distinctive keypoints that are suitable for matching
● Step 2: Compute oriented histogram gradient features
● Step 3: Measure distance between each pair
17
Match Points
● How many pair-wise matching I need to conduct?
SIFT SIFT
SIFT SIFT
18
Match Points
● What if there are bad matches?
SIFT SIFT
SIFT SIFT
19
Match Points in Practice
20
Camera Calibration
● Inputs : A collection of images with points whose 2D image coordinates and 3D world
coordinates are known.
● Outputs: The 3×3 camera intrinsic matrix, the rotation and translation of each image.
21
Image credit: OpenCV
Camera Calibration
● Minimizing the reprojection error
22
Two View Reconstruction
Bundle
Match
Adjustment
23
Fundamental Matrix
24
Eight-Point Algorithm
• Given a correspondence
• Assume
• We can get
25
Eight-Point Algorithm
• Given 8 correspondences
• Nontrivial solution
• f is in null space of A
SVD!
26
Eight-Point Algorithm
● Rank constraint
subject to
27
Rank Constraint
Before After 28
RANSAC Estimation
● For many times
○ Pick 8 points
29
30
Essential Matrix
31
Essential Matrix Decomposition
● Essential matrix E to R and t
33
Image credit: Noah Snavely
Multi-view Triangulation
Are we guaranteed to
converge?
34
Multi-view Triangulation
35
Bundle Adjustment
36
Bundle Adjustment
37
Continuous Optimization
MAP inference: find the best configuration that minimize the energy
39
MAP Inference: Newton Method
● For twice-differentiable energy function, one could use Newton’s method:
40
MAP Inference: Newton Method
● For twice-differentiable energy function, one could use Newton’s method:
● Pros: capturing curvature, better convergence, less likely stuck, less tuning
● Cons: expensive to compute inverse Hessian, hard to scale
41
MAP Inference: Gauss-Newton
● If the energy has a sum of square form:
42
How to get the solution? Today’s Quiz
Multi-View Stereo
● Input: images from several viewpoints
with known camera poses and calibration
44
Measuring the matching cost
45
Measuring the matching cost
46
Colmap: Photometric + Geometric Cost + View Select
● Photometric consistency: normalized cross correlation
47
Pixelwise View Selection for Unstructured Multi-View Stereo, 2016
MVSNet
48
MVSNet: Depth Inference for Unstructured Multi-view Stereo, 2018
3D Reconstruction: SFM + MVS
49
Image credit: Google, Michael Keass
Visual SLAM: Online SFM
50
Image credit: Yang et al. ICRA 2021
Camera Distortion
51
Image credit: OpenCV
Camera Distortion
● Remember to cv2.undistort the image if you want to reason in 3D.
52
Image credit: OpenCV
Event Cameras
53
Image credit: Davide Scaramuzza
Fisheye Camera / Omnidirectional Camera
54
Image credit: OZ robotics
What I Didn’t Cover
● Stereo Rectification
Making two stereo camera frontal parallel.
● Five-Point Algorithms
Recover Essential/Fundamental Matrix from 2D-2D Correspondences
● Essential Decomposition
Recover R and t from essential matrix estimation
● Perspective-n-Projection (PnP)
Recover R and t from 2D-3D correspondences
55
Check Szeliski or MVG Book if you want to know these concepts