Hi,
I am currently working with two ZED X One cameras configured in a calibrated stereo rig, using SDK version 5.0.0 (early access). My goal is to save the unrectified left and right images, along with the corresponding point cloud and confidence map, for later post-processing.
Here is the relevant part of the implementation:
init_params.depth_mode = sl::DEPTH_MODE::NEURAL;
init_params.coordinate_units = sl::UNIT::MILLIMETER;
init_params.depth_minimum_distance = 1500;
init_params.depth_maximum_distance = 10000;
auto frame_start_time = std::chrono::high_resolution_clock::now();
auto timestamp = zed.getTimestamp(sl::TIME_REFERENCE::IMAGE).getNanoseconds();
// === Retrieve images
zed.retrieveImage(image_left, sl::VIEW::LEFT_UNRECTIFIED);
zed.retrieveImage(image_right, sl::VIEW::RIGHT_UNRECTIFIED);
// === Retrieve measures
zed.retrieveMeasure(confidence_map, sl::MEASURE::CONFIDENCE);
zed.retrieveMeasure(pointcloud_xyzrgba, sl::MEASURE::XYZRGBA);
// Save left image
std::ofstream left_file((folder_path / "raw" / "left" / (std::to_string(timestamp) + "_unrectified.bin")).string(), std::ios::binary);
left_file.write(reinterpret_cast<char*>(image_left.getPtr<sl::uchar1>(sl::MEM::CPU)), image_left.getWidth() * image_left.getHeight() * 4);
left_file.close();
// Save right image
std::ofstream right_file((folder_path / "raw" / "right" / (std::to_string(timestamp) + "_unrectified.bin")).string(), std::ios::binary);
right_file.write(reinterpret_cast<char*>(image_right.getPtr<sl::uchar1>(sl::MEM::CPU)), image_right.getWidth() * image_right.getHeight() * 4);
right_file.close();
Since both cameras are hardware-synchronized via a capture card, I assume that the timestamp
obtained using zed.getTimestamp(sl::TIME_REFERENCE::IMAGE)
is valid for both the left and right unrectified images.
However, I couldn’t find any documentation clarifying whether this same timestamp also applies to the retrieved point cloud and confidence map. From what I understand, they are derived from the current stereo image pair, so I would expect them to share the same timestamp — but I would appreciate confirmation on this.
Could you please provide clarification or official guidance on which timestamp should be assigned to the point cloud and confidence map for proper synchronization?
Thank you in advance for your support!