DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Point Cloud Range Image Creation

This tutorial demonstrates how to generate 2D image from accumulated point cloud.

To initialize the module, one can start from the default parameter:

dwPCRangeImageCreator_initialize(&rangeImageCreator, &params, context);
dwPCRangeImageCreator_setCUDAStream(stream, rangeImageCreator);
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_getDefaultParams(dwPointCloudRangeImageCreatorParams *const params)
Gets default range image creator parameters.
struct dwPointCloudRangeImageCreatorObject * dwPointCloudRangeImageCreatorHandle_t
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_setCUDAStream(cudaStream_t const stream, dwPointCloudRangeImageCreatorHandle_t const obj)
Sets CUDA stream of range image creator.
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_initialize(dwPointCloudRangeImageCreatorHandle_t *const obj, dwPointCloudRangeImageCreatorParams const *const params, dwContextHandle_t const ctx)
Initializes range image creator.
Defines point cloud range image creator parameters.

It is expected that application allocates output image and to be successful it should have valid properties.

dwImageProperties imageProperties{};
dwPCRangeImageCreator_getImageProperties(&imageProperties, memoryType, rangeImageCreator);
dwImageHandle_t rangeImage{};
dwImage_create(&rangeImage, imageProperties, context);
struct dwImageObject * dwImageHandle_t
Definition: Image.h:110
DW_API_PUBLIC dwStatus dwImage_create(dwImageHandle_t *const image, dwImageProperties properties, dwContextHandle_t const ctx)
Creates and allocates resources for a dwImageHandle_t based on the properties passed as input.
Defines the properties of the image.
Definition: Image.h:397
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_getImageProperties(dwImageProperties *const imageProperties, dwConstPointCloudRangeImageCreatorHandle_t const obj)
Get properties of an image to bind as an output.

If the input is an organized point cloud:

dwPCRangeImageCreator_bindInput(organizedPointCloud, rangeImageCreator);
dwPCRangeImageCreator_bindOutput(rangeImage, rangeImageCreator);
dwPCRangeImageCreator_process(rangeImageCreator);
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_bindInput(dwPointCloud const *const pointCloud, dwPointCloudRangeImageCreatorHandle_t const obj)
Binds input point cloud to range image creator.
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_bindOutput(dwImageHandle_t const image, dwPointCloudRangeImageCreatorHandle_t const obj)
Binds output range image to range image creator.
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_process(dwPointCloudRangeImageCreatorHandle_t const obj)
Organizes input point cloud and projects on the spherical coordinate to form a range image.

The result image is expected to have the same memory type. Moreover, the total pixel count of the range image should be equivalent to the input organized point cloud size. That is rangeImage.widht * rangeImage.height == organizedPointCloud.size.

If the input is an unorganized point cloud, user can bind two outputs

dwPCRangeImageCreator_bindInput(unorganizedPointCloud, rangeImageCreator);
dwPCRangeImageCreator_bindOutput(rangeImage, rangeImageCreator);
dwPCRangeImageCreator_bindPointCloudOutput(organizedPointCloud, rangeImageCreator);
dwPCRangeImageCreator_process(rangeImageCreator);
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_bindPointCloudOutput(dwPointCloud *const pointCloud, dwPointCloudRangeImageCreatorHandle_t const obj)
Binds output point cloud to range image creator.

The module not only outputs the range image but also an organized point cloud which satifies rangeImage.widht * rangeImage.height == organizedPointCloud.size.

To release the module,

dwPCRangeImageCreator_release(rangeImageCreator);
DW_API_PUBLIC dwStatus dwPCRangeImageCreator_release(dwPointCloudRangeImageCreatorHandle_t const obj)
Releases range image creator.

For more details see Point Cloud Processing Sample