A CinderBlock for integrating Stereolabs ZED 2i cameras with the Cinder. This block provides easy access to ZED camera features including depth sensing, body tracking, object detection, multi-camera fusion, and network streaming.
- GPU Acceleration: CUDA-GL interop for efficient texture updates
- Cross-Platform: Supports Windows and Linux
- ZED SDK: Version 5.1 or later
- Download from Stereolabs website
- SDK includes CUDA runtime and camera drivers
- Cinder: Latest version (0.9.4dev) from GitHub
- CUDA: Version 11.0 or later (included with ZED SDK)
- ZED Camera: ZED, ZED Mini, ZED 2, ZED 2i, or ZED X
- Visual Studio 2022 or later: With C++ desktop development tools
- The samples are configured to build with a
CUDA_PATHenvironment variable - Build Type:
ReleaseorRelWithDebInforecommended (the ZED SDK itself is not compatible with Debug builds)
- Build Type:
ReleaseorRelWithDebInforecommended (the ZED SDK itself is not compatible with Debug builds)
This cinderblock is designed to be cloned into the /blocks/ directory of your Cinder installation (e.g., Cinder/blocks/Cinder-StereolabsZed). This allows the samples to build unmodified without additional path configuration.
-
Install ZED SDK:
- Download ZED SDK 5.1+ from Stereolabs website
- Run the installer (installs to
C:\Program Files (x86)\ZED SDK\by default) - Set
CUDA_PATHenvironment variable to your CUDA installation (required by the samples) e.g.C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
-
Important: Build Configuration
The ZED SDK libraries are built in Release mode. Mixing Debug and Release builds in C++ can cause crashes and memory corruption. You must build samples using
ReleaseorRelWithDebInfoconfiguration, notDebug.
-
Install ZED SDK:
- Download ZED SDK 5.1+ from Stereolabs website
- Choose the appropriate version for your Ubuntu/CUDA combination
- Run the installer (installs to
/usr/local/zedby default)
chmod +x <downloaded_installer>.run ./<downloaded_installer>.run
-
Important: Build Configuration
Like on Windows, the ZED SDK is built in Release mode. You must use RelWithDebInfo (or Release) when building samples to avoid crashes.
The samples are pre-configured to default to
RelWithDebInfoto match the ZED SDK's build configuration. If you're creating your own projects, always use:cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
-
Build and Run a Sample:
cd Cinder/blocks/Cinder-StereolabsZed/samples/ImageCapture/proj/cmake mkdir build && cd build cmake .. # Uses RelWithDebInfo by default make ./RelWithDebInfo/ImageCapture/ImageCapture
- Use RelWithDebInfo or Release build configuration
- Visual Studio project files available in
samples/<SampleName>/vc2022/directories
- Use
-sflag with make for quiet builds:make -s - Executables built to
Release/<SampleName>/orRelWithDebInfo/<SampleName>/ - You may need to run with sudo for camera access:
sudo ./Release/<SampleName>/<SampleName>
| Sample | Category | Description | Key Features |
|---|---|---|---|
| Controls | Basic | Camera controls and parameter adjustment | Resolution, FPS, depth modes, exposure, gain |
| ImageCapture | Basic | Capture and display camera images | Left/right RGB, CPU-based texture updates |
| ImageCaptureGPU | Basic | GPU-accelerated image capture | CUDA-GL interop, GPU-direct texture updates |
| DepthView | Depth | Visualize depth maps | Depth sensing, CPU-based depth texture |
| DepthViewGPU | Depth | GPU-accelerated depth visualization | CUDA-GL interop for point clouds |
| Body2D | Body Tracking | 2D body tracking visualization | BODY_18/34/38 formats, 2D keypoints |
| Body3D | Body Tracking | 3D body tracking with depth | 3D keypoints, depth-based tracking |
| Object2D | Object Detection | 2D object detection and tracking | Object bounding boxes, classification |
| Object3D | Object Detection | 3D object detection with depth | 3D bounding boxes, position tracking, segmentation masks |
| BodyStreamingSend | Network Streaming | Publish body tracking over network | TCP/IP streaming, Fusion API publisher |
| BodyStreamingReceive | Network Streaming | Receive body tracking from network | TCP/IP subscriber, 3D visualization |
| StreamingVideoSend | Network Streaming | Stream compressed video over network | H.264/H.265 encoding, video streaming |
| StreamingVideoReceive | Network Streaming | Receive and decode network video | H.264/H.265 decoding |
| MultiCamViewer | Multi-Camera | View multiple cameras simultaneously | Multi-camera display, camera selection |
| MultiCamDepthView | Multi-Camera | Multi-camera depth visualization | Multiple depth streams, point clouds |
| MultiCamRegistration | Multi-Camera | Camera registration and calibration | Multi-camera calibration, coordinate alignment |
| BodyFusion | Multi-Camera Fusion | Fuse body tracking from multiple cameras | Body tracking fusion, multi-view |
| ObjectFusion | Multi-Camera Fusion | Fuse object detection from multiple cameras | Object tracking fusion, multi-view |
- ZED Documentation: https://www.stereolabs.com/docs/
- ZED API Reference: https://www.stereolabs.com/docs/api/
- Cinder Documentation: https://libcinder.org/docs/
- Support Forum: https://community.stereolabs.com/