Extended Kalman Filter (EKF)
The Extended Kalman Filter is the workhorse of recursive state estimation with nonlinear models. It maintains a Gaussian belief over the state and alternates two steps — predict (propagate the belief through a motion model) and update (correct it with a measurement) — which is exactly the recursive Bayes filter with all densities approximated as Gaussians and all models linearized at the current estimate.
Setup
The system is described by a nonlinear motion model and a nonlinear observation model:
where is the state (e.g., camera pose, velocity, landmark positions), a control or IMU input, a measurement (e.g., pixel coordinates of a tracked feature), and , the process and measurement noise covariances. The EKF linearizes and with their Jacobians evaluated at the current estimate:
Predict
The mean is pushed through the full nonlinear model; only the covariance uses the linearization. Uncertainty grows in this step (dead-reckoning drift).
Update
The gain weighs the measurement against the prediction: confident predictions (small ) or noisy sensors (large ) yield small corrections, and vice versa. The innovation covariance also supports gating — a Mahalanobis test threshold rejects outlier measurements before they corrupt the state.
EKF-SLAM
In EKF-SLAM (the formulation behind MonoSLAM), the state stacks the camera/robot pose and all landmark positions,
and stores the full joint covariance including pose-landmark and landmark-landmark correlations. Those cross-correlations are what makes loop closure work in a filter: correcting the pose also drags every correlated landmark. The costs are structural:
- Quadratic scaling: has entries and each update touches all of them, capping real-time EKF-SLAM at small maps (on the order of tens to a hundred landmarks).
- Linearization error: Jacobians are evaluated at the current estimate once, and errors are baked permanently into — unlike optimization approaches, the filter cannot re-linearize the past. This causes the well-known inconsistency (overconfidence) of EKF-SLAM.
- Rotation handling: naive parameterizations of orientation misbehave; practical filters use the error-state (indirect) EKF, where the filter estimates a small error around a nominal state and quaternion kinematics handle attitude.
These limitations are why modern visual SLAM moved to keyframe-based nonlinear optimization (“why filter?” debate, Strasdat et al.), while filtering survives where its constant-time recursive form shines: visual-inertial odometry (MSCKF, ROVIO, error-state EKFs) and sensor fusion of odometry with GPS/RADAR/wheel encoders.
Why it matters for SLAM
The EKF is the historical foundation of SLAM (EKF-SLAM was the solution for a decade) and is still the backbone of production VIO (MSCKF derivatives run on many AR headsets and drones). Even in optimization-centric pipelines, EKF concepts are everywhere: prediction/update structure, innovation gating for outlier rejection, covariance propagation for uncertainty, and marginalization (a fixed-lag smoother’s marginalization step is algebraically a Kalman update). Understanding when the EKF’s single-linearization assumption breaks is the key to understanding why bundle adjustment wins on accuracy and why MSCKF-style filters delay linearization.