7,540
社区成员
发帖
与我相关
我的任务
分享
int _PCD2PLY_M3(string pcdPath, string savePath){
pcl::PCLPointCloud2 cloud;
if (loadPCDFile(pcdPath, cloud) < 0)
{
cout << "Error: cannot load the PCD file!!!" << endl;
return -1;
}
PLYWriter writer;
writer.write(savePath,cloud,Eigen::Vector4f::Zero(),Eigen::Quaternionf::Identity(),false,false);
return 0;
}
int _PCD2PLY_M3(string pcdPath, string savePath){
pcl::PCLPointCloud2 cloud;
if (loadPCDFile(pcdPath, cloud) < 0)
{
cout << "Error: cannot load the PCD file!!!" << endl;
return -1;
}
// remove NaN type points
//依赖函数 #include <pcl/filters/filter.h>
std::vector<int> mapping;
pcl::removeNaNFromPointCloud(*cloud, *cloud, mapping);
PLYWriter writer;
writer.write(savePath,cloud,Eigen::Vector4f::Zero(),Eigen::Quaternionf::Identity(),false,false);
return 0;
}
希望对你有启发!
参考:
http://www.cnblogs.com/li-yao7758258/p/6519830.html
http://docs.pointclouds.org/1.9.1/group__filters.html#gac463283a9e9c18a66d3d29b28a575064