Tutorial - Split Process
Tutorial - Split Process
This tutorial shows how to decouple image and depth acquisition using the read() and grab() functions, so images can be retrieved at full frame rate while depth and point cloud measurements are only computed every few frames. The program captures 150 frames, computing depth every 6th frame, and prints the resulting image and depth throughput (FPS). We assume that you have followed the Depth Sensing tutorial before.
Getting Started
- First, download the latest version of the ZED SDK.
- Download the Split Process sample code in C++.
Code Overview
Open the camera
As in previous tutorials, we create, configure and open the ZED, enabling NEURAL depth mode.
Capture images with read(), depth with grab()
In previous tutorials, grab() was called on every iteration to get both the image and the depth. Here, we call zed.read() on every loop to retrieve the left image as fast as possible, and only call zed.grab() (which recomputes depth) every 6 frames — reducing the computational cost when full-rate depth isn’t needed.
read() grabs a new image without recomputing depth, which is significantly cheaper on GPU than grab(). Use this pattern when your application needs images at the sensor’s full frame rate but can tolerate a lower depth-update rate.
For more information on read() and grab(), see Using the Video API.
Report throughput and close the camera
Once 150 frames have been captured, we compute and print the resulting image and depth FPS, then close the camera.

