Point Cloud Memory Management#

This tutorial demonstrates how point cloud processing creates and destroys CPU/NVIDIA® CUDA® memory.

Point cloud processing provides APIs to create either CPU or CUDA memory.

For example, specify a CUDA memory type:

dwPointCloud pointcloud;
pointcloud.type = DW_MEMORY_TYPE_CUDA;
pointcloud.coordSystem = DW_POINTCLOUD_COORDINATE_SYSTEM_CARTESIAN;

Set .type = ::DW_MEMORY_TYPE_CPU if CPU memory is intended. Initialize capacity in dwPointCloud to indicate the maximum storage:

pointcloud.capacity = 20000;

Create CUDA memory holding up to 20000 cloud of points:

dwPointCloud_createBuffer(&pointcloud);

The created memory holds points. Format of a point is specified with dwPointCloudFormat enum. .size will be zero upon successful memory creation. As it indicates there is currently no active point in the memory. dwPointCloud_createBuffer() will set .organized to false. To understand the difference between .organized = true and .organized = false, see Point Cloud Accumulator

To destroy the allocated CUDA memory:

dwPointCloud_destroyBuffer(&pointcloud);

Note

Point cloud buffers are owned by the application, user can waive the memory copy from the module.

For more details, see Point Cloud Processing Sample.