CSE445Computer Vision
Tutorials/Object Tracking

CSE445 · Temporal computer vision

Object Tracking and Multi-Object Tracking

Learn how computer-vision systems follow objects across video frames using motion estimation, state prediction, data association, appearance matching, identity management, and tracking evaluation.

This four-part tutorial series develops the foundations of single-object and multi-object tracking. Students learn how detections are connected across time, how object states are predicted, how identities are preserved through occlusion, and how tracking systems are evaluated. YOLO26 is used as the object detector in practical demonstrations, while the tracking concepts remain applicable to any detector or tracking framework.

4 TutorialsBeginner–Intermediate to AdvancedApproximately 9–11 HoursObject TrackingMulti-Object TrackingMotion EstimationData AssociationRe-IdentificationPython, OpenCV, and PyTorchYOLO26 Demonstrations

Learning outcomes

What Students Will Learn

Ten measurable outcomes spanning motion modelling, data association, identity management, and evaluation.

Foundations and association

Outcomes 1–5

  1. 1Explain the difference between object detection, single-object tracking, and multi-object tracking.
  2. 2Represent an object using position, velocity, size, and identity state.
  3. 3Predict object motion using constant-velocity models and Kalman filtering.
  4. 4Build detection-to-track cost matrices using IoU, distance, and appearance similarity.
  5. 5Apply greedy matching and Hungarian assignment.

Identity, evaluation, and applications

Outcomes 6–10

  1. 6Explain track creation, confirmation, loss, recovery, and termination.
  2. 7Compare SORT, ByteTrack, DeepSORT, BoT-SORT, and OC-SORT.
  3. 8Understand identity switches, fragmentation, occlusion, and duplicate tracks.
  4. 9Evaluate trackers using MOTA, IDF1, HOTA, and runtime metrics.
  5. 10Build counting, trajectory, dwell-time, and speed-analysis applications.

Four-part notebook sequence

Student Tracking Notebooks

Complete the notebooks in order. Each one clearly separates what to learn, what to build, what to submit, and the full reference syllabus.

NOTEBOOK 01Beginner–Intermediate2 Hours

Tracking Fundamentals

Foundations of Object Tracking and Motion Prediction

Introduce object tracking as the estimation of an object’s state over time. Students learn how positions, velocities, bounding boxes, trajectories, and uncertainty are represented. The tutorial develops motion prediction from frame differencing and optical flow to constant-velocity models and Kalman filtering.

PythonNumPyOpenCVFilterPyMatplotlib

Notebook workflow

Video framesYOLO26 observationsState predictionMeasurement updateCorrected trackTrajectory
1

Learn

Learning objectives

  • Differentiate detection, single-object tracking, and multi-object tracking
  • Represent position, size, velocity, identity, and uncertainty as track state
  • Explain prediction, observation, innovation, correction, and covariance
  • Apply a Kalman filter across missed and noisy observations
2

Build

Notebook activities

  • Detect one object in a video and extract its center position
  • Estimate velocity and predict the next position
  • Apply a Kalman filter to noisy observations
  • Simulate missed detections and compare raw with filtered trajectories
3

Submit

Expected outcome

Students create a motion-prediction notebook that visualizes noisy detections, Kalman predictions, corrected states, uncertainty, and object trajectories.

View full notebook syllabusConcepts, algorithms, mathematics, and practice

Core concepts

  • Video as a temporal signal
  • Frames and frame rate
  • Object state
  • Bounding-box center, width, and height
  • Velocity and acceleration
  • Trajectory and observation
  • State prediction and measurement update
  • Process and measurement noise
  • Uncertainty
  • Track initialization and lifecycle
  • Single-object tracking
  • Multi-object tracking

Key algorithms

  • Frame differencing
  • Background subtraction
  • Sparse and dense optical flow
  • Constant-position model
  • Constant-velocity model
  • Constant-acceleration model
  • Kalman filter prediction–update cycle

Mathematical topics

State vector: xₜ = [cₓ, cᵧ, w, h, vₓ, vᵧ]ᵀPrediction: x̂ₜ|ₜ₋₁ = F x̂ₜ₋₁|ₜ₋₁Covariance prediction: Pₜ|ₜ₋₁ = F Pₜ₋₁|ₜ₋₁ Fᵀ + QKalman gain and innovationCorrected state and covariance ellipse

Practice checklist

  • Visualize true, observed, predicted, and corrected positions
  • Adjust process noise Q and measurement noise R
  • Plot the covariance ellipse during an observation gap
  • Document how the track recovers after detections return

Student guidance: complete the notebook in sequence and keep the generated figures, metrics, and written observations.

Open Notebook
NOTEBOOK 02Intermediate2.5 Hours

Data Association

Detection-to-Track Association: From SORT to ByteTrack

Teach how detections from the current frame are assigned to existing tracks. Students construct similarity and cost matrices, apply gating, solve assignment problems, manage track lifecycles, and study the progression from SORT to ByteTrack.

PythonNumPySciPyFilterPyOpenCV

Notebook workflow

Predicted tracksCurrent detectionsCost matrixGatingHungarian assignmentTrack update
1

Learn

Learning objectives

  • Build IoU, distance, and motion-gated association costs
  • Compare greedy matching with Hungarian assignment
  • Compose detector, Kalman filter, assignment, and lifecycle logic into SORT
  • Explain how ByteTrack uses low-confidence observations for recovery
2

Build

Notebook activities

  • Run detection without tracking and inspect repeated observations
  • Construct a numerical cost matrix and solve it manually
  • Compare greedy, SORT-style, and ByteTrack association
  • Visualize unmatched detections, lost tracks, trajectories, and ID switches
3

Submit

Expected outcome

Students build a complete tracking-by-detection pipeline and understand how SORT and ByteTrack convert frame-level detections into persistent identities.

View full notebook syllabusConcepts, algorithms, mathematics, and practice

Core concepts

  • Tracking by detection
  • Existing tracks and current detections
  • Predicted bounding boxes
  • Intersection over Union
  • Center and Mahalanobis distance
  • Similarity and cost matrices
  • Gating
  • Matched and unmatched states
  • Track confirmation, deletion, and buffer

Key algorithms

  • Greedy matching
  • Hungarian assignment
  • SORT
  • ByteTrack two-stage matching
  • Confidence-aware recovery
  • Track lifecycle state machine

Mathematical topics

IoU(A, B) = |A ∩ B| / |A ∪ B|Association cost: Cᵢⱼ = 1 − IoU(Tᵢ, Dⱼ)Three-track by four-detection cost matrixGating threshold and invalid assignmentsOne-to-one minimum-cost assignment

Practice checklist

  • Change the association threshold and track buffer
  • Compare greedy and Hungarian assignment on the same matrix
  • Inspect ID switches during partial occlusion
  • Explain the role of persist=True in a manual video frame loop

Student guidance: complete the notebook in sequence and keep the generated figures, metrics, and written observations.

Open Notebook
NOTEBOOK 03Intermediate–Advanced3 Hours

Robust Multi-Object Tracking

Appearance, Occlusion, and Robust Identity Tracking

Extend motion-only tracking with appearance representations, re-identification, camera-motion compensation, and observation-centric motion modeling. Students compare DeepSORT, BoT-SORT, OC-SORT, and related robust tracking strategies.

PythonPyTorchOpenCVscikit-learnYOLO26 detections

Notebook workflow

Motion predictionAppearance embeddingFused associationOcclusion bufferRe-identificationPersistent identity
1

Learn

Learning objectives

  • Explain when motion-only association becomes ambiguous
  • Use appearance embeddings for re-identification and recovery
  • Compare DeepSORT, BoT-SORT, and OC-SORT conceptually
  • Analyze camera motion, occlusion, fragmentation, and duplicate identities
2

Build

Notebook activities

  • Compare motion-only and appearance-assisted association
  • Test static-camera, moving-camera, crowded, and abrupt-motion scenes
  • Enable or disable re-identification and camera compensation
  • Measure identity switches, fragmentation, recovery, duplicates, and runtime
3

Submit

Expected outcome

Students learn when motion-only tracking is insufficient and how appearance, camera compensation, and observation-centric updates improve identity preservation.

View full notebook syllabusConcepts, algorithms, mathematics, and practice

Core concepts

  • Appearance embedding and re-identification
  • Cosine similarity
  • Motion–appearance fusion
  • Occlusion and identity switch
  • Track fragmentation and lost-track recovery
  • Camera motion and homography
  • Global motion compensation
  • Observation-centric motion estimation
  • Duplicate-track suppression

Key algorithms

  • DeepSORT matching cascade
  • BoT-SORT motion and appearance association
  • Camera-motion compensation
  • OC-SORT observation-centric updates
  • Short-term and long-term re-association

Mathematical topics

Cosine similarity between appearance embeddingsMotion and appearance cost fusionHomography-based global motion estimationObserved motion = object motion + camera motionDirection-consistency constraints

Practice checklist

  • Visualize appearance embeddings before and after occlusion
  • Estimate camera motion from background features
  • Compare track recovery across multiple robust trackers
  • Write a failure analysis for one identity switch

Student guidance: complete the notebook in sequence and keep the generated figures, metrics, and written observations.

Open Notebook
NOTEBOOK 04Advanced / Research3 Hours

Evaluation and Applications

Tracking Evaluation and Intelligent Video Analytics

Evaluate tracking systems using detection, identity, association, trajectory, and runtime metrics. Students conduct controlled tracker comparisons and transform tracked trajectories into practical video-analytics applications.

Pythonpy-motmetricsTrackEvalPandasOpenCV

Notebook workflow

Ground truth + predictionsMOT event matchingMOTA · IDF1 · HOTARuntime analysisTrajectory exportVideo analytics
1

Learn

Learning objectives

  • Interpret MOTA, MOTP, IDF1, HOTA, FPS, and latency
  • Design a controlled comparison with fixed detector and input settings
  • Diagnose identity switches, fragmentation, and localization errors
  • Build counting, trajectory, dwell-time, and speed-analysis applications
2

Build

Notebook activities

  • Compare SORT-style, ByteTrack, appearance-assisted, BoT-SORT, and OC-SORT systems
  • Build a metrics table without fabricated values
  • Export identities and trajectories to CSV
  • Implement at least three temporal video-analytics applications
3

Submit

Expected outcome

Students produce a complete evaluated tracking system, a comparative tracker report, trajectory exports, and at least three video-analytics applications.

View full notebook syllabusConcepts, algorithms, mathematics, and practice

Core concepts

  • Ground-truth trajectories
  • False positives and false negatives
  • Identity switches and fragmentation
  • Mostly tracked and mostly lost
  • MOTA, MOTP, IDF1, and HOTA
  • Detection and association accuracy
  • Runtime, FPS, latency, and memory
  • Trajectory and event analytics

Key algorithms

  • MOT event matching
  • Controlled tracker comparison
  • Unique-object counting
  • Line-crossing detection
  • Region dwell-time analysis
  • Trajectory heatmaps and calibrated speed estimation

Mathematical topics

MOTA = 1 − (FN + FP + IDSW) / GTIDP, IDR, and harmonic-mean IDF1HOTA as balanced detection and association qualityPixel displacement versus calibrated world speedRuntime, throughput, and per-frame latency

Practice checklist

  • Mark false positives, false negatives, and identity switches on a short sequence
  • Compute a small MOTA and IDF1 example by hand
  • Build a line-crossing counter with duplicate-event prevention
  • Write a research-style tracker recommendation grounded in metrics and scene conditions

Student guidance: complete the notebook in sequence and keep the generated figures, metrics, and written observations.

Open Notebook

Reusable implementation

Common Tracking Workflow

The workflow stays detector-independent; YOLO26 is the example observation source in the notebooks.

Twelve-step tracking workflow

From video input to temporal analytics

  1. 1Load or train an object detector.
  2. 2Read frames from a video source.
  3. 3Detect objects in each frame.
  4. 4Predict existing track states.
  5. 5Calculate detection-to-track similarity.
  6. 6Solve the assignment problem.
  7. 7Update matched tracks.
  8. 8Initialize unmatched detections.
  9. 9Retain or remove unmatched tracks.
  10. 10Save identities and trajectories.
  11. 11Evaluate tracking performance.
  12. 12Build temporal analytics.

Project folder structure

Notebooks, trackers, outputs, and reusable source modules

tracking-course/
├── data/
│   ├── videos/
│   ├── detections/
│   └── annotations/
├── models/
│   └── yolo26n.pt
├── trackers/
│   ├── sort/
│   ├── bytetrack/
│   ├── deepsort/
│   ├── botsort/
│   └── ocsort/
├── notebooks/
│   ├── TR-01-Tracking-Fundamentals-and-Kalman-Filtering.ipynb
│   ├── TR-02-Data-Association-SORT-and-ByteTrack.ipynb
│   ├── TR-03-Appearance-Occlusion-and-Robust-Tracking.ipynb
│   └── TR-04-MOT-Evaluation-and-Video-Analytics.ipynb
├── outputs/
│   ├── videos/
│   ├── trajectories/
│   ├── metrics/
│   └── analytics/
└── src/
    ├── detector.py
    ├── motion.py
    ├── association.py
    ├── track.py
    ├── visualization.py
    ├── evaluation.py
    └── analytics.py

Prerequisites

Knowledge expected before starting the series

  • Python
  • NumPy
  • Basic OpenCV
  • Bounding boxes
  • Intersection over Union
  • Object detection
  • Matrix multiplication
  • Probability fundamentals
  • Basic linear algebra

Kalman filtering, Hungarian assignment, and re-identification are taught inside this series—not required beforehand.

Series Assessment

Nine required practical and analytical deliverables

  • One Kalman-filter motion-prediction experiment
  • One numerical association-matrix exercise
  • One SORT or ByteTrack implementation
  • One motion-versus-appearance tracker comparison
  • One occlusion and identity-switch analysis
  • One MOT evaluation table
  • One trajectory visualization
  • One line-crossing counter
  • One research-style tracker recommendation