1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page pointcloudprocessing_usecase3 Point Cloud Stitching
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 This tutorial shows how to stitch multiple point clouds in a common coordinate system.
9 Assume there are three individual point clouds created and accumulated. You can initialize the module:
12 dwPointCloud accumulatedPointClouds[3];
13 dwPointCloud stitchedPointCloud;
14 dwTransformation3f pointCloudTransformations[3];
16 // allocate memory for individual point cloud and stitched point cloud
19 // accumulate lidar packets to point cloud spin
22 // get transformations for each point cloud
25 dwPointCloudStitcherHandle_t stitcher;
26 dwPointCloudStitcher_initialize(&stitcher, context);
27 dwPointCloudStitcher_setCUDAStream(stream, stitcher);
29 for (uint32_t i = 0; i < 3; i++)
31 dwPointCloudStitcher_bindInput(i, &accumulatedPointClouds[i], pointCloudTransformations[i], stitcher);
34 dwPointCloudStitcher_bindOutput(&stitchedPointCloud, stitcher);
37 There is an ability to apply global transformation to all stitched points. To do this:
40 dwPointCloudStitcher_setGlobalTransformation(&rigToWorld, stitcher);
43 In reality each point cloud was captured in a different timestamp, stitching together would cause motion artifacts.
44 To correct such distortion:
47 dwPointCloudStitcher_enableMotionCompensation(referenceTimestamp, egomotion, stitcher);
48 dwPointCloudStitcher_process(stitcher);
49 cudaStreamSynchronize(stream);
52 `egomotion` is needed to correct the distortion based on the relative egomotion between `referenceTimestamp` and individual point cloud's timestamp.
53 Please see @ref egomotion_usecase1 for egomotion usecase.
56 To release the module:
59 dwPointCloudStitcher_release(stitcher);
62 For more details see @ref dwx_pointcloudprocessing_sample