对彩色点云重采样后进行快速三角化时报错

控制台显示:
Assertion failed: point_representation_->isValid (point) && “Invalid (NaN, Inf) point coordinates given to nearestKSearch!”, file F:\PCLdon\pcl-master\kdtree\include\pcl/kdtree/impl/kdtree_flann.hpp, line 136
看控制台显示的错误说明,发现是由于输入点云具有无效点造成的,排查错误发现错误出现在法线估计的compute处。
对输入点云使用removeNaNFromPointCloud函数去除无效点,发现去除前后点个数不变。
对调用输入点云的is_dense成员函数,发现输出为True(即不存在无效点)。
至此该错误很诡异,使用pcl自带的无效点去除函数和判断是否具有无效点的成员函数都显示其不具有无效点,但却因具有无效点造成了法线估计上的错误。
继续排查解决:
根据控制台显示查看kdtree_flann.hpp, line 136,对应该错误的代码为:assert (point_representation_->isValid (point) && “Invalid (NaN, Inf) point coordinates given to nearestKSearch!”);
我在程序中的输入点云为PointXYZRGB类型,没有isValid成员函数,该代码中调用isValid的point_representation为PointRepresentationConstPtr类型。
重试中断程序定位出错行,定位到point_representation.h文件,定位到行!pcl_isfinite (temp[i]

最低0.47元/天 解锁文章
700





