Merge two 3-D point clouds
Merge Two Identical Point Clouds Using Box Grid Filter
Create a point cloud with X, Y, Z points in [0, 100].
ptCloudA = pointCloud(100*rand(1000,3));
Create a partially overlapping point cloud.
ptCloudB = pointCloud([70 20 30] + 100*rand(1000,3));
Merge the two point clouds using a box filter.
ptCloudOut = pcmerge(ptCloudA, ptCloudB, 1); pcshow(ptCloudOut);
gridStep — Size of 3-D box for grid filter
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. The function divides the space into 3-D
boxes (also known as voxels), of size
gridStep. It then
takes an average of all points contained in each voxel. The result of the
average provides a new point to represent all the points in the voxel for
the merged output.
ptCloudOut — Merged point cloud
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
Points within each grid box are merged by averaging their locations,
colors, and normals. Points outside the overlapped region are untouched.
If the two point clouds do not have the same set of properties filled, such as
Normal, these properties will be cleared in the returned point cloud. For example, if
ptCloudAhas color but
ptCloudBdoes not, then
ptCloudOutwill not contain color.
The function filters out points with