tezvyn:

Kalman Filters: Predicting Through Noise

AI-drafted, machine-checkedSource: Wikipedia: Kalman filterintermediate
Kalman Filters: Predicting Through Noise

A Kalman filter predicts an object's next position, then corrects that prediction with noisy real-world measurements. It's used in video tracking to smooth an object's path between frames or in robotics to fuse imperfect sensor data.

WHY IT EXISTS Measurements from the real world are always noisy. A camera might detect an object's position slightly differently in each frame, even if the object is still. We need a way to filter out this noise and estimate the object's true state, like its position and velocity, over time.

THE MENTAL MODEL Imagine tracking a car on a highway using a shaky camera. A Kalman filter is an algorithm that constantly does two things: first, it predicts where the car will be in the next frame based on its current speed and direction. Second, when the next frame arrives, it takes the new, shaky measurement of the car's position and intelligently blends it with the prediction. It trusts its prediction more if the measurement seems wild, and trusts the new measurement more if it's close to the prediction. This predict-correct cycle produces a smooth, realistic track from noisy data.

HOW IT WORKS The filter maintains its belief about an object's state (e.g., position, velocity) as a probability distribution. The process is a two-step loop. First, the 'predict' step uses a motion model to project the state forward in time, which also increases the uncertainty of the estimate. Second, the 'update' step incorporates a new measurement. It compares the prediction to the new measurement and uses the difference to correct the state estimate, reducing its uncertainty. The amount of correction is governed by the Kalman Gain, a value that balances the confidence in the prediction versus the confidence in the measurement.

WHEN TO USE IT Use a Kalman filter when you are tracking an object over time and have a series of noisy measurements from sensors. It is ideal for systems that can be reasonably approximated with a linear motion model, such as tracking vehicles on a road, aircraft in the sky, or fusing data from different sensors like an accelerometer and a GPS in a smartphone.

WHEN NOT TO USE IT The standard Kalman filter is not suitable for systems with highly non-linear dynamics, like tracking a person walking erratically or a buzzing insect. For these cases, more advanced versions like the Extended Kalman Filter (EKF) or Unscented Kalman Filter (UKF) are required. It also assumes the measurement noise follows a Gaussian (bell curve) distribution and can perform poorly otherwise.

ONE CANONICAL EXAMPLE A self-driving car's perception system uses a camera and radar to track a nearby vehicle. The camera's bounding box jitters frame-to-frame, and the radar's velocity reading has its own noise. A Kalman filter fuses these measurements over time to produce a single, stable estimate of the other vehicle's true position and velocity, allowing the car to reliably predict its future path.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.