Frank Dellaert presented an overview of visual SLAM, bundle adjustment, and factor graphs. Visual SLAM uses visual odometry to estimate camera poses incrementally from frame to frame. Bundle adjustment refines the camera pose estimates using non-linear optimization over all camera poses and 3D landmarks jointly. Factor graphs provide a graphical representation of the optimization problem in bundle adjustment.
14. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Large-Scale Structure from Motion
Photo Tourism
[Snavely et al. SIGGRAPH’06]
Build Rome in a Day
[Agarwal et al. ICCV’09]
Photosynth
[Microsoft]
Build Rome on a Cloudless Day
[Frahm et al. ECCV’10]
Iconic Scene Graphs
[Li et al. ECCV’08]
Discrete-Continuous Optim.
[Crandall et al. CVPR’11]
2 / 40
9Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
15. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
3D Models from Community Databases
• E.g., Google image search on “Dubrovnik”
10
16. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
3D Models from Community Databases
Agarwal, Snavely et al., University of Washington
http://grail.cs.washington.edu/rome/
11
5K images, 3.5M points, 10M factors
17. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
3D Models from Community Databases
Agarwal, Snavely et al., University of Washington
http://grail.cs.washington.edu/rome/
11
5K images, 3.5M points, 10M factors
18. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
12
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
19. Bibliography
• Murray,
Li
Sastry,
1994
• Hartley
and
Zisserman,
2004
• Visual
Odometry,
Nister
et
al,
CVPR
2004
• An
Invitation
to
3-‐D
Vision,
Ma,
Soatto,
Kosecka,
Sastry,
2005
• Square
Root
SAM,
Dellaert
Kaess,
IJRR
2006
• Absil,
Mahony
Sepulchre,
2007
• iSAM,
Kaess
Dellaert,
TRO
2008
• iSAM
2,
Kaess
et
al,
IJRR
2011
• Generalized
Subgraph
Preconditioners,
Jian
et
al,
ICCV
2011
• Visibility
Based
Preconditioning,
Kushal
Agarwal,
CVPR
2012
• CVPR
2014
Tutorial
on
Visual
SLAM,
http://frc.ri.cmu.edu/~kaess/vslam_cvpr14/
20. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
14
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
28. • Detect local features in each image
• SIFT gives good results (can also use SURF, Harris, etc.)
Feature Extraction
Lowe ICCV 1999
29. • Match features between left/right images
• Since the images are rectified, we can restrict the search to a
bounding box on the same scan-line
Stereo Matching
Left image Right image
31. • There will be some erroneous stereo and temporal feature
associations à Use 3-point RANSAC
• Select 3 correspondences at random
• Estimate relative transform R,t
• Find the fraction of inliers that agree with this transform
• Repeat for fixed nr. of tries or until fraction80%
• Compute refined model using full inlier set
Relative Pose Estimation/RANSAC
32. • There will be some erroneous stereo and temporal feature
associations à Use 3-point RANSAC
• Select 3 correspondences at random
• Estimate relative transform R,t
• Find the fraction of inliers that agree with this transform
• Repeat for fixed nr. of tries or until fraction80%
• Compute refined model using full inlier set
Relative Pose Estimation/RANSAC
33. • Camera pose can be recovered
given at least three known
landmarks in a non-degenerate
configuration
• In the case of stereo VO,
landmarks can simply be
triangulated
• Two ways to recover pose:
• Absolute orientation
• Reprojection error minimization
Relative Pose Estimation
6 DOF
camera
pose
Known 3D
landmarks
34. • Estimate relative relative transformation between 3D landmarks
which were triangulated from stereo-matched features
• 3-Point algorithm: polynomial equations
Absolute Orientation
Pose r0
Pose r1
Tt
Pose r0
(R,t) ? Tt-1
Tt-1
Tt
35. • Another approach is to estimate relative pose by minimizing
reprojection error of 3D landmarks into images at time t and t-1
• Even better: jointly optimize the landmark positions and the
relative camera pose:
• the measurement function h(.) transforms 3D points into the camera
frame at time t, and then projects into the stereo images
Relative Pose Estimation
Camera poses
Landmarks
Measurements
between
was done
h express
previous
lgorithm
escriptor
ANSAC
ereo and
roducing
remental
ose with
ry in the
be used
stage.
ORY
(instead
think of the SAM problem. Fig. 1 shows an illustration of
a factor graph which is representative of the optimization
problem. The factor graph fully represents the problem to be
solved in a graphical way, where the 6 DOF poses of the left
stereo rig camera are indicated by r, and the tracked SURF
landmarks are denoted as l, where landmarks are represented
as 3D points. The nodes on the vertices connecting the
variables r and l represent the visual image measurements
that were made for each tracked feature point.
We optimize over the entire set of camera poses and
landmarks, R and L respectively, and collect all unknowns
in the vector ⇥ = (R, L). The factor graph then captures a
non-linear least-squares problem
⇥⇤
= argmin
⇥
MX
m=1
khm(rim , ljm ) zmk2
⌃m
(4)
where hm(·) is the measurement function of landmark ljm
from pose rim
, and M is the total number of measurements,
and r 2 R and l 2 L .The measurements are denoted by
zm = (uL, uR, v), where uL and uR are the horizontal
Triangulate
Tt
Tt-1
Reproject
Tt
Tt-1
36. • The presented algorithm works very well in feature-rich, static
environments, but…
• A few tricks for better results in challenging conditions:
• Feature binning to cope with bias due to uneven feature
distributions
• Keyframing to cope with dynamic scenes, as well as reducing
drift of a stationary camera
• Real-time performance
Practical/Robustness Considerations
37. • Incremental pose estimation yields poor results when features
are concentrated in one area of the image
• Solution: Draw a grid and keep k strongest features in each cell
Feature Binning
38. • Dynamic, crowded scenes present a real challenge
• Can’t depend on RANSAC to always recover the correct inliers
• Example 1: Large van “steals” inlier set in passing
Challenges: Dynamic Scenes
Inliers Outliers
39. • Example 2: Cross-traffic while waiting to turn left at light
Only accept incremental
pose if:
• Translation 0.5m
• Dominant direction is
forward
Without keyframing With keyframing
Incorrect
sideways
motion
Challenges: Dynamic Scenes
41. • Representative results on KITTI VO Benchmark
• Average translational/rotational errors are very small
• Accumulate over time, resulting in drift
Results on KITTI Benchmark
42. • Stereo Visual Odometry yields more than just a camera
trajectory!
• Tracked landmarks form a sparse 3D point cloud of the
environment
• Can be used as the basis for localization
What else do you get?
43. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
34
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
44. Motivation
• VO:
just
two
frames
-‐
R,t
using
5-‐pt
or
3-‐pt
• Can
we
do
better?
Bundle
Adjustment
-‐
VSLAM
• Later:
integrate
IMU,
other
sensors
53. Taylor
Expansion
Epic
Fail
• Taylor
expansion?
• Oops:
?
• T
is
a
4x4
matrix,
but
is
over-‐parameterized!
• T
in
SE(3):
only
6DOF
(3
rotation,
3
translation)
54. Tangent
Spaces
• An
incremental
change
on
a
manifold
can
be
introduced
via
the
notion
of
an
n-‐dimensional
tangent
space
at
a
•
Sphere
SO(2)
a
a==0
56. SE(3):
A
Twist
of
Li(m)e
• Lie
group
=
group
+
manifold
– SE(3)
is
group!
– SE(3)
is
6DOF
manifold
embedded
in
R4*4
• For
Lie
groups,
we
have
exponential
maps:
• se2
twist:
63. Too
much
Freedom!
• A’A
will
be
singular!
7DOF
gauge
freedom
– Switch
to
5DOF
Essential
Manifold
– Use
photogrammetry
“inner
constraints”
– Add
prior
terms
– Fuse
in
other
sensors,
e.g.,
IMU/GPS
SE(3)
x
SE(3) E
64. • Idea:
Add
a
damping
factor
• What
is
the
effect
of
this
damping
factor?
– Small
?
– Large
?
Levenberg-‐Marquardt
Algorithm
Slide
by
Dr.
Jürgen
Sturm,
Computer
Vision
Group,
TUM
65. Levenberg-‐Marquardt
Algorithm
• Idea:
Add
a
damping
factor
• What
is
the
effect
of
this
damping
factor?
– Small
à same
as
least
squares
– Large
à steepest
descent
(with
small
step
size)
• Algorithm
– If
error
decreases,
accept
and
reduce
– If
error
increases,
reject
and
increase
Slide
by
Dr.
Jürgen
Sturm,
Computer
Vision
Group,
TUM
71. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
59
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
72. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Structure from Motion (Chicago, movie by Yong Dian Jian)
60
73. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Structure from Motion (Chicago, movie by Yong Dian Jian)
60
74. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Boolean Satisfiability
61
75. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Boolean Satisfiability
M I
A H G
¬M ∨ I
M ∨ ¬I
M ∨ A
¬I ∨ H
¬A ∨ H ¬H ∨ G
61
76. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Boolean Satisfiability
M I
A H G
¬M ∨ I
M ∨ ¬I
M ∨ A
¬I ∨ H
¬A ∨ H ¬H ∨ G
Variables
61
77. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Boolean Satisfiability
M I
A H G
¬M ∨ I
M ∨ ¬I
M ∨ A
¬I ∨ H
¬A ∨ H ¬H ∨ G
Variables
Factors
61
78. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Boolean Satisfiability
M I
A H G
¬M ∨ I
M ∨ ¬I
M ∨ A
¬I ∨ H
¬A ∨ H ¬H ∨ G
Variables
Factors
Factor Graph
61
79. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Constraint Satisfaction
62
80. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Constraint Satisfaction
63
S
V
Y
NL
BC
N
NB
O
NT
M
Q
81. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Constraint Satisfaction
63
S
V
Y
NL
BC
N
NB
O
NT
M
Q
82. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Graphical Models
64
P( |Z) as the product of the prior P( ) and the likelihood factors L( k;zk),
P( |Z) P( )
k
L( k;zk) = f0( 0)
k
fk( k)
where the factor f0 corresponding to the prior P( ) typically factors as well, depe
T
S
L
BE
X
Figure 4.3: Factor graph for examples in Figure 4.2.
g about how a given measurement z depends on the parameters . Importantly,
joint density P( ,Z) into a product of simple factors. This is typically done by
sities of the form P(z| ), indicating that given the values for a subset ⊂ of
ement z is conditionally independent of all other parameters.
A
D
T
S
L
BE
X
or example in Figure 4.1. The observed variables are shown as square nodes.
83. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Polynomial Equations
65
Multi-camera pose estimation (Gim Hee Lee, ETH)
84. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Polynomial Equations
66
𝛾2
𝛾3
𝛾1
Multi-camera pose estimation (Gim Hee Lee, ETH)
85. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 67
Continuous Probability Densities
x0 x1 x2 xM...
lNl1 l2
...
...
P(X,M) = k*
- E.g., Robot Trajectory
- Landmarks
- Measurements
86. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 68
Simultaneous Localization and Mapping (SLAM)
87. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 68
Simultaneous Localization and Mapping (SLAM)
88. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 69
Factor Graph - Smoothing and Mapping (SAM) !
89. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 69
Factor Graph - Smoothing and Mapping (SAM) !
Variables are multivariate! Factors are non-linear!
90. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 69
Factor Graph - Smoothing and Mapping (SAM) !
Variables are multivariate! Factors are non-linear!
Factors induce
probability densities.
-log P(x) = |E(x)|2
91. Full
Bundle
Adjustment
• Extend
2-‐frame
case
to
multiple
cameras:
• Factor
graph
representation:
92. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Structure from Motion (Chicago, movie by Yong Dian Jian)
71
93. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Structure from Motion (Chicago, movie by Yong Dian Jian)
71
97. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 73
Gaussian Factor Graph == mxn Matrix
A
Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
99. Frank Dellaert
Solving the Linear Least-Squares System
74
ATA
A
Measurement
Jacobian
Information
matrix
Normal
equations
Solve:
100. Frank Dellaert
Solving the Linear Least-Squares System
•Can
we
simply
invert
ATA
to
solve
for
x?
75
ATA
Information
matrix
Normal
equations
101. Frank Dellaert
Solving the Linear Least-Squares System
•Can
we
simply
invert
ATA
to
solve
for
x?
•Yes,
but
we
shouldn’t…
The
inverse
of
ATA
is
dense
-‐
O(n^3)
•Can
do
much
better
by
taking
advantage
of
sparsity!
75
ATA
Information
matrix
Normal
equations
102. Frank Dellaert
Solving the Linear Least-Squares System
76
ATA
Information
matrix
Normal
equations
Solve:
A
Measurement
Jacobian
103. Frank Dellaert
Solving the Linear Least-Squares System
76
R
ATA
Information
matrix
Square
root
information
matrix
Normal
equations
Matrix
factorization
Solve:
A
Measurement
Jacobian
104. Frank Dellaert
Matrix – Square Root Factorization
77
• QR
on
A:
Numerically
More
Stable
• Cholesky
on
ATA:
Faster
A QR R
Cholesky RATA
106. Frank Dellaert
Solving by Backsubstitution
After
factorization
(via
Cholesky):
RTR
x
=
ATb
•Forward
substitution
RTy
=
ATb,
solve
for
y
78
RT
107. Frank Dellaert
Solving by Backsubstitution
After
factorization
(via
Cholesky):
RTR
x
=
ATb
•Forward
substitution
RTy
=
ATb,
solve
for
y
•Backsubstition
R
x
=
y,
solve
for
x
78
RT
R
108. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Intel Dataset
79
910 poses, 4453 constraints, 45s or 49ms/step
(Olson, RSS 07: iterative equation solver, same ballpark)
109. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
MIT Killian Court Dataset
80
1941 poses, 2190 constraints, 14.2s or 7.3ms/step
110. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• OnVesta and Ceres
81
111. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• OnVesta and Ceres
81
112. Frank Dellaert: Inference in Factor Graphs,Tutorial at ICRA 2013
“Gaussian” Elimination?
82
The Nine Chapters on the
Mathematical Art, 200 B.C.
113. Frank Dellaert: Inference in Factor Graphs,Tutorial at ICRA 2013
“Gaussian” Elimination?
82
The Nine Chapters on the
Mathematical Art, 200 B.C.
Gauss re-invented elimination for
determining the orbit of Ceres
114. Frank Dellaert: Inference in Factor Graphs,Tutorial at ICRA 2013
“Gaussian” Elimination?
82
The Nine Chapters on the
Mathematical Art, 200 B.C.
Gauss re-invented elimination for
determining the orbit of Ceres
115. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 83
Variable Elimination
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3
l1 l2
l1 l2 x1 x2 x3
x
x x
x x
x
x x
x
x
x x
x x
116. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 83
Variable Elimination
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3
l1 l2
Basis = Chain Rule ! e.g. P(l1,x1,x2)=P(l1|x1,x2)P(x1,x2)
P(l1,x1,x2)
l1 l2 x1 x2 x3
x
x x
x x
x
x x
x
x
x x
x x
117. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3
l1 l2l1
Small Example
84
P(l1|x1,x2)
P(x1,x2)
Basis = Chain Rule ! e.g. P(l1,x1,x2)=P(l1|x1,x2)P(x1,x2)
l1 l2 x1 x2 x3
x x x
x
x x
x x
x
x
x x
x x
118. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3
l1 l2l2
Small Example
85
l1 l2 x1 x2 x3
x x x
x x
x x
x
x
x x
x x
x
119. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3x1
l1 l2
Small Example
86
l1 l2 x1 x2 x3
x x x
x x
x x
x
x x
x
120. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3x2
l1 l2
Small Example
87
l1 l2 x1 x2 x3
x x x
x x
x x
x x
x
x
121. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
• Choose Ordering
• Eliminate one node at a time
• Express node as function of adjacent nodes
x1 x2 x3x3
l1 l2
Small Example
88
l1 l2 x1 x2 x3
x x x
x x
x x
x x
x
122. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
x1 x2 x3x3
l1 l2
Small Example
89
• End-Result = Bayes Net ! l1 l2 x1 x2 x3
x x x
x x
x x
x x
x
123. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Polynomial Equations
90
Gim Hee Lee’s thesis: multi-camera pose estimation
𝛾2
𝛾3
𝛾1
124. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Polynomial Equations
91
𝛾2
𝛾3
𝛾1 𝛾1
𝛾2
𝛾3
𝛾1
𝛾2
𝛾3
Three degree 2 polynomials, each in only 2 variables
Degree 8 polynomial
Degree 4 polynomial
125. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Elimination at work
92
126. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Elimination at work
92
127. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Elimination at work
93
128. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Elimination at work
93
129. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 94
Elimination order is again CRUCIAL
• Order with least fill-in
NP-complete to find
Square Root SAM: Simultaneous Location and Mapping via Square Root Information Smoothing, Frank Dellaert,
Robotics: Science and Systems, 2005
Exploiting Locality by Nested Dissection For Square Root Smoothing and Mapping, Peter Krauthausen, Frank
Dellaert, and Alexander Kipp, Robotics: Science and Systems, 2006
130. Frank Dellaert: Inference in Factor Graphs,Tutorial at ICRA 2013 95
Remember: Larger Example Factor Graph
131. Frank Dellaert: Inference in Factor Graphs,Tutorial at ICRA 2013 96
Eliminate Poses then Landmarks
R
138. The importance of
being Ordered
500 Landmarks, 1000 steps, many loops
Bottom line: even a tiny amount of domain knowledge helps.
139. The importance of
being Ordered
500 Landmarks, 1000 steps, many loops
Bottom line: even a tiny amount of domain knowledge helps.
Bottom line 2: this is EXACT !!!
140. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Approximate Minimum Degree
100
141. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Approximate Minimum Degree
100
142. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Divide and Conquer
101
143. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Divide and Conquer
101
144. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 102
St. Peter’s Basilica, Rome
Data Courtesy Microsoft Research
Kai Ni, Drew Steedly, and Frank Dellaert, Out-of-Core Bundle Adjustment for Large-Scale
3D Reconstruction, IEEE International Conference on Computer Vision (ICCV), 2007.
145. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping 102
St. Peter’s Basilica, Rome
Data Courtesy Microsoft Research
Kai Ni, Drew Steedly, and Frank Dellaert, Out-of-Core Bundle Adjustment for Large-Scale
3D Reconstruction, IEEE International Conference on Computer Vision (ICCV), 2007.
146. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Nested Dissection (but good separators are hard)
103
147. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Nested Dissection (but good separators are hard)
103
148. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Nested-Dissection for SFM: Hyper-SFM
104
Kai Ni, and Frank Dellaert, HyperSfM, IEEE International Conference on 3D Imaging,
Modeling, Processing, Visualization and Transmission (3DIMPVT), 2012.
149. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
105
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
150. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=0)
Robot Onboard
sensors:
– Wheel
odometry
– Inertial
measurement
unit
(gyro,
accelerometer)
– Sonar
– Laser
range
finder
– Camera
– RGB-‐D
sensors
151. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=0)
Robot
Landmark
Landmark
Measurement
Onboard
sensors:
– Wheel
odometry
– Inertial
measurement
unit
(gyro,
accelerometer)
– Sonar
– Laser
range
finder
– Camera
– RGB-‐D
sensors
152. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=1)
Robot
Landmark
1
Odometry
measurement
Landmark
measurement
153. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=1)
Robot
Landmark
1 Landmark
2
Odometry
measurement
Landmark
measurement
154. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=n-‐1)
Robot
Landmark
1 Landmark
2
Odometry
measurement
Landmark
measurement
155. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=n)
Odometry
measurement
Landmark
measurement
156. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
The
Mapping
Problem
(t=n)
Odometry
measurement
Landmark
measurement
Mapping
problem
is
incremental
!
157. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Factor
Graph
Representation
Robot
pose
Landmark
position
Landmark
measurement
Odometry
measurement
158. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Factor
Graph
Representation
Pose
Point
Point
measurement
159. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Full
Bundle
Adjustment
•Graph
grows
with
time:
– Have
to
solve
a
sequence
of
increasingly
larger
BA
problems
– Will
become
too
expensive
even
for
sparse
Cholesky
F.
Dellaert
and
M.
Kaess,
“Square
Root
SAM:
Simultaneous
localization
and
mapping
via
square
root
information
smoothing,”
IJRR
2006
160. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Full
Bundle
Adjustment
•Graph
grows
with
time:
– Have
to
solve
a
sequence
of
increasingly
larger
BA
problems
– Will
become
too
expensive
even
for
sparse
Cholesky
F.
Dellaert
and
M.
Kaess,
“Square
Root
SAM:
Simultaneous
localization
and
mapping
via
square
root
information
smoothing,”
IJRR
2006
From
Strasdat
et
al,
2011
IVC
“Visual
SLAM:
Why
filter?”
161. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Keyframe
Bundle
Adjustment
•Drop
subset
of
poses
to
reduce
density/complexity
•Only
retain
“keyframes”
necessary
for
good
map
•Complexity
still
grows
with
time,
just
slower
162. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Filter
•Marginalize
out
previous
poses
– Extended
Kalman
Filter
(EKF)
•Problems
when
used
for
Visual
SLAM:
163. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Filter
•Marginalize
out
previous
poses
– Extended
Kalman
Filter
(EKF)
•Problems
when
used
for
Visual
SLAM:
– All
points
become
fully
connected
-‐
expensive
– Relinearization
not
possible
-‐
inconsistent
164. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Incremental
Solver
•Back
to
full
BA
and
keyframes:
•New
information
is
added
to
the
graph
•Older
information
does
not
change
•Can
be
exploited
to
obtain
an
efficient
solution!
165. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Incremental
Smoothing
and
Mapping
(iSAM)
Solving
a
growing
system:
– R
factor
from
previous
step
– How
do
we
add
new
measurements?
R
[Kaess
et
al.,
TRO
08]
166. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Incremental
Smoothing
and
Mapping
(iSAM)
Solving
a
growing
system:
– R
factor
from
previous
step
– How
do
we
add
new
measurements?
Key
idea:
– Append
to
existing
matrix
factorization
R
New
measurements
-‐
[Kaess
et
al.,
TRO
08]
167. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Incremental
Smoothing
and
Mapping
(iSAM)
Solving
a
growing
system:
– R
factor
from
previous
step
– How
do
we
add
new
measurements?
Key
idea:
– Append
to
existing
matrix
factorization
– “Repair”
using
Givens
rotations
R
New
measurements
-‐
[Kaess
et
al.,
TRO
08]
168. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Incremental
Smoothing
and
Mapping
(iSAM)
Solving
a
growing
system:
– R
factor
from
previous
step
– How
do
we
add
new
measurements?
Key
idea:
– Append
to
existing
matrix
factorization
– “Repair”
using
Givens
rotations
R
R’
New
measurements
-‐
[Kaess
et
al.,
TRO
08]
169. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Update
and
solution
are
O(1)
[Kaess
et
al.,
TRO
08]
Incremental
Smoothing
and
Mapping
(iSAM)
170. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Update
and
solution
are
O(1)
[Kaess
et
al.,
TRO
08]
Incremental
Smoothing
and
Mapping
(iSAM)
171. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Update
and
solution
are
O(1)
Are
we
done?
BA
is
nonlinear…
iSAM
requires
periodic
batch
factorization
to
relinearize
Not
O(1),
we
need
iSAM2!
[Kaess
et
al.,
TRO
08]
Incremental
Smoothing
and
Mapping
(iSAM)
172. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Update
and
solution
are
O(1)
Are
we
done?
BA
is
nonlinear…
iSAM
requires
periodic
batch
factorization
to
relinearize
Not
O(1),
we
need
iSAM2!
[Kaess
et
al.,
TRO
08]
Incremental
Smoothing
and
Mapping
(iSAM)
173. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Fixed-‐lag
Smoothing
•Marginalize
out
all
but
last
n
poses
and
connected
landmarks
– Relinearization
possible
plus
some
fill-‐in
174. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Fixed-‐lag
Smoothing
•Marginalize
out
all
but
last
n
poses
and
connected
landmarks
– Relinearization
possible
•Linear
case
Fixed
lag
Cut
here
to
marginalize
plus
some
fill-‐in
175. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Fixed-‐lag
Smoothing
•Marginalize
out
all
but
last
n
poses
and
connected
landmarks
– Relinearization
possible
•Linear
case
•Nonlinear:
need
iSAM2
Fixed
lag
Cut
here
to
marginalize
plus
some
fill-‐in
176. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Matrix
vs.
Graph
Measurement
Jacobian
Factor
Graph
x0 x1 x2 xM...
lNl1 l2
...
...
A
177. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Matrix
vs.
Graph
Measurement
Jacobian
Factor
Graph
Information
Matrix
Markov
Random
Field
x0 x1 x2 xM...
lNl1 l2
...
...
x0 x1 x2 xM...
lNl1 l2
...
...
A
ATA
178. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
Matrix
vs.
Graph
Measurement
Jacobian
Factor
Graph
Information
Matrix
Markov
Random
Field
Square
Root
Inf.
Matrix
x0 x1 x2 xM...
lNl1 l2
...
...
x0 x1 x2 xM...
lNl1 l2
...
...
R
A
ATA
?
179. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
1
[Kaess
et
al.,
IJRR
12]
180. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
2:
Find
cliques
in
reverse
elimination
order:
Step
1
[Kaess
et
al.,
IJRR
12]
181. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
2:
Find
cliques
in
reverse
elimination
order:
Step
1
[Kaess
et
al.,
IJRR
12]
182. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
2:
Find
cliques
in
reverse
elimination
order:
Step
1
[Kaess
et
al.,
IJRR
12]
183. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
2:
Find
cliques
in
reverse
elimination
order:
Step
1
[Kaess
et
al.,
IJRR
12]
184. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
2:
Find
cliques
in
reverse
elimination
order:
Step
1
[Kaess
et
al.,
IJRR
12]
185. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Data
Structure
Step
2:
Find
cliques
in
reverse
elimination
order:
Step
1
[Kaess
et
al.,
IJRR
12]
186. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Example
Manhattan
dataset
(Olson)
[Kaess
et
al.,
IJRR
12]
187. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
Example
How
to
update
with
new
measurements
/
add
variables?
Manhattan
dataset
(Olson)
[Kaess
et
al.,
IJRR
12]
188. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Updating
the
Bayes
Tree
Add
new
factor
between
x1
and
x3
[Kaess
et
al.,
IJRR
12]
189. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Updating
the
Bayes
Tree
Add
new
factor
between
x1
and
x3
[Kaess
et
al.,
IJRR
12]
190. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Updating
the
Bayes
Tree
Add
new
factor
between
x1
and
x3
[Kaess
et
al.,
IJRR
12]
191. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Updating
the
Bayes
Tree
Add
new
factor
between
x1
and
x3
[Kaess
et
al.,
IJRR
12]
192. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
for
Manhattan
Sequence
[Kaess
et
al.,
IJRR
12]
193. Michael
Kaess‹#› CVPR14:
Visual
SLAM
Tutorial
iSAM2:
Bayes
Tree
for
Manhattan
Sequence
[Kaess
et
al.,
IJRR
12]
194. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
126
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
195. Primary
Structure
• Insight:
and
are
block-‐diagonal
(because
each
constraint
depends
only
on
one
camera
and
one
point)
• This
can
be
solved
using
the
Schur
Complement
127
…
…
Slide
by
Dr.
Jürgen
Sturm,
Computer
Vision
Group,
TUM
196. Schur
Complement
• Given:
Linear
system
• If
D
is
invertible,
then
(using
Gauss
elimination)
• Reduced
complexity?
• A:
not
in
theory!
But
cache-‐friendly,
repeatable
Slide
by
Dr.
Jürgen
Sturm,
Computer
Vision
Group,
TUM
197. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Of Eiffel Towers....
129
198. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Of Eiffel Towers....
129
199. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Iterative Methods
Better than direct methods for large problems because they
Perform only simple operations and no variable elimination
Require constant (linear) memory
But they may converge slowly
when the problem is ill-conditioned
The conjugate gradient method: The convergence speed is related to
the condition number (AtA) = max / min
13 / 40130Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
200. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Main Idea (with Viorela Ila and Doru Balcan)
0 0.5 1 1.5 2 2.5
x 10
4
0
0.5
1
1.5
2
2.5
x 10
4
nz = 3151
0 0.5 1 1.5 2 2.5
x 10
4
0
0.5
1
1.5
2
2.5
x 10
4
nz = 28624
0 0.5 1 1.5 2 2.5
x 10
4
0
0.5
1
1.5
2
2.5
x 10
4
nz = 25473
The whole problem The easy part
(subgraph)
The hard part
(loop closures)
DirectM
ethod
Iterative
M
ethod
= +
131
201. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Linear Reparametrization is Preconditioning
The preconditioned conjugate gradient (PCG) method will converge
faster if the new problem becomes well-conditioned
18 / 40132Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
202. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Original, max
133
203. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Original, max
133
204. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Preconditioner
134
205. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Preconditioner
134
206. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Preconditioned, max
135
207. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Preconditioned, max
135
208. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Illustration with Real Data
Reconstruction results of a street scene dataset [Agarwal et al. ECCV’10]
Solution to a sparse subgraph
An approximated solution
E cient to compute
Solution to the entire graph
The optimal solution
Expensive to compute directly
Use the subgraph solution to reparametrize the original problem
21 / 40136Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Yong-Dian Jian, Doru C. Balcan and Frank Dellaert
Generalized Subgraph Preconditioners for Large-Scale Bundle Adjustment
Proceedings of 13th International Conference on Computer Vision (ICCV), Barcelona, 2011
209. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Solution from Subgraph Solution from the Original Graph
Data from Noah Snavely
Notre Dame
137
210. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Solution from Subgraph Solution from the Original Graph
Data from Sameer Agarwal
Piazza San Marco
138
211. Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
Results (3)
The condition numbers of the preconditioned systems
source Original SPCG Jacobi GSP-3
D-15 5.58e+21 1.87e+06 5.94e+04 4.36e+03
V-02 6.54e+21 6.46e+09 6.35e+05 1.38e+05
F-01 3.68e+11 1.92e+08 7.54e+06 8.71e+05
The original condition numbers are very large
GSP-3 has consistently smaller condition numbers
39 / 40139Frank Dellaert: Optimization in Factor Graphs for Fast and Scalable 3D Reconstruction and Mapping
212. Frank Dellaert
State of the art = Schur Complement + Iterative
• Condition number of reduced camera matrix is
already much lower
• Cluster based on co-visibility of features
• Pre-conditioner = tree of clusters
• Visibility Based Preconditioning, Kushal Agarwal,
CVPR 2012, Experimental in Ceres
140
213. Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
Outline
141
Intro
Visual
SLAM
Bundle
Adjustment
Factor
Graphs
Incremental
Large-‐Scale
End
214. Three
Questions
• What
is
an
exponential
map?
• What
is
a
good
elimination
order
for
BA?
• Which
system
has
a
high
condition
number?
215. SFM/BA
Packages
• SBA:
pioneer
• Google
Ceres:
great
at
large-‐scale
BA
• GTSAM
(Georgia
Tech
Smoothing
and
Mapping)
– Has
iSAM,
iSAM2
(later),
ideal
for
sensor
fusion
– Factor-‐graph
based
throughout:
216. Lago Linear
Approximation
for
Graph
Optimization
Smart
FactorsMulti-‐threading
NEW
RELEASE:
GTSAM
3.1
Georgia
Tech
Smoothing
And
Mapping
Download:
collab.cc.gatech.edu/borg/gtsam
Includes
numerous
performance
improvements
and
features:
• Multi-‐threading
with
TBB
(funded
by
DARPA)
• Smart
Projection
Factors
for
SfM
• LAGO
Initialization
for
planar
SLAM
(Luca
Carlone
et.
al)