0

将 ply 文件导入我的程序时,我收到一条错误消息,指出以下消息出现问题:

C:\Users\...\data\apple.ply:8: property 'list uint8 int32 vertex_indices' of element 'face' is not handled

我使用了一个示例层文件:https ://people.sc.fsu.edu/~jburkardt/data/ply/apple.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中所述

4

1 回答 1

2

正如@kanstar 已经建议的那样,控制台输出只是一个警告!它很容易被忽略。我的程序在 Debug 中崩溃但在 Release 中没有崩溃的原因是我的 Visual Studio 链接到了错误的 boost 库版本,这导致了崩溃。修复链接使 pcl::NormalEstimationOMP 按预期工作。

于 2019-02-20T13:32:01.390 回答