首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用PCL::loadPLYFile导入.ply文件?

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

Stack Overflow用户
提问于 2019-02-18 22:01:48
回答 1查看 1.8K关注 0票数 0

当我把一个ply文件导入到我的程序中时,我得到了一个错误消息,说下面的消息出错了:

代码语言:javascript
复制
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的运行时库和我的程序的运行时库是相同的。

代码语言:javascript
复制
#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中的描述正确地加载文件

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-20 21:32:01

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54748981

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档