Filter löschen
Filter löschen

Problem about writing las file and pointCloud attributes

2 Ansichten (letzte 30 Tage)
Songqiu
Songqiu am 5 Jul. 2022
Hello,
I got the following problems about LAS file reading and writing:
(1) I read a LAS file that contains uint8 RGB information as a pointCloud object (calls it ptCloud1), actually MATLAB read the RGB info correctly as an uint8 RGB attribute. However, after I wrote this pointCloud object as a LAS file, the color values are not correct anymore: when I read the output LAS file as a new pointCloud object (calls it ptCloud2), I found that the color values are 0 or 1 in the RGB attribute of ptCloud2, even though the data type is uint8.
Do you have any solution to correctly write the same RGB values into a new LAS file as the original one?
(2) Then, I tried to replace the color info in ptCloud2 using double RGB values between 0 and 1 by transforming from ptCloud1 using the following codes, and then write out the double RGB info with values between 0 and 1, but I failed:
ptCloud2.Color = []; % Tried to clear the RGB info, but could not excute
ptCloud2.Color = double(ptCloud1.Color)/255;
Do you have any idea to clear the color attribute in a pointCloud object and then replace with new values with a different data type? or is there a method to change the type of Color attribute from uint8 to double?
(3) I created a new pointCloud object as ptCloud3 and then replaced the RGB values using the color info of ptCloud1 by using the following codes:
ptCloud3 = ptCloud2;
ptCloud3.Color = ptCloud1.Color;
Then, I found that the Color info in ptCloud2 has also been changed, which has the same value with ptCloud1.Color and ptCloud3.Color.
But I did not excute ptCloud2.Color = ptCloud1.Color;
So could some one please tell my what happened and WHY?
I used the MATLAB version of R2022a, in which the functions of lasFileWriter and writePointCloud for writing las files were first introduced.
Thank you very much for any help.

Antworten (0)

Produkte


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by