I am using the SACSegmentation from PCL segmentation module in order to filter out the groundplane.
The method is fitting the front surface of the 3D object instead of fitting the groundplane as shown in 2nd pcd file below.
Any suggestions what should I do in order to fit and filter the ground plane points.
Thanks in advance.
pcl::ModelCoefficients::Ptr coefficients(new pcl::ModelCoefficients);
pcl::SACSegmentation<pcl::PointXYZ> segmentation;
segmentation.setInputCloud(cloudAll);
segmentation.setOptimizeCoefficients(true);
segmentation.setModelType(pcl::SACMODEL_PLANE );
segmentation.setMethodType(pcl::SAC_RANSAC );
segmentation.setDistanceThreshold(20.20);