[英]Converting from .ply to .pcd format
I have a.ply file and I want to convert it to a.pcd format but not exactly sure how.我有一个 .ply 文件,我想将其转换为 .pcd 格式,但不完全确定如何。
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.我已经尝试过此处操作将 .ply 格式转换为 .pcd 格式所描述的方法,但它们还不够/不再起作用。
when I try to open the.ply file its just a binary file except the header which looks something like this:当我尝试打开.ply 文件时,它只是一个二进制文件,除了 header 看起来像这样:
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任何方法/文档都会有帮助
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
我发现这个https://github.com/ryanfb/pcl-tools github repo 有一个非常方便的工具,叫做ply2pcd
so basically do the following to get to conversion form.ply to.pcd所以基本上执行以下操作来转换 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注意:您需要的 RAM 至少与 .ply 文件的大小一样多
Another option is to use the Open3D library , as described here:另一种选择是使用Open3D library ,如下所述:
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 https://stackoverflow.com/a/62488893/10334964
I Haven't tried, but something seems to be available in Ubuntu distributions probably doing sudo apt install pcl-tools
:我还没有尝试过,但 Ubuntu 发行版中似乎有一些东西可能正在执行sudo apt install pcl-tools
:
pcl_ply2pcd
http://manpages.ubuntu.com/manpages/focal/man1/pcl_ply2pcd.1.html pcl_ply2pcd
http://manpages.ubuntu.com/manpages/focal/man1/pcl_ply2pcd.1.ZFC35FDC70D5FC69D2693883A822C7Apcl_pcd2ply
http://manpages.ubuntu.com/manpages/focal/man1/pcl_pcd2ply.1.html pcl_pcd2ply
http://manpages.ubuntu.com/manpages/focal/man1/pcl_pcd2ply.1.ZFC35FDC70D5FC69D2693EZ5883A822C7A
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.