Main Content

pcalign

Align an array point clouds

Description

example

ptCloudOut= pcalign(ptClouds,tforms)aligns an array of point clouds,ptClouds, into one point cloud by using the specified transformationstforms.

example

ptCloudOut= pcalign(ptClouds,tforms,gridStep)applies a box grid filter, with 3-D boxes of the specified sizegridStep, to the aligned point cloud. Points within the same box are merged to a single point in the output, with averagedColor,Normal, andIntensityproperties.

Examples

collapse all

Load a point cloud view set into the workspace.

data = load('vSetPointClouds.mat'); vSet = data.vSet;

Extract the point clouds and their absolute poses from the view set.

ptClouds = vSet.Views.PointCloud; tforms = vSet.Views.AbsolutePose;

Align the point clouds using their absolute poses, and apply a 3-D box filter of size1to the aligned point cloud.

gridStep = 1; ptCloudMap = pcalign(ptClouds,tforms,gridStep);

Display the aligned point cloud map.

pcshow(ptCloudMap) holdonplot(vSet)

Input Arguments

collapse all

Point clouds, specified as apointCloudarray.

3-D rigid or affine geometric transformations, specified as anM-by-1rigid3darray or anM-by-1affine3darray. Thetforms参数必须控制ain the same number of elements as theptCloudsargument.

Size of the 3-D box for the grid filter, specified as a positive scalar. Increasing the value ofgridStepcan reduce memory usage by merging more points, but it can also reduce the amount of detail captured.

Data Types:single|double

Output Arguments

collapse all

Aligned point cloud, returned as apointCloudobject.

Tips

  • If the input point clouds do not all have an assigned value for a property, the function does not assign a value for that property in the returned point cloud. For example, if some of the input point clouds have values for theColorproperty but another one does not, then the function does not return a value for theColorproperty ofptCloudOut.

  • The function filters out points withNaNorInfvalues.

Extended Capabilities

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

Introduced in R2020b