mparkan / Digital-Forestry-Toolbox

A collection of digital forestry tools for Matlab/Octave
http://mparkan.github.io/Digital-Forestry-Toolbox/
GNU General Public License v3.0
46 stars 16 forks source link

Lastread problem with extrabytes #13

Open mariolino007 opened 3 years ago

mariolino007 commented 3 years ago

Hello

I am trying to use the Digital-Forestry-Toolbox tool, it is very well done. I have already tried some functions, lasread and laswrite I find them very interesting. Unfortunately I'm having problems loading a las with extra bytes created with Cloudcompare, I should first load them, then I should perform some calculations on the field "New Extra (P01)" in Matlab and then use Laswrite to write the las again. Can you help me ?

Currently Matlab gives me this error:

WARNING: The point data record contains an extra 4 byte field: "new_extra_p01" reading point data record... Error using bitshift Invalid data type. First and second arguments must be integer or double.

Error in LASread (line 2229) bytes(:,k) = bitshift(cast(blob(ind_start: step : ind_end), r.record(j).type{:}), nbitshift);

Thanks Stefano from Italy

PS Sorry for my English I use deepl for a better translation PPS I attach the point cloud that gives me this error

tree_1a.zip

mparkan commented 3 years ago

Hello,

Could you try the attached version of LASread and let me know if it returns the expected values for the "new_extra_p01" field?

LASread.zip

mariolino007 commented 3 years ago

Good morning,

Thank you very much for considering my comment. I can confirm that LASread is now able to read the "tree_1a.las" file correctly. Unfortunately, for the attached file "bush_1b.las" which is a bit more complicated, it still doesn't work (it doesn't work in Matlab environment, while it works correctly in Octave environment).

If I may, I also ask you also for some more help. For a research, we are trying to calculate Leaf Area Index and Wood Mass Volume from terrestrial laser scans of individual trees and bushes. If I understand correctly your Toolbox should only be applied to aerial laser scans and not from terrestrial laser scans.... I found some material by Professor Wang (https://github.com/dwang520) regarding the separation from clouds of terrestrial laser scans between wood and leaves (and unfortunately I couldn't get it to work) but if I understand correctly it doesn't calculate LAI or wood mass. Regarding the mass of wood I found a very good program of professor Pasi Raumonen TreeQSM (https://github.com/InverseTampere/TreeQSM) that I managed to run with good results. As for the bushes I have not found anything. Are there any Toolbox in Matlab or something alternative suitable for this calculation ? Thank you for your kindness and I look forward to your news.

PS Translated with www.DeepL.com/Translator

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Mail priva di virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno lun 5 apr 2021 alle ore 12:33 Matthew Parkan < @.***> ha scritto:

Hello,

Could you try the attached version of LASread and let me know if it returns the expected values for the "new_extra_p01" field?

LASread.zip https://github.com/mparkan/Digital-Forestry-Toolbox/files/6257715/LASread.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mparkan/Digital-Forestry-Toolbox/issues/13#issuecomment-813328821, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQRUVSHWY7R5JTMIOZTHHH3THGGYXANCNFSM4ZUWYYLQ .

mparkan commented 3 years ago

Hello,

It looks like the file attachment "bush_1b.las" is missing. Could you repost it?

mariolino007 commented 3 years ago

Hello, do you have a suggestion for the other questions ? Many thanks.....

bush_1b.zip