Title: Stanford CS223B Computer Vision, Winter 200809 Lecture 9 Structure From Motion
1Stanford CS223B Computer Vision, Winter
2008/09Lecture 9Structure From Motion
- Professor Sebastian Thrun
- CAs Ethan Dreyfuss, Young Min Kim, Alex Teichman
2Summary SFM
- Problem
- Determine feature locations (structure)
- Determine camera extrinsic (motion)
- Two Principal Solutions
- Bundle adjustment (nonlinear least squares, local
minima) - SVD (through orthographic approximation, affine
geometry) - Correspondence
- (RANSAC)
- Expectation Maximization
3Structure From Motion
Recover structure (feature locations), motion
(camera extrinsics)
4Recovery Problems
5Structure From Motion (1)
Tomasi Kanade 92
6Structure From Motion (2)
Tomasi Kanade 92
7Structure From Motion (3)
Tomasi Kanade 92
8Structure From Motion (4a) Images
Marc Pollefeys
9Structure From Motion (4b)
Marc Pollefeys
10Structure From Motion (5)
http//www.cs.unc.edu/Research/urbanscape
11SFM Holy Grail of 3D Reconstruction
- Take movie of object
- Reconstruct 3D model
live.com
12Structure From Motion
- Problem 1
- Given n points pij (xij, yij) in m images
- Reconstruct structure 3-D locations Pj (xj, yj,
zj) - Reconstruct camera positions (extrinsics) Mi(Ai,
bi) - Problem 2
- Establish correspondence c(pij)
13Structure From Motion
Recover structure (feature locations), motion
(camera extrinsics)
14SFM General Formulation
15SFM Bundle Adjustment
16Bundle Adjustment
- SFM Nonlinear Least Squares problem
- Minimize through
- Gradient Descent
- Conjugate Gradient
- Gauss-Newton
- Levenberg Marquardt is common method
- Prone to local minima
17Count Constraints vs Unknowns
- m camera poses
- n points
- 2mn point constraints
- 6m3n unknowns
- Suggests need 2mn ? 6m 3n
- But Can we really recover all parameters???
18How Many Parameters Cant We Recover?
We can recover all but
m camera poses n feature points
Place Your Bet!
19Count Constraints vs Unknowns
- m camera poses
- n points
- 2mn point constraints
- 6m3n unknowns
- Suggests need 2mn ? 6m 3n
- But Can we really recover all parameters???
- Cant recover origin, orientation (6 params)
- Cant recover scale (1 param)
- Thus, we need 2mn ? 6m 3n - 7
20Are we done?
- No, bundle adjustment has many local minima.
21The Trick Of The Day
- Replace Perspective by Orthographic Geometry
- Replace Euclidean Geometry by Affine Geometry
- Solve SFM linearly via PCA (closed form,
globally optimal) - Post-Process to make solution Euclidean
- Post-Process to make solution perspective
- By Tomasi and Kanade, 1992
22Orthographic Camera Model
- Orthographic Limit of Pinhole Model
23Orthographic Projection
Limit of Pinhole Model
Orthographic Projection
24The Orthographic SFM Problem
subject to
25The Affine SFM Problem
subject to
26Count Constraints vs Unknowns
- m camera poses
- n points
- 2mn point constraints
- 8m3n unknowns
- Suggests need 2mn ? 8m 3n
- But Can we really recover all parameters???
27How Many Parameters Cant We Recover?
We can recover all but
Place Your Bet!
28The Answer is (at least) 12
29Points for Solving Affine SFM Problem
- m camera poses
- n points
- Need to have 2mn ? 8m 3n-12
30Where do those additional 5 DOFs come from?
- Anisotropic scaling (2 dim)
- Sheering (3dim)
31Affine SFM
32The Rank Theorem
2m elements
n elements
33Singular Value Decomposition
34Affine Solution to Orthographic SFM
Gives also the optimal affine reconstruction
under noise
35Back To Orthographic Projection
Find C for which constraints are met Search in
9-dim space (instead of 8m 3n-12)
36Back To Projective Geometry
Orthographic (in the limit)
Projective
37Back To Projective Geometry
Optimize
Using orthographic solution as starting point
38The Trick Of The Day
- Replace Perspective by Orthographic Geometry
- Replace Euclidean Geometry by Affine Geometry
- Solve SFM linearly via PCA (closed form,
globally optimal) - Post-Process to make solution Euclidean
- Post-Process to make solution perspective
- By Tomasi and Kanade, 1992
39Structure From Motion
- Problem 1
- Given n points pij (xij, yij) in m images
- Reconstruct structure 3-D locations Pj (xj, yj,
zj) - Reconstruct camera positions (extrinsics) Mi(Ai,
bi) - Problem 2
- Establish correspondence c(pij)
40The Correspondence Problem
View 1
View 3
View 2
41Correspondence Solution 1
- Track features (e.g., optical flow)
- but fails when images taken from widely
different poses
42Correspondence Solution 2
- Start with random solution A, b, P
- Compute soft correspondence p(cA,b,P)
- Plug soft correspondence into SFM
- Reiterate
- See Dellaert/Seitz/Thorpe/Thrun, Machine Learning
Journal, 2003
43Example
44Results Cube
45Animation
46Tomasis Benchmark Problem
47Reconstruction with EM
483-D Structure
49Correspondence Alternative Approach
- Ransac Random sampling and consensus
- Fisher/Bolles
50Summary SFM
- Problem
- Determine feature locations (structure)
- Determine camera extrinsic (motion)
- Two Principal Solutions
- Bundle adjustment (nonlinear least squares, local
minima) - SVD (through orthographic approximation, affine
geometry) - Correspondence
- (RANSAC)
- Expectation Maximization