> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.stereolabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.stereolabs.com/_mcp/server.

# Samples - Depth Sensing

This section contains samples demonstrating how to use the ZED camera's [Depth Sensing](/docs/development/zed-sdk/modules/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](https://www.stereolabs.com/developers/).
* Download the [Depth Sensing](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing) 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/depth%20sensing)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/multi%20camera)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/automatic%20region%20of%20interest)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/manual%20region%20of%20interest)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/image%20refocus)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/export)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/custom%20depth)

### Fusion

Shows how to combine depth and positional data from several cameras through the Fusion API, using the calibration produced by [ZED360](/docs/development/zed-tools/zed-360). *(C++)*

[GitHub](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/fusion)

### 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](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/voxel%20point%20cloud)