Multi-object tracking
Five cars cross a sensor’s field of view. Each scan misses some of them and adds a few false detections at random places, and does not say which detection belongs to which car. The tracker keeps one constant-velocity Kalman filter per track.
Algorithm
Every scan:
Predict every track to the time of the scan.
Gate: rule out pairs whose squared Mahalanobis distance \(d_{ij}^2\) exceeds 9.21, which keeps 99% of true detections.
Pair tracks with detections using the Hungarian algorithm, so that as many as possible are paired at the lowest total cost. The cost is the negative log-likelihood of the detection, which adds a penalty for the track’s uncertainty:
Update the paired tracks; start a tentative track at every unpaired detection; confirm a track after three detections and delete one that keeps being missed.
Code Link
- Mapping.multi_object_tracking.multi_object_tracking.tracker_step(tracks: list[Track], detections: ndarray, next_id: int) tuple[list[Track], int]
One scan: predict, associate, update, then start, confirm and delete tracks. Returns the tracks and the next free track id.
Standalone project and report
This algorithm is also published as a standalone project, robofan45/multi-object-tracking, with an installable package, tests that run on Linux, macOS and Windows, and an IEEE-style technical report (PDF) with measurements and a full bibliography.
Reference
Y. Bar-Shalom, P. K. Willett and X. Tian, “Tracking and Data Fusion: A Handbook of Algorithms”, YBS Publishing, 2011
H. W. Kuhn, “The Hungarian Method for the Assignment Problem”, Naval Research Logistics Quarterly, 1955