Sub topic 1
What Multi-Object Tracking Asks For
Prerequisites
This chapter assumes you know basic Python and NumPy, can read bounding boxes written as [x1, y1, x2, y2], and understand what an object detector outputs. No prior tracking experience is needed.
The tracking problem
Multi-object tracking (MOT) is the task of following every object of interest through a video and giving each one a persistent ID. A detector answers "what is in this frame?" A tracker answers "which object in this frame is the same object as one seen earlier?"
Single-object tracking follows one target that you select in the first frame. MOT handles an unknown number of objects that enter, leave, and cross paths. The output is a set of trajectories, one per object, each a sequence of boxes sharing an ID.
Detections as the tracker's input
Most trackers do not look at pixels directly. They receive a list of detections for each frame. Each detection holds a box, a class label, and a confidence score. The tracker's job is to link these detections across frames. If the detector misses an object or invents a false one, the tracker inherits that error.
Measuring overlap with IoU
Intersection over union (IoU) is the ratio of the overlap area between two boxes to the area covered by either box. It ranges from 0 (no overlap) to 1 (identical boxes). Trackers use it to decide whether two boxes plausibly show the same object.
def iou(a, b):
x1 = max(a[0], b[0])
y1 = max(a[1], b[1])
x2 = min(a[2], b[2])
y2 = min(a[3], b[3])
inter = max(0, x2 - x1) * max(0, y2 - y1)
area_a = (a[2] - a[0]) * (a[3] - a[1])
area_b = (b[2] - b[0]) * (b[3] - b[1])
union = area_a + area_b - inter
return inter / union if union > 0 else 0.0
print(round(iou([10, 10, 50, 50], [12, 11, 52, 52]), 3)) # 0.843The tracking-by-detection pipeline
Most practical trackers follow the same loop for each frame:
- Run the detector to get the current detections.
- Predict where each existing track should be now.
- Match detections to tracks, usually by IoU.
- Update matched tracks, start new tracks for unmatched detections, and age unmatched tracks.
Check your understanding
Exercise
Two boxes have an IoU of 0.0. What does that tell a tracker about them?
Show answer
The boxes do not overlap, so IoU gives no evidence that they show the same object. The tracker should not link them on overlap alone.