当我把一个ply文件导入到我的程序中时,我得到了一个错误消息,说下面的消息出错了:
C:\Users\...\data\apple.ply:8: property 'list uint8 int32 vertex_indices' of element 'face' is not handled我使用了一个示例ply文件,该文件来自:https://people.sc.fsu.edu/~jburkardt/data/ply/apple.ply
我已经尝试了来自不同来源的不同ply文件,但它们都不起作用。在调试程序时,io::loadPLYFile不会生成有效的点云。PCL的运行时库和我的程序的运行时库是相同的。
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>
#include <pcl/point_types.h>
#include <pcl/search/kdtree.h>
#include <pcl/features/normal_3d_omp.h>
#include <pcl/surface/marching_cubes_rbf.h>
using namespace pcl;
using namespace std;
int
main (int argc, char** argv)
{
PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ>);
std::cout << "Start Debug?" << std::endl;
std::cin.ignore();
if(io::loadPLYFile<PointXYZ> (argv[1], *cloud) == -1){
cout << "ERROR: couldn't find file" << endl;
return (1);
} else {
cout << "loaded" << endl;
NormalEstimationOMP<PointXYZ, Normal> ne;
search::KdTree<PointXYZ>::Ptr tree1 (new search::KdTree<PointXYZ>);
tree1->setInputCloud (cloud);
ne.setInputCloud (cloud);
ne.setSearchMethod (tree1);
ne.setKSearch (20);
PointCloud<Normal>::Ptr normals (new PointCloud<Normal>);
ne.compute (*normals);我希望PCL函数io::loadPLYFile能够按照文档http://docs.pointclouds.org/1.3.1/group__io.html中的描述正确地加载文件
发布于 2019-02-20 21:32:01
正如@kanstar已经建议的那样,控制台输出只是一个警告!它很容易被忽略。我的程序在Debug中崩溃而不是在Release中崩溃的原因是我的Visual Studio链接到错误的boost库版本,从而导致崩溃。修复链接使pcl::NormalEstimationOMP按预期工作。
https://stackoverflow.com/questions/54748981
复制相似问题