4

I have a .ply file and I want to convert it to a .pcd format but not exactly sure how.

I have tried the methods described by the op here Convertion of .ply format to .pcd format but they are not sufficient/doesn't work anymore.

when I try to open the .ply file its just a binary file except the header which looks something like this:

ply
format binary_little_endian 1.0
comment generated by Cartographer
element vertex 000000207134849
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float intensity
end_header
bf/B¿ğBè)¿...
...

Thus I don't evet know where to start the conversion.

How do I do the conversion ?

Any method/doc would really help

KaO
  • 313
  • 1
  • 3
  • 13

3 Answers3

2

I Haven't tried, but something seems to be available in Ubuntu distributions probably doing sudo apt install pcl-tools:

Remy Mellet
  • 1,675
  • 20
  • 23
1

UPDATE: I now have a valid solution and therefore answering my question.

I have found this https://github.com/ryanfb/pcl-tools github repo that has a very handy tool called ply2pcd

so basically do the following to get to conversion form .ply to .pcd

git clone https://github.com/ryanfb/pcl-tools 
cmake . 
make 
cd pcl-tools 
chmod +x ply2pcd 
./ply2pcd "path/target.ply" "path/out.pcd"

Note: You need at least as much RAM as the size of .ply file

KaO
  • 313
  • 1
  • 3
  • 13
  • 3
    If you use Ubuntu, you can just `apt install pcl-tools`. source: https://packages.ubuntu.com/bionic/pcl-tools – Ardiya May 18 '20 at 09:00
0

Another option is to use the Open3D library, as described here:

import open3d as o3d
pcd = o3d.io.read_point_cloud("source_pointcloud.ply")
o3d.io.write_point_cloud("sink_pointcloud.pcd", pcd)

https://stackoverflow.com/a/62488893/10334964

rayon
  • 490
  • 7
  • 16