1.6-removing_NaNs
1.NaN造成的问题
在处理点云数据时,如果出现““Assertion `point_representation_->isValid (point) && “Invalid (NaN, Inf) point coordinates given to radiusSearch!”’ failed.””问题时,则表明需要对点云去除无效点即NaN点。
2.为什么会出现NaN点
那么NaN点是如何出现的呢?这是由于深度相机在接收空间中某点时距离太近或者太远(kinect_v2可侦测距离为0.5-4.5m),也有可能为物体表面反射导致的无效点。
3.PCL处理方法
#include <pcl/io/pcd_io.h>
#include <pcl/filters/filter.h>
#include <iostream>
int
main(int argc, char** argv)
{
if (argc != 3)
{
std::cout << "\tUsage: " << argv[0] << " <input cloud> <output cloud>" << std::endl;
return -1;
}
// Object for storing the point cloud.
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud