点云下采样和使用 PCL 进行正态估计
Point cloud Downsampling and normal estimation with PCL
我正在研究下采样点云和正态估计。正常的估计对我很好,并且也进行了缩减采样;但是,当它们组合在一起时,它们不起作用,我收到这个: (核心倾倒(。下面是我的代码。感谢任何帮助?
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);
它为我解决了;我将搜索半径从0.03
更改为0.3
,因为0.03
由于缩减采样,没有点云数据。
相关文章:
- 如何用RISC-V GD32VF103CBT6开发板卸载精确的ADC过采样
- 如何获取pcl迭代最近点(ICP)的迭代点数?
- 将 PCL 链接到 Cython C++ 模块
- 如何使用采样器立方体作为数组
- PCL:当我在setConditionFunction中使用std::bind 时,没有合适的转换函数
- PCL octree std::bad_alloc c++
- 在点云库 (PCL) 中使用自定义点类型的问题
- PCL 出错:体系结构x86_64 @pcl的未定义符号
- PCL:将两个点云缩放到相同的大小
- 多重采样背景不显示
- 如何从wav文件中获取采样率?
- 在同一项目中使用 CGAL 和 PCL
- PCL 中的 GICP 用法
- 退出 PCL 查看器:即使窗口已关闭,wasStop() 也不会更改值
- 如何对0,1,..中的k个随机数进行采样..,n-1,而不缓存到数组
- 使用pcl transformcloud将三维点平移并旋转到原点
- 使用pcl库设置错误
- 如何在ROS中使用PCL可视化动力学数据的表面法线
- 点云下采样和使用 PCL 进行正态估计
- 使用哪个 pcl 滤波器对点云进行下采样