表面重建错误 - PCL 1.6
Surface reconstruction error - PCL 1.6
我完全按照我在这里找到的教程进行操作,对输入进行了一些修改。那么我的代码是:
#include <common/common.h>
#include <io/pcd_io.h>
#include <features/normal_3d_omp.h>
#include <surface/mls.h>
#include <surface/poisson.h>
#include <pcl/io/vtk_io.h>
using namespace pcl;
int main (int argc, char **argv)
{
if (argc != 1)
{
PCL_ERROR ("Syntax: %s input.pcd output.plyn", argv[0]);
return -1;
}
PointCloud::Ptr cloud (new PointCloud ());
io::loadPCDFile ("ism_test_cat.pcd", *cloud);
MovingLeastSquares mls; mls.setInputCloud (cloud);
mls.setSearchRadius (0.01);
mls.setPolynomialFit (true);
mls.setPolynomialOrder (2);
mls.setUpsamplingMethod (MovingLeastSquares::SAMPLE_LOCAL_PLANE);
mls.setUpsamplingRadius (0.005);
mls.setUpsamplingStepSize (0.003);
PointCloud::Ptr cloud_smoothed (new PointCloud ());
mls.process (*cloud_smoothed);
NormalEstimationOMP ne;
ne.setNumberOfThreads (8);
ne.setInputCloud (cloud_smoothed);
ne.setRadiusSearch (0.01);
Eigen::Vector4f centroid;
compute3DCentroid (*cloud_smoothed, centroid);
ne.setViewPoint (centroid[0], centroid[1], centroid[2]);
PointCloud::Ptr cloud_normals (new PointCloud ());
ne.compute (*cloud_normals);
for (size_t i = 0; i < cloud_normals->size (); ++i)
{
cloud_normals->points[i].normal_x *= -1;
cloud_normals->points[i].normal_y *= -1; cloud_normals->points[i].normal_z *= -1;
}
PointCloud::Ptr cloud_smoothed_normals (new PointCloud ());
concatenateFields (*cloud_smoothed, *cloud_normals, *cloud_smoothed_normals);
Poisson poisson;
poisson.setDepth (9);
poisson.setInputCloud (cloud_smoothed_normals);
PolygonMesh mesh;
poisson.reconstruct (mesh);
io::saveVTKFile ("sreconstruc.vtk",mesh);
return 0;
}
我使用的是PCL 1.6,VS2010,所有x64。
VS2010没有检测到代码中的任何错误,所以我对其进行了编译。但是当我执行它时,它有一个问题:
'Unhandled exception at 0x000007fee833546b (pcl_kdtree_debug.dll) in pcl_surface-reconstrucTutorial.exe: 0xC0000005: Access violation reading location 0x0000000000000000.'
终端显示此[pcl::NormalEstimationOMP::compute] input_ is empty!
。
代码执行到"mls.process (*cloud_smoothed);"行。
我该如何解决?我快要疯了。
提前非常感谢!!
正如@Laszlo-Andras Zsurzsa所说,我更改了参数,现在它继续。但是现在,当它执行并保存 file.vtk 时。我使用此设置来获得好东西
我没有足够的回调,所以我使用答案作为阿卡什问题的评论。
使用 Poisson 重建时,您只需关心 2 个参数:八叉树的深度和八叉树每个节点的样本数。在PLC中,八叉树深度的泊松算法的作者为8,每个节点的样本为1.0。您可以将深度更改为 10 以获得更平滑的表面结果(当然,会消耗更多时间)。作者说你应该停在10,因为更大的数字,更多的需要时间。八叉树的每个节点的样本应该在 1.0 到 1.5 之间,所以我认为它没有什么可以改变的。
对于我们何时应该使用泊松算法的问题:答案是当您需要重建一个水密(关闭)对象时,因为泊松算法使用指标函数来重建表面,因此其结果始终是水密的。
如果您想尝试过去的其他泊松实现,可以在此链接中找到它们
相关文章:
- 如何获取pcl迭代最近点(ICP)的迭代点数?
- Android 在编译二进制文件时重建静态库
- 将 PCL 链接到 Cython C++ 模块
- PCL:当我在setConditionFunction中使用std::bind 时,没有合适的转换函数
- PCL octree std::bad_alloc c++
- 在点云库 (PCL) 中使用自定义点类型的问题
- PCL 出错:体系结构x86_64 @pcl的未定义符号
- PCL:将两个点云缩放到相同的大小
- 在同一项目中使用 CGAL 和 PCL
- 自定义构建文件更改不会触发VS 2017中的项目重建
- 每次都会重建多个程序的制作文件,尽管配方"all"被标记为虚假
- 重建 exe 时如何自动链接新的静态库而不更改源文件?
- PCL 中的 GICP 用法
- 退出 PCL 查看器:即使窗口已关闭,wasStop() 也不会更改值
- 为什么重建的地图类型与原始地图类型不同?
- 使用pcl transformcloud将三维点平移并旋转到原点
- 使用pcl库设置错误
- 如何在ROS中使用PCL可视化动力学数据的表面法线
- 增加 PCL 中点云的点大小以实现可视化
- 表面重建错误 - PCL 1.6