get road-plane from lidar point cloud in matlab

To extract the road-plane from a lidar point cloud in Matlab, you can use a segmentation approach based on RANSAC algorithm. Here are the steps:

  1. Load the lidar point cloud in Matlab using pcread function.
main.m
pc = pcread('lidar_point_cloud.pcd');
38 chars
2 lines
  1. Create a ground plane estimator object using pcfitplane function.
main.m
ground_plane_estimator = pcfitplane(pc, 0.3);
46 chars
2 lines

Here, 0.3 is the maximum distance threshold between the points and the estimated plane.

  1. Extract the ground plane from the point cloud using select function.
main.m
ground_plane = select(pc, findPointsInROI(pc, ground_plane_estimator));
72 chars
2 lines

findPointsInROI function finds the points within the minimum and maximum distance limits from the ground plane.

  1. Visualize the ground plane.
main.m
pcshow(ground_plane);
22 chars
2 lines

Now you have extracted the road plane from the lidar point cloud in Matlab.

gistlibby LogSnag