从完全不知到弄出结果用了好几天的时间,虽然结果还不是很理想,但也值得纪念一下,总结一下过程中出现的问题。
按照上一篇博客中的算法代码(如下)就可以,问题处在pcd文件上,pcd文件有固定的书写格式,可以按程序生成,也可以自己写,只要格式没问题即可。
接下来就是储存位置问题,pcd文件要和可执行文件即.exe文件放在同一文件夹下。运行程序,即可看到输出结果。
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/features/normal_3d.h>
#include <pcl/surface/gp3.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <boost/thread/thread.hpp>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
int main (int argc, char** argv)
{
// Load input file into a PointCloud<T> with an appropriate type
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);