Point Cloud Capture Process
Note
The point cloud capture process has significantly changed with Zivid SDK 2.9. To see the process for an earlier SDK version, change the Knowledge Base version in the top left corner.
The capture API returns when the acquisition is done. This is the moment in time when the camera completes capturing raw images.
const auto frame = camera.capture(settings);
using (var frame = camera.Capture(settings))
with camera.capture(settings) as frame:
The API to get the point cloud returns at some moment in time before or at the moment the point cloud processing is done. This depends on the GPU (vendor and driver). Therefore, after the point cloud API returns, the point cloud processing might still be running in the background. The point cloud object holds a handle to the point cloud data in GPU memory.
Note
The API to get the point cloud does not trigger point cloud processing; that happens automatically with the capture API.
Tip
Use recommended hardware to minimize computation time.
const auto pointCloud = frame.pointCloud();
var pointCloud = frame.PointCloud;
point_cloud = frame.point_cloud()
Tip
For optimized timing, move the robot or move the objects in the scene after the capture API returns. This has to happen before or at the same time when calling the API to get the point cloud.
We need to call the API to copy the point cloud from the GPU memory to the CPU memory. The copy function will block and wait until the data is available before copying it. When the function returns, the data is available and ready for use in CPU memory.
Note
Even if using a CPU with an integrated GPU, the data is copied to a different area on the same main RAM.
const auto data = pointCloud.copyData<Zivid::PointXYZColorRGBA>();
var pointCloudData = pointCloud.CopyPointsXYZColorsRGBA();
xyz = point_cloud.copy_data("xyz")
rgba = point_cloud.copy_data("rgba")
When the point cloud is available on the CPU memory, we can utilize it in our machine vision application.
Performance Considerations
Read our Performance Considerations to learn how to utilize Zivid SDK to optimize your application for speed with regards to the point cloud capture process. Here we cover:
Version History
SDK |
Changes |
---|---|
2.9.0 |
Capture function returns when the acquisition is done and improved capture speed. |
2.8.0 |
Improved capture speed of Zivid Two. |