c++ - 利用PCL数据库进行点云边界识别时, 以下代码运算结果总是0,请问问题出在哪里?针对不同点云,边界估计时的搜索半径如何确定的?
ringa_lee
ringa_lee 2017-04-17 13:48:42
0
1
660
     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_lee
ringa_lee

ringa_lee

membalas semua(1)
Peter_Zhu

此问题已解决.

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan