Read .ply file using PCL (not working)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Read .ply file using PCL (not working)

An-Nhien PHAM
This post has NOT been accepted by the mailing list yet.
Please tell me how to read .ply file using pcl::io::loadPLYFile<pcl::PointXYZ>.

Here is my code:

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/io/ply_io.h>

int
main (int argc, char** argv)
{
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);

  if (pcl::io::loadPLYFile<pcl::PointXYZ> ("input_ascii.ply", *cloud) == -1)
  {
    return (-1);
  }
 
  for (size_t i = 0; i < cloud->points.size (); ++i)
    std::cout << "  "   << cloud->points[i].x
                 << "  "   << cloud->points[i].y
                 << "  "   << cloud->points[i].z << std::endl;

  return (0);
}

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Read .ply file using PCL (not working)

VictorLamoine
Administrator
Hello,

Can you tell us what the error is?

Bye