pcmerge

Merge two 3-D point clouds

Description

example

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

Examples

collapse all

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);

Input Arguments

collapse all

Point cloud A, specified as apointCloudobject.

Point cloud B, specified as apointCloudobject.

Size of 3-D box for grid filter, specified as a numeric value. Increase the size ofgridStepwhen 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 apointCloudobject. 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 bygridStep. Points within each grid box are merged by averaging their locations, colors, and normals. Points outside the overlapped region are untouched.

Tips

  • If the two point clouds do not have the same set of properties filled, such asColororNormal, these properties will be cleared in the returned point cloud. For example, ifptCloudAhas color butptCloudBdoes not, thenptCloudOutwill not contain color.

  • The function filters out points withNaNorInfvalues.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2015a