【问题标题】:Point cloud Downsampling and normal estimation with PCL使用 PCL 进行点云下采样和正态估计
【发布时间】:2019-09-03 10:29:47
【问题描述】:

我正在研究下采样点云和法线估计。正常的估计对我来说很好,也可以进行下采样;但是,当它们结合在一起时,它们不起作用,我收到以下信息: (核心转储)。下面是我的代码。任何帮助表示赞赏?

pcl::PCLPointCloud2 pcl_pc2;
pcl::PointCloud<pcl::PointXYZ>::Ptr temp_cloud2(new    pcl::PointCloud<pcl::PointXYZ>);

pcl_conversions::toPCL(*input,pcl_pc2);

pcl::PointCloud<pcl::PointXYZ>::Ptr temp_cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::fromPCLPointCloud2(pcl_pc2,*temp_cloud);

// Perform the actual filtering
pcl::VoxelGrid<pcl::PointXYZ> sor;
sor.setInputCloud (temp_cloud);
sor.setLeafSize (0.1f, 0.1f, 0.1f);
sor.filter (*temp_cloud2); 

//do stuff with temp_cloud here
pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;
ne.setInputCloud (temp_cloud2);

// Create an empty kdtree representation, and pass it to the normal estimation object.
// Its content will be filled inside the object, based on the given input dataset (as no other search surface is given).
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ> ());
ne.setSearchMethod (tree);

// Output datasets
pcl::PointCloud<pcl::Normal>::Ptr cloud_normals (new pcl::PointCloud<pcl::Normal>);

// Use all neighbors in a sphere of radius 3cm
ne.setRadiusSearch (0.03);

// Compute the features
ne.compute (*cloud_normals);

【问题讨论】:

    标签: c++ ros point-cloud-library normals downsampling


    【解决方案1】:

    这对我来说已经解决了;我已将搜索半径从0.03 更改为0.3,因为在0.03,由于下采样,没有点云数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 2016-10-17
      • 1970-01-01
      相关资源
      最近更新 更多