pcl库中有很多3为表面重建方法,下面是泊松表面重建的代码:
//点的类型的头文件
#include <pcl/point_types.h>
//点云文件IO(pcd文件和ply文件)
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>
//kd树
#include <pcl/kdtree/kdtree_flann.h>
//特征提取
#include <pcl/features/normal_3d_omp.h>
#include <pcl/features/normal_3d.h>
//重构
#include <pcl/surface/gp3.h>
#include <pcl/surface/poisson.h>
//可视化
#include <pcl/visualization/pcl_visualizer.h>
//多线程
#include <boost/thread/thread.hpp>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
int main(int argc, char** argv)
{
// 确定文件格式
char tmpStr[100];
strcpy(tmpStr, argv[1]);
char* pext = strrchr(tmpStr, '.');
std::string extply("ply");
std::string extpcd("pcd");
if (pext){
*pext = '\0';
pext++;
}
std::string ext(pext);
//如果不支持文件格式,退出程序
if (!((ext == extply) || (ext == extpcd))){
std::cout << "

这篇博客介绍了如何利用pcl库中的泊松表面重建算法进行三维数据处理。通过示例代码展示了具体实现过程。
最低0.47元/天 解锁文章
1285

被折叠的 条评论
为什么被折叠?



