測試效果
簡介
在點云庫(Point Cloud Library,PCL)中,處理點云數據時,經常需要去除局部最大點(Local Maximum),這通常用于去除噪聲、提取特定形狀的特征或者簡化點云數據。局部最大點指的是在局部區域內,其高度(或某個特定維度上的值)高于其鄰近點的點。
測試代碼
pcl::PointCloud<pcl::PointXYZ>::Ptr source(new pcl::PointCloud<pcl::PointXYZ>);source = PCL_Common::K_ReadPcdData("D:\\1_Kita\\peizhun_PCD\\1.pcd");PCL_Common::K_ShowCloud(source, 2);pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_out(new pcl::PointCloud<pcl::PointXYZ>);pcl::LocalMaximum<pcl::PointXYZ> lm;lm.setInputCloud(source);lm.setRadius(5.0f);//設置用于確定一個點是否為局部最大值的半徑lm.filter(*cloud_out);//調用濾波方法并返回濾波后的點云PCL_Common::K_ShowCloud(cloud_out,2);