GitHub
3 min read
  • Computer Vision
  • Systems
  • Research

SWATE — A multi-camera 3D human tracking system

Design and implementation of a real-time system for multi-person 3D tracking from synchronised cameras, with a focus on accuracy, performance, and robustness.

Table of contents
  1. Overview
  2. System design
    1. Multi-view setup
    2. Pose estimation
    3. 3D reconstruction
  3. Implementation
    1. Camera calibration
    2. Tracking and identity
    3. Optimisation
  4. Results
  5. Takeaways

Overview

SWATE (Socially-Aware AI for Teamwork Enhancement and Training) is a multi-camera 3D human tracking system that reconstructs and tracks several people in real time as 3D skeletons from synchronised USB cameras. It combines multi-view pose estimation, geometric triangulation, and identity tracking to produce consistent 3D trajectories, and is used as the perception backend for a collaborative training platform.

This post covers the system’s design, the main implementation details, and the lessons learned from building and deploying it.

System design

The goal is to estimate the 3D pose of multiple people in a shared space using NN calibrated cameras and to maintain consistent identities over time. The system is organised as a real-time pipeline with three main stages, shown in Figure 1.

  1. Multi-view pose estimation
  2. 3D reconstruction (triangulation)
  3. Tracking (identity & smoothing)
Figure 1: High-level pipeline of the tracking system.

Multi-view setup

We use a set of N=4N = 4 USB cameras placed around the scene, synchronised via a common clock. Each frame is processed independently by a 2D pose estimation modelSidenote:In practice, we use a TensorRT-accelerated version of a YOLO-Pose model, which allows us to run the entire pipeline at ~30 FPS on a single GPU. to detect keypoints, which are then associated across views and triangulated to obtain 3D positions.

python
# Per-frame pipeline (simplified)
keypoints = [model.infer(frame) for frame in frames]
tracks = associate_keypoints(keypoints)
poses_3d = triangulate(tracks, cameras)
smoothed = tracker.update(poses_3d)

Pose estimation

Every camera produces a list of 2D skeletons per frame, each keypoint with a confidence score. Before anything can be triangulated, the detections have to be matched across viewsSidenote:By “multi-view” we mean cameras with overlapping fields of view, enabling triangulation of 3D keypoints from their 2D detections.: which skeleton in camera ii is the same person as which skeleton in camera jj? We score each candidate pair by the symmetric epipolar distance between their keypoints, using the fundamental matrix FijF_{ij} between the two cameras:

d(xi,xj)=dist⁡(xj, Fijxi)+dist⁡(xi, Fij⊤xj)d(\mathbf{x}_i, \mathbf{x}_j) = \operatorname{dist}(\mathbf{x}_j,\, F_{ij}\mathbf{x}_i) + \operatorname{dist}(\mathbf{x}_i,\, F_{ij}^{\top}\mathbf{x}_j)

A low distance means the two detections are consistent with a single point in space.

3D reconstruction

Each matched group of detections is triangulated with a confidence-weighted DLT: every camera contributes two linear constraints per keypoint, scaled by the detector’s confidence wiw_i, and the 3D point is the least-squares solution

X^=arg⁡min⁡∥X∥=1∑i=1Nwi ∥AiX∥2.\hat{\mathbf{X}} = \arg\min_{\lVert \mathbf{X} \rVert = 1} \sum_{i=1}^{N} w_i \, \lVert A_i \mathbf{X} \rVert^2 .

Weighting by confidence lets a camera with a clear view outvote one where the person is half occluded.

Implementation

Camera calibration

Triangulation is only as good as the calibration. I wrote a small calibration library that places every camera in one shared 3D space: intrinsics come from ChArUco boards, with MAD-based outlier rejection on the per-view reprojection errors, and extrinsics from pairwise stereo calibrations chained over a spanning tree of the cameras, with loop-closure checks to catch a bad pair. A RANSAC fit of the floor plane then gives the scene a sensible “up”.

Tracking and identity

Identities have to stay stable as people move around and cross paths. Position-based tracking handles the easy cases; when two people come close, appearance re-identification breaks the tie by comparing hue–saturation histograms of each person with the Bhattacharyya distance. Joint positions are smoothed with a One Euro filter, which removes jitter when someone stands still without adding lag when they move quickly.

Optimisation

The whole loop has to fit in a frame budget. The pose model runs through TensorRT, and the geometry (matching, triangulation, filtering) is vectorised so that its cost stays small next to inference.

Results

The system runs live as a desktop app (Tauri and React, with a FastAPI backend) that shows every tracked person as a 3D skeleton in a Three.js viewer, at around 30 frames per second on a single GPU.

Takeaways

  • Calibration quality bounds everything downstream; checking it (loop closure, outlier rejection) paid off more than any later tuning.
  • Weighting by detector confidence is a cheap way to make triangulation robust to occlusion.
  • Identity tracking needs both geometry and appearance: either alone fails when people cross paths.
Go to About
Go to Projects
Go to Writing
Go to Resume
Toggle theme
Copy email
Open GitHub
Open LinkedIn
Subscribe (Atom feed)

↑↓ navigate · ↵ open · Ctrl↵ new tab · esc close