Body Tracking Overview

Open in ClaudeOpen in ChatGPT

The body tracking module focuses on a person’s bones detection and tracking. A detected bone is represented by its two endpoints also called keypoints. The ZED camera can provide 2D and 3D information on each detected keypoints. Furthermore, it produces local rotation between neighbor bones.

How It Works

The overall process is very similar to the ZED SDK Object detection module. They share some information in outputs like the 3D position and 3D velocity of each person. The body tracking module also uses a neural network for keypoints detection and then calls depth and positional tracking of the ZED SDK module to get the final 3D position of each keypoint. The ZED SDK supports multiple body formats :

The BODY_18 body format contains 18 keypoints following the COCO18 skeleton representation

image

Each keypoint is indexed by an integer from 0 to 17 :

keypoint indexkeypoint namekeypoint indexkeypoint name
0NOSE9RIGHT_KNEE
1NECK10RIGHT_ANKLE
2RIGHT_SHOULDER11LEFT_HIP
3RIGHT_ELBOW12LEFT_KNEE
4RIGHT_WRIST13LEFT_ANKLE
5LEFT_SHOULDER14RIGHT_EYE
6LEFT_ELBOW15LEFT_EYE
7LEFT_WRIST16RIGHT_EAR
8RIGHT_HIP17LEFT_EAR

The ZED SDK can output 3 levels of information: raw 2D/3D body detection, 3D body tracking and 3D body fitting.

2D/3D Body detection

The ZED SDK first uses the ZED camera image to infer all 2D bones and keypoints using neural networks. Then the SDK depth module and positional tracking module are used together to extract the correct 3D position of each bone and keypoint.

3D body tracking

If tracking is enabled, the ZED SDK will assign an identity to each detected body over time. At the same time, by filtering the raw body detection, it will output a more stable 3D body estimation.

3D body fitting

Moreover, a user can enable fitting to unlock even more information about each identity. The fitting process takes the history of each tracked person to deduce all missing keypoints thanks to the human kinematic’s constraint used by the body tracking module. It is also able to extract local rotation between a pair of neighbor bones by solving the inverse kinematic problem. These data will be compatible with some known software for avataring for example. Here is an example where BODY_FORMAT::BODY_34 were used to animate an avatar in Unreal.

Detection Outputs

Each detected person is stored as a structure in the ZED SDK called sl.BodyData.

Body DataDescriptionOutput
IDFixed ID for identifying an object over time.Integer
Unique Object IDUnique id to help identify and track AI detections.String
Tracking stateDefines if an object is currently tracked or lost.Ok, Off, Searching, Terminate
Action stateDefines if an object is currently idle or moving.Idle, Moving
PositionProvides the 3D position of the object according to the camera as a 3D vector (x,y,z).[x, y, z]
VelocityProvides the velocity of the object in space as a 3D vector (x,y,z).[vₓ, vᵧ, v_z]
Position covarianceCovariance matrix of the 3D position.array of 6 values
2D bounding boxDefines the box surrounding the object in the image represented as four 2D points.Four pixel coordinates
MaskProvides the pixels which really belong to the object and those of the background.Binary mask
Detection confidenceA lower confidence means the object might not be localized perfectly or that its label is uncertain.0 - 100
3D bounding boxDefines the box surrounding the object in space represented as eight 3D points.Eight 3D coordinates
DimensionsProvides the width, height and length of the object.[width, height, length]
2D keypointA set of useful points representing the human body, expressed in 2D.a vector of [x, y]
KeypointA set of useful points representing the human body, expressed in 3D.a vector of [x, y, z]
2D head bounding boxBounds the head with four 2D points.Four pixel coordinates
3D head bounding boxBounds the head with eight 3D points.Eight 3D coordinates
Head position3D head centroid[x, y, z]
Keypoint confidencePer keypoint detection confidencea vector of float
Keypoint covariancePer keypoint covariancea vector of 6 values array
Local position per jointLocal position of each keypointa vector of [x, y, z]
Local orientation per jointLocal rotation of each keypointa vector of [x, y, z, w]
Global root orientationGlobal root orientation of the Body[x, y, z, w]

For more information on Body Tracking, see the Using the API page.