I am new to Pointcloud (LiDAR) processing and I was wondering if there is any tool/library able to convert a pointcloud saved in .txt to a .ply file.
The pointcloud .txt looks like this
pointcloud_width pointcloud_height
point1_x point1_y point1_z point1_intensity
point2_x point2_y point2_z point2_intensity
...
pointN_x pointN_y pointN_z pointN_intensity
Thanks for your help
You can use Open3d for this:
This will not preserve the intensity values, though. If you need them use open3d.t:
Note that PLY comes in two flavours: ASCII and binary. The above solution gives you a binary file, which is the default for open3d. If you really need ASCII then use this:
Alternatively, since ASCII is basically plain text, you could do this without any external library by just replacing the first line of your .txt file with a custom header so it looks like this:
and saving it with a .ply extension.
Lastly, if you just need a "tool" then check out CloudCompare, which handles many file format conversions.