Object tracking

On this page 8

Object tracking is the computer vision task of following one or more objects across consecutive video frames and assigning each of them a persistent identity for as long as it stays in view. Where object detection answers what is present in a single image, tracking answers which object is which over time, producing trajectories rather than isolated boxes.

In artificial intelligence systems, tracking turns per-frame perception into temporal understanding: counting people who cross a line, predicting where a vehicle will be in half a second, or keeping a camera locked on a moving athlete. It is a core building block of video analytics, driver assistance, robotics and augmented reality.

How object tracking works frame by frame

Most modern trackers follow the tracking-by-detection paradigm. A detector proposes bounding boxes in every frame, a motion model predicts where each existing track should appear next, and an association step matches new detections to existing tracks. Unmatched detections start new tracks, and tracks that stay unmatched for too long are terminated.

The classic motion model is a Kalman filter with a constant-velocity assumption, which predicts box position and size and also estimates uncertainty. Association is usually solved as an assignment problem with the Hungarian algorithm, using a cost built from box overlap (intersection over union), distance between predicted and observed centers, and often an appearance embedding produced by a re-identification network.

The following table summarizes the main stages of a tracking-by-detection pipeline and what each one contributes.

StageTypical methodPurpose
DetectionCNN or transformer detectorFind candidate objects in each frame
PredictionKalman filter, constant velocityEstimate where each track moves next
AssociationHungarian matching on IoU and appearanceLink detections to existing identities
Track managementBirth and death thresholdsCreate, confirm and delete tracks
Re-identificationEmbedding similarityRecover identity after occlusion
Stages of a tracking-by-detection pipeline

Single-object and multi-object tracking

The field splits into two problem settings with different assumptions. Single-object tracking (SOT) receives one target, usually marked by a box in the first frame, and must follow it without knowing its class. Multi-object tracking (MOT) must find and follow every object of given classes, such as all pedestrians, while keeping their identities apart.

Single-object trackers often use Siamese networks or transformer correlation, which compare a template of the target with a search region in each new frame. Multi-object trackers depend heavily on detector quality and on data association, because the hardest errors occur when similar objects cross paths.

VariantInputTypical use
Single-object trackingOne initial box, any classCamera follow, drone target lock
Multi-object trackingDetector output per framePedestrian counting, traffic analysis
Multi-camera trackingSeveral overlapping or disjoint viewsRetail and campus analytics
3D trackingLiDAR or depth plus imagesAutonomous driving, robotics
Point and keypoint trackingPixels or body jointsMotion capture, video editing
Main variants of object tracking

Measuring tracking quality

Tracking quality cannot be judged by detection accuracy alone, because a tracker can find every object and still swap identities repeatedly. Benchmarks therefore use metrics that combine detection, localization and identity consistency, and practitioners usually report several of them together.

MetricWhat it emphasizesWeakness
MOTAMisses, false positives and ID switchesDominated by detection errors
IDF1Correct identity over the whole trajectoryLess sensitive to localization
HOTABalance of detection and associationHarder to interpret at a glance
ID switchesRaw count of identity changesNot normalized by scene size
Success rate (SOT)Overlap with the true box over timeIgnores multi-object confusion
Common tracking metrics

A practical rule is to read HOTA or IDF1 alongside MOTA: a high MOTA with a low IDF1 means the system detects well but fails to keep identities, which matters greatly for counting and behavior analysis.

Tracking sits on top of several neighboring tasks rather than replacing them. Object detection supplies boxes, image segmentation can supply pixel masks for mask-based tracking, and pose estimation can supply keypoints that are tracked as skeletons. Feature matching, by contrast, links points between images without assigning object identities.

TaskOutputTemporal identity
Object detectionBoxes and classes per frameNo
Object trackingTrajectories with stable IDsYes
Image segmentationPixel masks per frameOnly in video segmentation
Feature matchingPoint correspondencesPoints only, not objects
Optical flowDense pixel motionNo object identity
How tracking relates to neighboring tasks

Choosing and tuning a tracker in practice

The choice depends on frame rate, object density and occlusion. At high frame rates with sparse scenes, a lightweight motion-only tracker such as SORT or ByteTrack is often enough and adds only a few milliseconds per frame. Crowded scenes with long occlusions benefit from appearance features, as in DeepSORT-style trackers, at the cost of extra computation per detection.

Key parameters include the detection confidence threshold, the IoU or distance gating threshold, the number of frames before a track is confirmed (often 2-3) and the maximum age of an unmatched track (commonly 30-60 frames at 30 fps). ByteTrack showed that keeping low-confidence detections for a second association round recovers many partially occluded objects.

  • Lower the frame rate and tracks drift, because motion between frames grows beyond what the predictor handles.
  • Raise the maximum track age and identities survive occlusions, but ghost tracks linger after objects leave.
  • Use camera motion compensation on moving platforms, otherwise every object appears to move at once.

Limitations and typical failure modes

The most common failure is the identity switch, where two similar objects exchange labels after crossing or overlapping. Long occlusions, abrupt motion, motion blur and low resolution all degrade association, and a tracker can never recover an object the detector consistently misses.

Tracking people raises privacy and regulatory questions, especially when appearance embeddings are stored and linked across cameras. Responsible deployments limit retention, avoid linking tracks to identities without a legal basis and treat trajectory data as personal data where applicable.

Understanding it simply

Imagine watching a busy train platform and trying to keep your eye on several travelers at once. You notice each person, remember roughly where they were heading and recognize them again after someone walks in front of them. Object tracking does the same thing for a computer: it spots objects in each video frame and keeps a name tag on each one as it moves.

The key idea is that tracking connects the frames. Without it, a camera sees a new crowd in every image. With it, the system knows that the person on the left now is the same person who entered a second ago.

Applied in practice

A city traffic department installs cameras at a busy intersection to measure turning movements. A detector finds cars, buses, bicycles and pedestrians at 25 frames per second, and a multi-object tracker links them into trajectories with a maximum track age of about two seconds to survive buses blocking the view.

Each trajectory is classified by entry and exit lane, so the system counts left turns, right turns and straight movements per vehicle class. Engineers check a sample of footage by hand and tune the gating threshold until identity switches stay rare. The resulting counts let planners retime signals with turning data gathered continuously instead of from occasional manual surveys.