Samples - Depth Sensing

Open in ClaudeOpen in ChatGPT

This section contains samples demonstrating how to use the ZED camera’s Depth Sensing features, from basic depth map extraction to multi-camera capture, region of interest, custom depth ingestion and fusion.

Getting Started

  • First, download the latest version of the ZED SDK.
  • Download the Depth Sensing sample code in C++, Python or C#.

Samples in this category

Depth Sensing

Extracts depth information from a single ZED camera and visualizes the point cloud in an OpenGL window. This is the best starting point for the module. (C++, Python, C#)

GitHub

Multi Camera

Shows how to design an application that uses multiple ZED cameras in separate threads, and displays their RGB images and depth maps in OpenCV. (C++, Python)

GitHub

Automatic Region of Interest

Shows how to use startRegionOfInterestAutoDetection() to have the SDK automatically detect and exclude a fixed region (for example a vehicle bonnet or drone propellers) from all depth-dependent measures. (C++, Python)

GitHub

Manual Region of Interest

Shows how to define an exclusion Region of Interest (ROI) by hand, drawing one or more rectangles with the mouse over the OpenCV image. Pixels outside the ROI are discarded from all modules (depth, positional tracking, detections…). The ROI can be saved to and reloaded from an image file. (C++)

GitHub

Image Refocus

Shows how to apply depth-dependent blur to an image, letting you adjust the focal point after the image has been captured. (C++)

GitHub

Export

Shows how to save both the image and the depth map as PNG files, to later use as input for another application. (C++)

GitHub

Custom Depth

Shows how to feed the ZED SDK with your own disparity/depth estimation instead of one of the built-in depth modes, using DEPTH_MODE::CUSTOM and Camera::ingestCustomDepth(). Once ingested, every depth-dependent feature (point cloud, spatial mapping, object detection 3D boxes, plane detection…) works as usual on top of your own depth data. (C++, Python)

GitHub

Fusion

Shows how to combine depth and positional data from several cameras through the Fusion API, using the calibration produced by ZED360. (C++)

GitHub

Voxel Point Cloud

Shows voxel-decimated 3D point cloud capture, with an interactive OpenGL viewer to adjust voxelization mode (fixed size, stereo-uncertainty based, or linear), voxel size and resolution scale in real time, and to save the decimated cloud to a .ply file. (C++, Python)

GitHub