Code Samples

The ZED SDK comes with multiple code examples to help you get started. You can find every sample on Stereolabs GitHub.

Samples

Sample Description Link
Camera Control Shows how camera settings like Exposure, Gain, Contrast, Sharpness, etc. can be modified and display the resulting image. C++
Python
Motion Tracking Displays the live position and orientation of the camera in a 3D window. C++
Python
Point Cloud Viewer Displays the live point cloud from the camera in a 3D window. C++
Live 3D Reconstruction Captures a live 3D mesh of the environment and displays it as an overlay on the camera image.
Python version doesn't display images but live statistics of the mesh.
C++
Python
Plane Detector Displays camera image and overlays detected 3D planes on mouse click.
Python version doesn't display images but shows how to detect the floor plane in the scene.
C++
Python
3D Object Detection Detect and track objects in the scene, and display their 3D bounding boxes over the live point cloud. C++
Python
Video Recorder Shows how to record a lossless or compressed video in SVO format. C++
Python
Video Playback Shows how to playback a recorded SVO sequence. C++
Python
Video Export Opens an SVO file and exports its images to image files. Options are available to export AVI files or depth maps. C++
Python
Camera Streaming Sender Opens a camera and streams its images on the network for the Streaming Receiver. C++
Python
Camera Streaming Receiver Opens a networked camera and displays its live 3D point cloud. C++
Python
Multi Camera Shows how to open and use multiple cameras at the same time in an application. C++
Python

Tutorials

Tutorial Description Link
Hello ZED This is the simplest tutorial. It shows how to open a stereo camera and print its serial number in the terminal. C++
Python
Image Capture Shows how to open a stereo camera, capture an image and print its timestamp and image size in the terminal. C++
Python
Depth Perception Shows how to retrieve depth and point cloud of a scene, and print the distance of a given point in the terminal. C++
Python
Motion Tracking Shows how to enable Positional Tracking and get the position and orientation of the camera in real-time. C++
Python
Spatial Mapping Shows how to enable Spatial Mapping and capture a mesh or fused point cloud of the environment. C++
Python
3D Object Detection Shows how to detect objects in a scene and localize them in 3D (ZED 2 only). C++
Python
Using Sensors Shows how to acquire IMU, barometer, magnetometer and temperature data. C++
Python

Integrations

Integration Description Links
ZED OpenCV Shows how to capture image, depth and point cloud and convert them to OpenCV format. C++
Python GitHub
ZED ROS Provides access to ZED data through ROS topics. GitHub
ZED TensorFlow Uses ZED SDK and TensorFlow to detect, classify and locate objects in 3D. Python
ZED PyTorch Uses ZED SDK and PyTorch to detect, segment, classify and locate objects in 3D. Python
ZED Docker Shows how to run the ZED SDK in a Docker container. GitHub DockerHub
ZED Unity Plugin Provides access to ZED SDK features in Unity. GitHub
ZED Unreal Plugin Provides access to ZED SDK features in UE4. GitHub
ZED Matlab Allows to use the ZED and its SDK in Matlab. GitHub
ZED Yolo Uses ZED SDK and YOLO object detection to display the 3D location of objects and people in a scene. C++
Python
ZED OpenPose Uses ZED SDK and OpenPose skeleton detection to display real-time multi-person 3D pose of human bodies. C++
CUDA Interoperability Creates an out-of-focus (bokeh) effect on the camera stream using the depth and a CUDA kernel. C++
ZED OpenGL Shows how to use GPU memory to display camera images and depth using OpenGL. C++
ZED Aruco Shows how to track or relocalize the position of one or multiple cameras using an Aruco marker. C++
ZED PCL Shows how to acquire and display a 3D point cloud with PCL (Point Cloud Library). C++