3dcomputer-visionpoint-cloud-librarypoint-cloudslidar-data

how to remove outlier points in PCL for region grow based surface detection


I am using PCL to detect surface in my lidar point cloud, and I have the configuration as below:

pcl::RegionGrowing<pcl::PointXYZ, pcl::Normal> reg;
reg.setMinClusterSize(static_cast<int>(100));
reg.setMaxClusterSize(static_cast<int>(1000));
reg.setSearchMethod(new pcl::search::KdTree<pcl::PointXYZ>);
reg.setNumberOfNeighbours(30);
reg.setInputCloud(point_cloud);
reg.setInputNormals(normals);
reg.setSmoothnessThreshold(6_deg);
reg.setCurvatureThreshold(1.0);

It works fine, except I found it picks up some outlier points as shown in the image below.

I was trying to detect a plane that comes with a leg, and it seems that the method picks up some point on the leg. Is there away to avoid such point using, e.g., density threshold in the region growing method in PCL? After spending some time on the documentation and tweaking the values for region grow setups I still could not figure out how to do it.

outlier point


Solution

  • RegionGrowing doesn't take into consideration the distance of the "candidatee" points. The inclusion decision is based on the normal data, while the actual candidates result from K nearest neighbours query.

    So one option you have is to reduce the NumberOfNeighbours parameter. This is the simplest, which will only work partially, as it doesn't address the problem (point distance) directly. In your posted example you would probably need to reduce it to about 6. This could result in overall worse results for the segmentation and you might still have outliers elsewhere.

    A better solution is to use radius outliers removal as a postprocessing step to filter each of regions you got from RegionGrowing.

    http://pointclouds.org/documentation/tutorials/remove_outliers.php