Main Content

select

Select points in point cloud

Description

example

ptCloudOut= select(ptCloud,indices)返回一个pointCloudobject containing only the points that are selected using linear indices.

ptCloudOut= select(ptCloud,row,column)返回一个pointCloudobject containing only the points that are selected using row and column subscripts. This syntax applies only if the input is an organized point cloud data of sizeM-by-N-by-3.

ptCloudOut= select(___,'OutputSize',outputSize)returns the selected points as apointCloudobject of size specified byoutputSize.

Examples

collapse all

Read a point cloud data into the workspace.

ptCloud = pcread('teapot.ply');

Read the number of points in the point cloud data.

Length = ptCloud.Count;

Select indices within the range [1,Length].

stepSize = 10; indices = 1:stepSize:Length;

Select points specified by the indices from input point cloud. This selection of points downsamples the input point cloud by a factor ofstepSize.

ptCloudB = select(ptCloud,indices);

Display the input and the selected point cloud data.

figure subplot(1,2,1) pcshow(ptCloud) title('Input Point Cloud','Color',[1 1 1]); subplot(1,2,2) pcshow(ptCloudB) title('Selected Points','Color',[1 1 1]);

Figure contains 2 axes objects. Axes object 1 with title Input Point Cloud contains an object of type scatter. Axes object 2 with title Selected Points contains an object of type scatter.

Input Arguments

collapse all

Point cloud, specified as apointCloudobject.

Indices of selected points, specified as a vector.

Row indices, specified as a vector. This argument applies only if the input is an organized point cloud data of sizeM-by-N-by-3.

Column indices, specified as a vector. This argument applies only if the input is an organized point cloud data of sizeM-by-N-by-3.

Size of the output point cloud,ptCloudOut, specified as'selected'or'full'.

  • If the size is'selected', then the output contains only the selected points from the input point cloud,ptCloud.

  • If the size is'full', then the output is same size as the input point cloudptCloud. Cleared points are filled withNaNand the color is set to [0 0 0].

Output Arguments

collapse all

Point cloud, returned as apointCloudobject.

Extended Capabilities

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

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

See Also

|

Introduced in R2015a