Contenido principal

pcorganize

Convert 3-D point cloud into organized point cloud

Since R2021b

Description

ptCloudOut = pcorganize(ptCloudIn,params) converts a 3-D point cloud, ptCloudIn, into an organized point cloud, ptCloutOut, using the sensor parameters, params.

example

Examples

collapse all

Load point cloud data into the workspace.

fileName = fullfile(toolboxdir("lidar"),"lidardata","calibration","pointClouds","01.pcd");
ptCloudUnorg = pcread(fileName);

Visualize the point cloud.

figure
pcshow(ptCloudUnorg)

Figure contains an axes object. The axes object contains an object of type scatter.

Specify the horizontal resolution of the lidar sensor.

horizontalResolution = 1024;

Create a lidarParameters object that represents an Ouster OS1 sensor with the specified horizontalResolution.

params = lidarParameters('OS1Gen1-128',horizontalResolution);

Convert the unorganized point cloud into an organized point cloud.

ptCloudOrg = pcorganize(ptCloudUnorg,params);

Display the dimensions of the input point cloud.

size(ptCloudUnorg.Location)
ans = 1×2

      122155           3

Display the dimensions of the organized point cloud. pointCloud objects store organized point clouds as M-by-N-by-3 arrays, and unorganized point clouds as M-by-3 matrices.

size(ptCloudOrg.Location)
ans = 1×3

         128        1024           3

Visualize the organized point cloud. Use different colors to differentiate each scan line.

figure
pcshow(ptCloudOrg,ColorSource="Row",MarkerSize=20)
colormap("lines")

Figure contains an axes object. The axes object contains an object of type scatter.

Input Arguments

collapse all

Input point cloud data, specified as a pointCloud object.

Lidar sensor parameters, specified as a lidarParameters object. For more information about lidar sensor parameters, see Lidar Sensor Parameters.

Output Arguments

collapse all

Organized point cloud data, returned as a pointCloud object.

Note

Sometimes due to sensor calibration or precision errors, the function output might not exactly match the organized structure of the input point cloud, and the output point cloud might have fewer valid points.

Extended Capabilities

expand all

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

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

Version History

Introduced in R2021b