error in loading PLY files. sample file and code attached.

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

error in loading PLY files. sample file and code attached.

saimanoj18
Hi PCL users,

I am trying to load PLY file and later convert to PCD files for further processing.

To load PCD files, I am using the code which is at

https://github.com/ryanfb/pcl-tools/blob/master/src/ply2pcd.cpp

It compiles without any error.

But when I try to run it, it gives me segmentation fault. It occurs while loading the PLY file.

The PLY file that I am trying to load can be downloaded from this link

https://dl.dropboxusercontent.com/u/95042389/scene001_0.ply

Could any one help me in converting this PLY file to PCD ?

Thank you so much for your time and effort.
Reply | Threaded
Open this post in threaded view
|

Re: error in loading PLY files. sample file and code attached.

VictorLamoine
Administrator
Hi,

On the official repository there is a tool to visualize PCD files :
https://github.com/PointCloudLibrary/pcl/blob/master/visualization/tools/pcd_viewer.cpp

And a tool to convert PCD files to PLY files: (there are other format converter, check the folder)
https://github.com/PointCloudLibrary/pcl/blob/master/tools/ply2pcd.cpp

There is a bug with the PLY reader in PCL; sometimes reading a PLY file makes PCL crash
https://github.com/PointCloudLibrary/pcl/issues/675

As an alternative, convert you file to an OBJ using MeshLab and the convert the file using pcl_obj2pcd (check the official repo)

I converted the file for you:
scene001_0.7z

Bye!
Reply | Threaded
Open this post in threaded view
|

Re: error in loading PLY files. sample file and code attached.

saimanoj18
Thank you Victor for your timely answer.

I was able to solve the problem from your references.

The solution is to use pcl::io::loadPolygonFilePLY function to load the PLY file but not loadPLYfile.

I got this from one Stephen Miller's answer to a issue that you have referenced in your reply.
https://github.com/PointCloudLibrary/pcl/issues/720

The complete code to convert from PLY to PCD that worked for me with this file can be found at
https://github.com/saimanoj18/ply2pcd/blob/master/ply2pcd.cpp
Reply | Threaded
Open this post in threaded view
|

Re: error in loading PLY files. sample file and code attached.

gadhiyaparth
This post has NOT been accepted by the mailing list yet.
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: error in loading PLY files. sample file and code attached.

VictorLamoine
Administrator
Please tell us more about what is not working, is the problem crashing? If so, what is the error? Have you tried to debug your program to find the breaking point?