如何使用PCL io :: loadPLYFile导入.ply文件?

问题描述 投票:0回答:1

将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的样本层文件

我已经尝试过来自不同来源的不同ply文件,但它们都不起作用。调试程序时,io :: loadPLYFile不会生成有效的pointcloud。 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中所述

import point-cloud-library marching-cubes ply-file-format
1个回答
1
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.