Skip to the lesson
FixTheRobot Explore Robotics / Perception / P7 Multi-Object Tracking and Temporal Perception / P7-T3

Perception · Theory · P7

P7-T3 — Track State and Motion Estimation

A track is a state and a story about how the state changes. The story is a model, and the model is sometimes wrong.

  • Lesson 3 of 6
  • Module 7: Multi-Object Tracking and Temporal Perception
  • Theory
  • About 9 minutes to read

To associate detections to tracks the tracker must predict where each object is now, and to give the planner a velocity it must estimate how fast the object is moving. Both need a model of how objects move and a way to combine the model with noisy measurements. This lesson defines the state of a track, writes the common motion models as matrices, introduces the simplest estimator, the alpha-beta filter, and shows what happens when the model is wrong: after a manoeuvre the prediction error grows linearly. Lab P7-L3 lets you slide the filter gain and watch smoothing trade against lag.

Learning objectives

After this lesson, you should be able to:

  • Define a track state and write the constant-velocity prediction as a matrix equation.
  • Explain when constant-velocity and constant-acceleration models are appropriate.
  • Apply the alpha-beta update to a position measurement.
  • Compute the prediction error that builds up after a manoeuvre and the effect of the filter gain on noise and lag.

The idea: remember how the object was moving

A pedestrian who was walking to the right a moment ago is probably still walking to the right. Using that expectation is what prediction means: the tracker carries, beside each object’s position, a compact summary of its recent motion and uses it to say where the object should be in the next frame.

What a track stores

A track holds a state: the numbers that, together with a model, are enough to predict the future. For an object on the ground plane the usual state is position and velocity, x = (px, py, vx, vy). Around the state a track keeps its identity, its age and hit count (Lesson P7-T5), its class, its size, and its uncertainty (a covariance matrix, Lesson P7-T4). The state is not measured: only the position is observed. The velocity is inferred from how the position changes, which is why it needs several frames to settle.

Motion models

  1. Constant velocity. The object keeps its velocity and any change is treated as small random noise. It suits pedestrians, vehicles on straight roads and objects in short intervals, and is the default of most trackers.
  2. Constant acceleration. The state includes acceleration, so the model can follow speeding up and braking. It needs more frames to settle and amplifies noise, so it is used when accelerations are large and persistent.
  3. Constant turn rate. The speed and the turn rate are held constant, which follows curved paths such as a car on a bend.
  4. Several models at once. When the object may do any of these, trackers run several filters and weigh them by how well each fits the data (interacting multiple models). It costs more and handles manoeuvres better.

All models are wrong in some situations. The question is whether they are wrong by a margin that the tracker’s noise settings and gate can absorb.

The alpha-beta filter

The simplest estimator that uses a motion model is the alpha-beta filter. It predicts with constant velocity, compares the prediction with the new measurement, and corrects the position by a fraction α of the difference and the velocity by a fraction related to β. Its two numbers play the role the Kalman filter’s gain plays in the next lesson, but they are set by hand and do not change.

Constant-velocity prediction after a manoeuvreA plot of position against frame. The true path rises at 3 units per frame until frame 6 and then at 1 unit per frame. A dashed constant-velocity prediction made at frame 6 continues at 3 per frame and moves further and further above the true path, so the prediction error grows with every frame.036912010203040frameposition green: true path (speed 3, then 1 after frame 6)orange dashed: prediction made at frame 6 error after k frames = 2 k (3 − 1 per frame)k = 3: 6 units; k = 6: 12 units
A constant-velocity prediction made at frame 6 keeps rising at the old speed while the object slows down. The error grows by the difference of speeds with every frame.

The mathematics: state-space models and the alpha-beta filter

For one coordinate, with state xk = (pk, vk)ᵀ and time step Δt, the constant-velocity model is

constant-velocity state-space model
x(k+1)=F xk+wkx_{(k+1)}=F\,x_{k}+w_{k}
F=[1Δt01]F=\begin{bmatrix}1 & \Delta t \\ 0 & 1\end{bmatrix}
zk=H xk+nkz_{k}=H\,x_{k}+n_{k}
H=[1, 0]H=[1,\,0]
F
the transition matrix: the new position is the old position plus velocity times Δt; the velocity is unchanged.
wk
process noise: the part of the motion the model does not explain (random accelerations). Its size is the model’s admission of ignorance.
H
the observation matrix: only the position is measured.
nk
measurement noise with variance r.

Without noise, the prediction after k steps is p + k Δt v. For a 2D object the same model is applied to each coordinate, or written with a 4 × 4 matrix.

A constant-acceleration model adds a third state a: p ← p + Δt v + ½ Δt² a, v ← v + Δt a.

The alpha-beta filter predicts, then corrects with the residual (the measurement minus the prediction):

alpha-beta update
ppred=p+Δt⋅vp_{\text{pred}}=p+\Delta t\cdot v
r=z−ppredr=z-p_{\text{pred}}
p←ppred+α rp\leftarrow p_{\text{pred}}+\alpha \,r
v←v+(βΔt) rv\leftarrow v+(\frac{\beta }{\Delta t})\,r
ppred
the predicted position.
r
the residual: how far the measurement is from the prediction. A large residual means a new motion or a bad measurement.
α
position gain between 0 and 1: α = 1 copies the measurement, α = 0 ignores it.
β
velocity gain: how strongly a residual changes the velocity. A common choice is β = α² / (2 − α), which ties the two gains together so that one number sets the whole filter.

The gains set a trade-off. A small α averages many measurements, so the noise in the estimate is low; but when the object changes its motion, the estimate lags behind it. A large α follows quickly and passes the noise through. The two goals, low noise and low lag, pull α in opposite directions (Lab P7-L3, stage 1).

Prediction error after a manoeuvre. If the object changes velocity by Δv and the model keeps the old one, the prediction error after k frames is

prediction error after a velocity change
ek=k⋅Δv⋅Δte_{k}=k\cdot \Delta v\cdot \Delta t

The error grows linearly. The gate (Lesson P7-T2) must be wide enough to include it, or the tracker loses the object.

Worked examples: one update, one manoeuvre

One alpha-beta update. A track has position p = 10 and velocity v = 2 units per frame; Δt = 1. The next measurement is z = 13.5. Take α = 0.5 and β = α² / (2 − α) = 0.25 / 1.5 = 0.167.

One alpha-beta update
StepCalculationResult
Predict10 + 1 × 2ppred = 12
Residual13.5 − 12r = 1.5
Position12 + 0.5 × 1.5p = 12.75
Velocity2 + (0.167 / 1) × 1.5v = 2.25

The measurement said the object was 1.5 ahead of where the model expected. The filter moved the position by half of that and raised the velocity a little. Repeated over frames, a consistent residual pushes the velocity toward the real one.

A manoeuvre. An object moves at 3 units per frame until frame 6, where it has position 18, then slows to 1 unit per frame. A prediction made at frame 6 with the old velocity gives 18 + 3k after k frames; the object is at 18 + k. The error is 2k: 6 units after three frames and 12 after six. If the gate is 8 units, the track is lost after four frames with no detection to correct it. With measurements arriving each frame, the filter corrects the velocity as the residuals grow: with α = 0.5 the first residual after the change is about 2, so the velocity falls by about 0.33 on that frame (β = 0.167 times the residual), and the filter needs several frames to get down to 1. During those frames the estimate lags the object. A higher gain recovers faster but passes more noise.

The cost of that choice. For measurements with σ = 3, Lab P7-L3 shows an RMS error between about 2.1 and 2.5, below the measurement noise of 3, for α between 0.5 and 0.7, and about 3.4 at α = 0.3, where the lag after the manoeuvre dominates. The best gain depends on both the noise and how often the target manoeuvres.

Engineering implications and limitations

Choose the motion model for the object, not for the tracker. Pedestrians turn on a dime; a truck cannot. Per-class models, or per-class process noise, give better gates and better prediction.

Initialise the velocity honestly. A new track has a position but no velocity. Give it zero velocity with a large velocity uncertainty, or estimate it from the first two detections and mark it unconfirmed; do not claim a speed you have not measured.

Work in a consistent frame. Track in a world or ground frame, not in image pixels, when the camera or robot moves, or the robot’s own motion will appear as target motion (Lesson P1-T4). Compensate ego-motion before the prediction.

Use real time stamps. The prediction step needs the actual Δt between measurements; a fixed Δt with irregular frames makes the filter see accelerations that are not there.

Treat a growing residual as information. A run of large residuals in one direction means the model is wrong (a manoeuvre). Raising the process noise temporarily, or switching model, helps the filter recover.

Do not trust the velocity too early. The velocity of a track with fewer than a handful of updates is uncertain; consumers such as planners should see the uncertainty or a confirmed flag.

Common misconceptions

“Velocity is measured.”

The detector reports positions. Velocity is inferred from how the position changes, so it lags and is noisy, especially for new tracks.

“A better motion model always helps.”

A richer model has more states to estimate from the same noisy data and can amplify noise. The simplest model that covers the motion is usually best.

“The filter gain is a technical constant.”

It is a design decision that trades noise against lag. The right value depends on measurement noise and how quickly the object can change its motion.

“If the prediction is off, the detector is wrong.”

It can equally be the motion model: after a manoeuvre the old velocity is wrong and the error grows with every frame.

Engineering takeaways

  1. A track’s state holds position and velocity (and sometimes acceleration or turn rate); only position is observed.
  2. Constant velocity is the default model: xk+1 = F xk with F = [[1, Δt], [0, 1]].
  3. The alpha-beta filter predicts, forms the residual and corrects position by α·r and velocity by (β/Δt)·r; with one update 10, 2, z = 13.5 gives p = 12.75 and v = 2.25 at α = 0.5.
  4. After a velocity change Δv the prediction error grows as k·Δv·Δt: 2 per frame in the example, so a gate of 8 is exceeded after four frames.
  5. The gain trades noise against lag; choose it from the noise level and the manoeuvres expected.

References and further reading

Textbooks and the classic paper for the alpha-beta relation. The numerical examples are constructed for teaching; the RMS figures quoted from Lab P7-L3 are from its simulator.

  • Bar-Shalom, Y., Li, X.-R. and Kirubarajan, T. (2001). Estimation with Applications to Tracking and Navigation. Wiley: motion models, alpha-beta filters and interacting multiple models.
  • Blackman, S. and Popoli, R. (1999). Design and Analysis of Modern Tracking Systems. Artech House.
  • Benedict, T. R. and Bordner, G. W. (1962). Synthesis of an Optimal Set of Radar Track-While-Scan Smoothing Equations. IRE Transactions on Automatic Control: the alpha-beta relation β = α²/(2 − α).
  • Thrun, S., Burgard, W. and Fox, D. (2005). Probabilistic Robotics. MIT Press.

Knowledge check

Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.

Question 1

A track has p = 5, v = 1.5 and Δt = 0.2. What is the predicted position after the next frame, and after five frames with no measurement?

Explanation

After one frame: 5 + 0.2 × 1.5 = 5.3. After five: 5 + 5 × 0.2 × 1.5 = 6.5. With no measurements the filter just extrapolates at constant velocity.

Question 2

An object that was moving at 4 units per frame stops completely. A constant-velocity prediction continues. How large is the error after 3 frames, and when would a gate of 10 be exceeded?

Explanation

Error after k frames = k × 4: 12 after 3 frames. A gate of 10 is exceeded after 3 frames (k = 3 gives 12 > 10; k = 2 gives 8 ≤ 10).

Question 3

Why might you lower α when the detector is very noisy, and what do you pay?

Explanation

A lower α averages over more frames, so the estimate is smoother and less influenced by a single bad measurement. You pay in lag: the estimate follows changes of speed or direction more slowly.

What’s next

Next: the Kalman filter, which sets the gain from the stated uncertainties instead of leaving it as a hand-tuned number.

Practice this lesson

Investigate How Noisy Detections Affect Track Quality

Add a motion model and a filter and measure track error against noise.

Next lesson

P7-T4 — Simple Filtering and Kalman Filter Intuition

Combine prediction and measurement with a gain that balances their uncertainties.

Nothing below is required to finish this lesson.