adding rgb info to point cloud

420 views
Skip to first unread message

Rui L. Pires

unread,
Apr 3, 2015, 9:23:48 AM4/3/15
to last...@googlegroups.com
Hi,

I'm trying to use LASlib to add RGB values to a point cloud. I should make clear I am not using the tool lascolor, my process is not based on the content of an orthophoto.

I've based myself on the open source tool las2las to write my own code adding the RGB information to the points. So far with limited success.

If anyone can help, how should the header of the destination las file be configured? Particularly the variables ''point_data_format' and 'point_data_record_length'.
Is there any other relevant setting that must be configured?

I can supply a small sample of my point cloud, if needed. Thanks in advance.

Regards,
Rui Pires

Jan Depner

unread,
Apr 5, 2015, 2:34:25 AM4/5/15
to last...@googlegroups.com
On Fri, 2015-04-03 at 10:03 +0200, Rui L. Pires wrote:
> Hi,
>
>
> I'm trying to use LASlib to add RGB values to a point cloud. I should
> make clear I am not using the tool lascolor, my process is not based
> on the content of an orthophoto.
>
>
> I've based myself on the open source tool las2las to write my own code
> adding the RGB information to the points. So far with limited success.
>
>
>
> If anyone can help, how should the header of the destination las file
> be configured? Particularly the variables ''point_data_format' and
> 'point_data_record_length'.
>
point_data_format will have to be set to 2 or 5 since they're the only
ones containing RGB data. For format 2 point_data_record_length should
be 26 and for format 5 it should be 63 (always assuming I've added the
bytes correctly ;-) I'm assuming that you're not using v1.4 which is
why I didn't mention formats 7, 8, and 10.

> Is there any other relevant setting that must be configured?
>
Not that I can think of but I may be mistaken.

>
> I can supply a small sample of my point cloud, if needed. Thanks in
> advance.
>
>
> Regards,
>
> Rui Pires
>
> --
> Download LAStools at
> http://lastools.org
> http://rapidlasso.com
> Be social with LAStools at
> http://facebook.com/LAStools
> http://twitter.com/LAStools
> http://linkedin.com/groups/LAStools-4408378
> Manage your settings at
> http://groups.google.com/group/lastools/subscribe


Rui L. Pires

unread,
Apr 8, 2015, 10:12:34 AM4/8/15
to j...@pfmabe.software, last...@googlegroups.com
Hello Jan,

Thank you for your reply.

I followed the same reasoning, with just a few differences as I will explain. My original points are of type 1 as there is acquisition time info in the point cloud. Thus, according to this document (http://www.asprs.org/a/society/committees/standards/asprs_las_format_v12.pdf), p. 10, I would have to use point type 3 to accommodate both gps time and rgb values.

From the source of code of 'las2las.cpp' one can find the data record length for this point type, in this case 34.

Simply iterating through the input point cloud and writing each point with the added rgb values (output with an adjusted header) did not do the trick. The output still is of type 2 and no color info is there to be found.

Hence my thought of an additional configuration of the header required.

I can provide a code sample as well as an excerpt of the point cloud if required.

Food for thought: I coded exactly the same operation with liblas 1.8.0, normally superseded by LASlib, and I did get my rgb values.

Regards,
Rui

Jan Depner

unread,
Apr 8, 2015, 10:15:07 AM4/8/15
to Rui L. Pires, last...@googlegroups.com
Rui,

Well, obviously, I didn't add correctly ;-) So, you set the
lasheader->point_data_format to 3 and it came back with nada? Can you
run lasinfo on the resulting file and send the results?

Cheers,
Jan

hu luwa

unread,
Nov 14, 2015, 1:30:01 PM11/14/15
to LAStools - efficient tools for LiDAR processing
I have the same problem ,can you help me for the reason why i can not save rgb value .
thanks.

Martin Isenburg

unread,
Nov 15, 2015, 5:00:56 AM11/15/15
to LAStools - efficient command line tools for LIDAR processing
A code snippet with the correct sequence of commands was posted here:

http://groups.google.com/d/topic/lastools/HnyovUg9hzA/discussion

--
Reply all
Reply to author
Forward
0 new messages