Maison > Questions et réponses > le corps du texte
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
if (pcl::io::loadPCDFile<pcl::PointXYZ>("mid.pcd",*cloud) == -1)
{
PCL_ERROR("COULD NOT READ FILE mid.pcl \n");
return (-1);
}
pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>);
pcl::PointCloud<pcl::Boundary> boundaries;
pcl::BoundaryEstimation<pcl::PointXYZ,pcl::Normal,pcl::Boundary> est;
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>());
pcl::NormalEstimation<pcl::PointXYZ,pcl::Normal> normEst;
normEst.setInputCloud(cloud);
normEst.setSearchMethod(tree);
// normEst.setRadiusSearch(2);
normEst.setKSearch(10);
normEst.compute(*normals);
est.setInputCloud(cloud);
est.setInputNormals(normals);
// est.setAngleThreshold(90);
est.setRadiusSearch(0.02);
est.setSearchMethod (pcl::search::KdTree<pcl::PointXYZ>::Ptr (new pcl::search::KdTree<pcl::PointXYZ>));
est.compute (boundaries);