Convert 3-D point cloud into organized point cloud
Convert HDL-64E Unorganized Point Cloud into Organized Point Cloud
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;
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.
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
ans = 1×3 64 1024 3
ptCloudIn — Input point cloud data
Input point cloud data, specified as a
ptCloudOut — Organized point cloud data
Organized point cloud data, returned as a
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.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2021b