Our webinar Getting your point cloud ready for your application partly covers Downsample.
This article introduces a concept of downsampling, explains why it is valuable and demonstrates how to downsample a Zivid point cloud.
Zivid 2+ cameras use a sensor with 5 MP (2448 x 2048) to capture point clouds of a scene. The point cloud consists of XYZ (3D), RGB (color), and SNR data. The generated point cloud consists of 5 million points.
Zivid 2 cameras use a sensor with 2.3 MP (1944 x 1200) to capture point clouds of a scene. The point cloud consists of XYZ (3D), RGB (color), and SNR data. The generated point cloud consists of 2.3 million points.
Zivid One+ cameras use a sensor with 2.3 MP (1920 x 1200) to capture point clouds of a scene. The point cloud consists of XYZ (3D), RGB (color), and SNR data. The generated point cloud consists of 2.3 million points.
Some applications do not require high-density point cloud data. Examples are box detection by fitting a plane to the box surface and CAD matching, where the object has distinct and easily identifiable features. In addition, this amount of data is often too large for machine vision algorithms to process with the speed required by the application. It is such applications where point cloud downsampling comes into play.
Downsampling in point cloud context is the reduction in spatial resolution while keeping the same 3D representation. It is typically used to transform the data to a more manageable size and thus reduce the storage and processing requirements.
The size or resolution (density) of the point cloud is too large.
Downsample the Zivid point cloud to reduce its size and resolution.
This article discusses downsampling applied during post-processing; for a hardware-based subsampling method that reduces resolution and, by that, also the capture time, please refer to the Monochrome Capture.
Downsampling can be done in-place, which modifies the current point cloud.
It is also possible to get the downsampled point cloud as a new point cloud instance, which does not alter the existing point cloud.
auto downsampledPointCloud = pointCloud.downsampled(Zivid::PointCloud::Downsampling::by2x2);
var downsampledPointCloud = pointCloud.Downsampled(Zivid.NET.PointCloud.Downsampling.By2x2);
downsampled_point_cloud = point_cloud.downsampled(zivid.PointCloud.Downsampling.by2x2)
Zivid SDK supports the following downsampling rates:
by4x4, with the possibility to perform downsampling multiple times.
Downsample API in Zivid SDK is fast because it is done on the GPU, in parallel, while the point cloud data is still on the GPU memory. Downsample implementations with third-party libraries are likely more time-consuming: CPU computations are much slower in general, and GPU computations require another copy. See Point Cloud Capture Process for more info.
Use Downsample API in combination with transform and normals APIs for performance reasons because GPU performs all these computations while the point cloud data is still on the GPU memory.
For the fastest implementation, first, downsample the point cloud, then transform it.
To downsample a point cloud, you can run our code sample.
python /path/to/downsample.py --zdf-path /path/to/file.zdf
To learn more about how downsampling can be done and why it is not trivial, check out our reference article Downsampling Theory.
Monochrome Capture introduces a faster alternative to downsampling.
Downsampling API is added.