Tutorial - Using Human Body Tracking
Tutorial - Using Human Body Tracking
This tutorial shows how to use your ZED 3D camera to detect and track human bodies using the ZED Body Tracking module.
Getting Started
- First, download the latest version of the ZED SDK.
- Download the Body Tracking sample code in C++, Python or C#.
Code Overview
Open the camera
In this tutorial, we will use the Body Tracking AI module of the ZED SDK. As in previous tutorials, we create, configure and open the camera.
Enable 3D Object detection
Before enabling body tracking, we specify the BodyTrackingParameters of the module.
Body tracking needs positional tracking to be able to track the bodies in the world reference frame.
Then we can start the module, it will load the model. This operation can take a few seconds. The first time the module is used, the model will be optimized for the hardware and will take more time. This operation is done only once.
Capture Data
The object confidence threshold can be adjusted at runtime to select only the relevant skeletons depending on the scene complexity. Since the parameters have been set to image_sync, for each grab call, the image will be fed into the AI module and will output the detections for each frame.
Disable modules and exit
Once the program is over the modules can be disabled and the camera closed. This step is optional since the zed.close() will take care of disabling all the modules. This function is also called automatically by the destructor if necessary.
And this is it!

