search

Home  >  Q&A  >  body text

c++ - 利用PCL数据库进行点云边界识别时, 以下代码运算结果总是0,请问问题出在哪里?针对不同点云,边界估计时的搜索半径如何确定的?

     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);
ringa_leeringa_lee2806 days ago659

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 13:50:42

    This issue has been resolved.

    reply
    0
  • Cancelreply