Kalman Filter Tutorial - Presentation
Kalman Filter Tutorial - Presentation
An Introduction to the
Kalman Filter
Speakers
Greg Welch
Gary Bishop
Kalman Filters in 2 hours?
• Hah!
• No magic.
• Pretty simple to apply.
• Tolerant of abuse.
• Notes are a standalone reference.
• These slides are online at
http://www.cs.unc.edu/~tracker/ref/s2001/kalman/
Rudolf Emil Kalman
• Tracking missiles
• Tracking heads/hands/drumsticks
• Extracting lip motion from video
• Fitting Bezier patches to point data
• Lots of computer vision applications
• Economics
• Navigation
A really simple example
Gary makes a measurement
xˆ1 = z1 N(z1,σ z2 )
1
σˆ = σ
2
1
2
z1 -2 0 2 4 6 8 10 12 14
Greg makes a measurement
xˆ2 = ...?
N(z1,σ z2 )
1
σˆ = ...?
2
2 -2 0 2 4 6 8 10 12 14
Combine estimates
Combine variances
Combined Estimates
ˆ σˆ 2)
N( x,
xˆ = xˆ2
σˆ = σ 2
2 2
-2 0 2 4 6 8 10 12 14
-2 0 2 4 6 8 10 12 14
KF operates by
• Predicting the new state and its uncertainty
• Correcting with the new measurement
predict correct
Example: 2D Position-Only
(Greg Welch)
Apparatus: 2D Tablet
Process Model
xk 1 0xk −1 ~ xk −1
= +
yk 0 1 yk −1 ~ yk −1
state
xk
state A xstate
transition k−1 w
noise
k−1
xk = Axk −1 + wk −1
Measurement Model
uk H x 0 xk ~ uk
= +
vk 0 H y yk ~ vk
measurement
zk
measurement H
matrix xk
state vk
noise
z k = Hxk + vk
Preparation
1 0
A = State Transition
0 1
Q 0 Process
Q = E{w ∗ w } = Noise
xx
T
Covariance
0 Qyy
Rxx 0 Measurement
R = E{v ∗ v } =
T
Noise
Covariance
0 Ryy
Initialization
x0 = Hz0
ε 0
P0 =
0 ε
PREDICT
−
x = Axk −1
k
−
P = APk −1 A + Q
k
T
transition
uncertainty
CORRECT
xk = x + K ( zk − Hx
−
k
−
k )
Pk = ( I − KH ) P
actual
k
−
predicted
K = P H ( HP H + R)
− T − T −1
k k
“denominator”
(measurement space)
Summary
K = P H ( HP H + R)
− T − T −1
−
x = Axk −1
k
k k
−
P = APk −1 A + Q
T xk = xk− + K ( zk − Hxk− )
Pk = ( I − KH ) Pk−
k
Results: XY Track
0.9
0.8
0.7
y [meters]
0.6
0.5
Truth
Estimate
0.4
0.3
x [meters]
Y Track: Moving then Still
0.9
0.8
y [meters]
0.7
0.6
0.5
Truth
0.4
Estimate
0.3
0.2
0 5 10 15 20 25 30
Time [seconds]
Motion-Dependent Performance
0.292
0.72
Truth 0.291
0.715
Estimate 0.29
0.71 Measurement
0.289
0.705
0.288
0.7
0.287
0.695 0.286
0.69 0.285
0.284
0.685
6.8 7 7.2 7.4 7.6 7.8 8 8.2 8.4 8.6 21.8 22 22.2 22.4 22.6 22.8 23 23.2
significant 0.9
1
…relatively
latency when 0.8
0.7 smooth
moving… when not
0.6
0.5
0.4
0.3
0.2
0 5 10 15 20 25 30
Example: 2D Position-Velocity
(PV Model)
Process Model (PV)
0.705
0.288
0.7
0.287
0.695
0.286
0.69
0.285
0.685
0.284
6.8 7 7.2 7.4 7.6 7.8 8 8.2 8.4 8.6 21.8 22 22.2 22.4 22.6 22.8 23 23.2
improved 1
0.9
…relatively
latency when 0.8
0.7 noisy
moving… when not
0.6
0.5
0.4
0.3
0.2
0 5 10 15 20 25 30
Example: 6D HiBall Tracker
Ceiling panel
with LEDs
State Vector (PV)
x = [τ ρ λ]
dρ T
dτ
dt dt
τ= translation (3D)
ρ= rotation (3D)
dτ = linear velocity (3D)
dt
dt =
dρ
angular velocity (3D)
λ= LED position (3D)
Non-Linear Measurement Model
cx
c y = V ⋅ rotate ( ρ ) ⋅ ( λ − τ )
cz view matrix
u cx cz
=
v cy cz
SCAAT vs. MCAAT
• Single or Multiple Constraint(s) at a Time
• Dimension of the measurement
• Nothing about KF mathematics restricts it
• Can process in “batch” or sequential mode
• SCAAT
• Estimate 15 parameters with 2D measurements
• Temporal improvements
• Autocalibration of LED positions
HiBall Initialization
(Gary Bishop)
Kalman Filter assumes linearity
0
Example: 2D PV Model
-
"Clean" and True State
realistic
state data
Estimated
State
Measurement
“True”
measurement
+ Kalman filter
Noise
model data
Multiple-Model Configurations
simulated Optimizer 1
measurement
sequence
Z11,Z22,…,Zkk
Optimizer 2
Optimizer n
On-Line Multiple-Model Estimation
~
Xµµ1
KFµ1
1
p(µ1 | z,∏µ11)
Actual
meas. ~
Xµµ2
seq.
KFµ2 2
p(µ2 | z,∏µ22)
(
Z* x
Σ
~
Xµµn
KFµn n
p(µn | z,∏µnn)
where C = HPH + R T
Final Combined Estimate
)x = x p(µ z, Πµ )
∑ ƒµ p(ν z, Π )
µ ∑ ν
ν
Example: P/PV Multiple-Model
0.9 Truth
Estimate
0.8
y [meters]
0.7
0.6
0.5
0.4
0.3
0.2
0 5 10 15 20 25 30
Time [seconds]
MME Weighting
1
0.9
y [meters]
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0 5 10 15 20 25 30
Time [seconds]
1
0.9
p(µP | z,πµP)
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 5 10 15 20 25 30
Low-Latency During Motion
Truth
ooooo P Estimate
0.715 +++++ PV Estimate
MM Estimate
0.71
0.705
0.7
0.695
0.69
1
0.9
0.8 0.685
0.7
0.6
0.5
0.68
0.4
7 7.5 8 8.5
0.3
0.2
0 5 10 15 20 25 30
Time [seconds]
Smooth When Still
0.29
Truth
ooooo P Estimate
0.2895 +++++ PV Estimate
0.289
MM Estimate
0.2885
0.288
0.2875
0.287
1
0.2865
0.9
0.8 0.286
0.7
0.6
0.5
0.2855
0.4
23.2 23.4 23.6 23.8 24 24.2 24.4 24.6 24.8
0.3
0.2
0 5 10 15 20 25 30
Time [seconds]
Conclusions
http://www.cs.unc.edu/~welch/kalman/
• On-line 1D simulation
• Linear and non-linear
• Variable dynamics
http://www.cs.unc.edu/~welch/kalman/
KF Course Web Page
http://www.cs.unc.edu/~tracker/ref/s2001/kalman/index.html
( http://www.cs.unc.edu/~tracker/ )