main Content

fromlidardata

有组织的LiDAR数据的段地面点

Description

例子

GROUNDPTSIDX= segmentGroundFromLidarData(ptcloudsegments organized 3-D lidar data,ptcloud,进入地面和nonground部分。LIDAR传感器必须水平安装,以便在最接近传感器的LiDAR扫描中观察到所有接地点。

GROUNDPTSIDX= segmentGroundFromLidarData(ptcloud,,,,name,Value使用一个或多个名称值对设置属性。将每个属性名称包装在报价中。例如,fromlidardata(ptCloud,'ElevationAngleDelta',5)

Examples

collapse all

Segment ground points and nonground points from an organized lidar point cloud. Create organized point clouds from these segmentations, and display them.

Load an organized lidar, point cloud.

ld =负载('drivingLidarPoints.mat');

Segment ground points from the organized lidar point cloud.

GROUNDPTSIDX= segmentGroundFromLidarData(ld.ptCloud);

创建一个有组织的点云,仅使用选择功能。显示此点云。

groundPtCloud = select(ld.ptCloud,groundPtsIdx); figure pcshow(groundPtCloud)

图包含一个轴对象。轴对象包含类型散点的对象。

Create an organized point cloud containing only the nonground points. Specify a threshold of 0.5 meters.

nongroundptcloud = select(ld.ptcloud,〜clockptsidx,“输出尺寸”,,,,'full');距离= 0.5;[标签,numclusters] = SegmentlidArdAta(nongroundptCloud,Distthreshold);

Display the nonground points cloud clusters.

figure colormap(hsv(numClusters)) pcshow(nonGroundPtCloud.Location,labels) title(“点云簇”

图包含一个轴对象。带有标题点云簇的轴对象包含类型散点的对象。

Load Velodyne PCAP® to the workspace.

velodynefilereaderobj = velodynefilereader(“lidarData_ConstructionRoad.pcap”,,,,'HDL32E');

使用PCPlayer创建点云播放器。定义它X-,y-, 和z-axes limits, in meters, and label its axes.

XLIMITS = [-40 40];ylimits = [-15 15];zlimits = [-3 3];player = pcplayer(Xlimits,Ylimits,Zlimits);

Label the pcplayer axes.

Xlabel(player.axes,'X (m)')ylabel(player.Axes,'Y (m)')zlabel(player.Axes,'z(m)'

Set the colormap for labeling points. Use RGB triplets to specify green for ground-plane points, and red for obstacle points.

颜色= [0 1 0;1 0 0];greenidx = 1;redidx = 2;

Iterate through the first 200 point clouds in the Velodyne PCAP file, usingreadFrame阅读数据。从每个点云分段地面点。为所有地面点染色绿色和nonground点红色。绘制产生的LIDAR点云。

colormap(player.Axes,colors) title(player.Axes,'Segmented Ground Plane of Lidar Point Cloud');为了i = 1 : 200%读取当前框架。ptcloud= velodyneFileReaderObj.readFrame(i);% Create label array.colorLabels = zeros(size(ptCloud.Location,1),size(ptCloud.Location,2));%找到地面点。gruendptsIdx = segmentgroundfromlidardata(ptcloud);%地图颜色地面指向绿色。colorLabels(subporptSidx(:))= greenIdx;% Map color nonground points to red.colorLabels(~groundPtsIdx (:)) = redIdx;% Plot the results.查看(播放器,ptcloud.location,colorlabels)结尾

Figure Point Cloud Player contains an axes object. The axes object with title Segmented Ground Plane of Lidar Point Cloud contains an object of type scatter.

Input Arguments

collapse all

Point cloud, specified as apointCloud目的。ptcloud是存储的有组织的点云[X,,,,y,,,,z]点坐标m-by-n-by-3 matrix.

名称值参数

Example:'ElevationAngleDelta',5

高程角差阈值识别地面点,指定为非负标量。该函数计算一个标记的地面点及其4相关邻居之间的高程角差。如果差异低于阈值,则将邻居点标记为地面。典型的值高程安格尔塔are in the range of [5,15] degrees. Increase this value to encompass more points from uneven ground surfaces.

初始高程角阈值to identify the ground point in the scanning line closest to the lidar sensor, specified as a non-negative scalar. The function marks a point as ground when the elevantion angle falls below this value. Typical values for初始电子在15度和30度的范围内。

输出参数

collapse all

接地点索引,返回m-by-n逻辑矩阵。带有的元素true价值,1,指示地面点。带有的元素错误的价值,0,表示nondround点。

References

[1] Bogoslavskyi, I. “Efficient Online Segmentation for Sparse 3D Laser Scans.”摄影测量,遥感和地球信息科学杂志。Vol. 85, Number 1, 2017, pp. 41–52.

扩展功能

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

在R2018B中引入