DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Point Cloud Plane Extraction

This tutorial demonstrates how to estimate one 3D plane.

To initialize the module,

dwPCPlaneExtractor_initialize(&estimator, &params, context);
struct dwPointCloudPlaneExtractorObject * dwPointCloudPlaneExtractorHandle_t
DW_API_PUBLIC dwStatus dwPCPlaneExtractor_setCUDAStream(cudaStream_t const stream, dwPointCloudPlaneExtractorHandle_t const obj)
Sets CUDA stream of point cloud plane extractor.
DW_API_PUBLIC dwStatus dwPCPlaneExtractor_getDefaultParameters(dwPointCloudPlaneExtractorParams *const params)
Gets default point cloud plane extractor parameters.
DW_API_PUBLIC dwStatus dwPCPlaneExtractor_initialize(dwPointCloudPlaneExtractorHandle_t *const obj, dwPointCloudPlaneExtractorParams const *const params, dwContextHandle_t const ctx)
Initializes point cloud plane extractor.
Defines plane extraction parameter.

The plane estimation is based on ransac fitting and non-linear optimization. User can tailor params.ransacIterationCount and params.optimizerIterationCount to fulfill the expected performance. params.rotation gives the initial guess on the transformation from the point cloud to the 3D plane. params.boxFilterParams controls box filter parameters applied before ransac is executed. User is able to vary size of an area and number of points picked for ransac algorithm to make it working more effectively. If params.cudaPipelineEnabled = true, the module expects CUDA memory type point cloud.

To get the estimated 3D plane,

dwPCPlaneExtractor_bindInput(pointCloud, estimator);
dwPCPlaneExtractor_bindOutput(inliers, outliers, plane, estimator);
DW_API_PUBLIC dwStatus dwPCPlaneExtractor_process(dwPointCloudPlaneExtractorHandle_t const obj)
Extracts 3D ground plane and stores the results to output buffer.
DW_API_PUBLIC dwStatus dwPCPlaneExtractor_bindOutput(dwPointCloud *const inliers, dwPointCloud *const outliers, dwPointCloudExtractedPlane *const outputPlane, dwPointCloudPlaneExtractorHandle_t const obj)
Binds output buffers to point cloud plane extractor.
DW_API_PUBLIC dwStatus dwPCPlaneExtractor_bindInput(dwPointCloud const *const pointCloud, dwPointCloudPlaneExtractorHandle_t const obj)
Binds point cloud buffer to plane extractor.

inliers is a subset of the input point cloud. It indicates the group that is used for plane estimation. outliers is a subset of the input point cloud but mutual exclusive to inliers. It indicates the group that is not used for plane estimation. It is not guaranteed to get estimated plane for each input point cloud. If plane.valid = false, it means the estimated plane should not be used.

Note: the module does not output inliers and outliers if params.cudaPipelineEnabled = true.

To release the module,

DW_API_PUBLIC dwStatus dwPCPlaneExtractor_release(dwPointCloudPlaneExtractorHandle_t const obj)
Releases point cloud plane extractor.

For more details see Point Cloud Processing Sample