Main Content

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","lcc","HDL64", ...
                   "pointCloud","0001.pcd");
ptCloudUnorg = pcread(fileName);

Specify the horizontal resolution of the lidar sensor.

horizontalResolution = 1024;

Create a lidarParameters object that represents an HDL64E sensor with the specified horizontalResolution and a sweep start angle of 10 degrees.

params = lidarParameters('HDL64E',horizontalResolution,SweepStartAngle=10);

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

       37879           3

Display the size of the converted point cloud. pointCloud objects store organized point clouds as M-by-N-by-3 arrays, whereas they store unorganized point clouds as M-by-3 matrices

size(ptCloudOrg.Location)
ans = 1×3

          64        1024           3

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 less number of valid points.

Extended Capabilities

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

Version History

Introduced in R2021b