Code Samples

Open in ClaudeOpen in ChatGPT

The ZED SDK provides multiple code examples to facilitate your learning experience with spatial perception and AI. All of these samples can be found on the Stereolabs GitHub page.

If you need assistance with building the examples, you can refer to the API Language section of the documentation for detailed instructions on how to set up your development environment.

If you haven’t already, we recommend checking out our tutorials first. These resources can provide valuable information to help you get started with the ZED SDK.

SampleDescriptionLink
Camera ControlAdjust video settings (brightness, contrast, saturation, hue, sharpness, gamma, gain, exposure, white balance, LED) and display the resulting image.GitHub
Camera StreamingStream ZED video over the network — single or multiple senders, a receiver, encoded passthrough, and H.264 record-while-send — for remote viewing or processing.GitHub
Depth SensingExtract and visualize depth maps and point clouds, with variants for multi-camera capture, region of interest, image refocus, custom depth ingestion, and fusion.GitHub
Positional TrackingDisplay the live position and orientation of the camera in a 3D window, and export tracking data to FBX.GitHub
Object DetectionDetect and track objects in 3D — bird’s-eye and image viewers, concurrent detection with body tracking, custom detectors (YOLO/Ultralytics), and multi-camera fusion.GitHub
Body TrackingDetect and track 3D human body skeletons, export the data to FBX/JSON, integrate with Unity/Unreal Engine, or fuse multiple cameras for whole-space tracking.GitHub
Spatial MappingCapture a live 3D mesh or fused point cloud of the environment, with a multi-camera fusion variant for larger spaces.GitHub
Plane DetectionDetect the floor plane and arbitrary planar surfaces in the scene, either automatically or via hit-testing.GitHub
RecordingRecord and play back SVO files — single or multi-camera, with external/sensor data — and export SVO content to common video, image and sensor file formats.GitHub
Global LocalizationFuse a real GNSS receiver with the camera’s visual-inertial odometry for global-scale localization, with live, recording, playback and map-server samples.GitHub
Sensors APIManage multiple ZED cameras, ZED X One cameras and LiDARs through a single unified API, live or from recordings, with an interactive multi-sensor placement/calibration tool.GitHub
Virtual StereoPair two ZED X One monocular cameras into a calibrated virtual stereo rig to compute depth from two independent mono sensors.GitHub
ZED X OneCapture, stream, record and run AI inference with the ZED X One monocular camera.GitHub