Merge two 3-D point clouds



ptCloudOut = pcmerge(ptCloudA,ptCloudB,gridStep) returns a merged point cloud using a box grid filter. gridStep specifies the size of the 3-D box for the filter.


collapse all

Create two identical point clouds.

ptCloudA = pointCloud(100*rand(1000,3));
ptCloudB = copy(ptCloudA);

Merge the two point clouds.

ptCloud = pcmerge(ptCloudA,ptCloudB,1);

Input Arguments

collapse all

Point cloud A, specified as a pointCloud object.

Point cloud B, specified as a pointCloud object.

Size of 3-D box for grid filter, specified as a numeric value. Increase the size of gridStep when there are not enough resources to construct a large fine-grained grid.

Data Types: single | double

Output Arguments

collapse all

Merged point cloud, returned as a pointCloud object. The function computes the axis-aligned bounding box for the overlapped region between two point clouds. The bounding box is divided into grid boxes of the size specified by gridStep. Points within each grid box are merged by averaging their locations, colors, and normals. Points outside the overlapped region are untouched.

Extended Capabilities

Introduced in R2015a