4

I want to open my 3D point cloud in MATLAB. But they are in .las files. How can I display them in MATLAB???

I heard about .ply file can open 3D point data on MATLAB. So I want to know how to convert las files to ply files.

David de la Iglesia
  • 2,436
  • 14
  • 29
  • What is .las file? What is .ply file? What have you attempted? – Siva Srinivas Kolukula Jun 07 '17 at 09:26
  • You should describe the format of both files and give a minimum working example if you want efficient help. – Hoki Jun 07 '17 at 10:06
  • 4
    I might be missing something but I don't think that the question deserves so many negative points. LAS format is one of the most common formats for lidar (wich is one of the tags). The question is kind of concise, and I have seen many questions with 100+ votes that don't present a minimum working example or what they have attempted. – David de la Iglesia Jun 08 '17 at 09:03
  • 1
    @DaviddelaIglesia your question is very helpful to me and I do think if someone does not understand it he shouldn't give a down vote. If you do not know what a ply/las is, which is basics for whoever is dealing with point cloud, simply do not answer! Gave you a ^. – havakok Jul 18 '17 at 12:06

3 Answers3

4

There is a .las file reader for matlab here:

https://es.mathworks.com/matlabcentral/fileexchange/48073-lasdata

Once you have the data in matlab you can use these point cloud tools, which are part of the computer vision toolbox:

https://es.mathworks.com/help/vision/3-d-point-cloud-processing.html

If you want to embrace the open source force, I'm writing a Python (easy transition from matlab) library for point cloud processing:

https://github.com/daavoo/pyntcloud

David de la Iglesia
  • 2,436
  • 14
  • 29
  • David, I have successfully read the .las file into MATLAB. I can not write the las data using the pcwrite function. Can you please be more explicit about converting into point cloud format using Point Cloud Tools? Thanks! – Moiz Sajid Jan 09 '18 at 07:05
4

You can use the free and open-source CloudCompare software.

On the command line:

CloudCompare -O file_to_convert.las -C_EXPORT_FMT PLY -SAVE_CLOUDS

Take care to the order of the options: it seems that -SAVE_CLOUDS must be at the end.

That will result in a binary-format PLY file in the same directory as the file to convert, named using the original filename and the date of export, like: file_to_convert_2019-07-18_13h32_06_751.ply

I found no way to specify the output file name (should you find one please comment below).

Should you want a more predictable name, add option -NO_TIMESTAMP before the option -SAVE_CLOUDS (but then you risk overwriting files so be careful).

More help (such as how to export in ASCII-format) in the documentation.

I timed this on powerful PC, it took 170s to convert a 2.7GB LAS file with 102M points (XYZ,intensity,time).

Gabriel Devillers
  • 3,155
  • 2
  • 30
  • 53
3

if you have LAStools installed, you can use las2txt to convert your *.las/*.laz files into *.xyz format which MeshLab can import natively as a point cloud, which may then be converted into a Mesh.

There are a multitude of caveats to that depending on the source of your data-set.