Assign RGB values to point cloud

553 views
Skip to first unread message

Andrew Hewitt

unread,
Sep 28, 2016, 10:01:25 AM9/28/16
to LAStools - efficient tools for LiDAR processing
Is there a better way to assign RGB values based on their classification? 

Currently my workaround is 
  • create a tiff and colour it a solid colour (green)
  • use las2las to -keep_class 3 4 5
  • use lascolor to merge the green colouring onto the points
  • dropout class 3 4 5 from the original and merge in the newly coloured green las back together
Is there already a quicker way to do this? If not maybe some additional flags could be useful
  • -set_rgb which you assign a value to to colour the entire file a certain color. (enabling splitting and merging back in of classes)
  • -color_by_class where you pass two options the colour and the class to change?


Martin Isenburg

unread,
Sep 28, 2016, 12:23:52 PM9/28/16
to LAStools - efficient command line tools for LIDAR processing
Hello Andrew,

wow ... that is quite a work-around. It is a lot easier than that. Here an example how to do this using a '-filtered_transform' that has been mentioned in a few prior discussions:

:: first we create a file with colors

las2las -i ..\data\fusa.laz -set_point_type 3 -o fusaRGB.laz

:: then we make one filtered transform that colors the ground points blue-ish

las2las -i fusaRGB.laz ^
            -keep_class 2 ^
            -filtered_transform ^
            -set_RGB 50 255 255 ^
            -odix _2 -olaz

lasview -i fusaRGB_2.laz

:: then we make one filtered transform that colors the building points green-ish

las2las -i fusaRGB_2.laz ^
            -keep_class 6 ^
            -filtered_transform ^
            -set_RGB 200 200 25 ^
            -odix _6 -olaz

lasview -i fusaRGB_2_6.laz

:: then we make one filtered transform that colors the veggie points pink-ish

las2las -i fusaRGB_2_6.laz ^
            -keep_class 5 ^
            -filtered_transform ^
            -set_RGB 250 25 125 ^
            -odix _5 -olaz

lasview -i fusaRGB_2_6_5.laz

Now that is not very convenient if you have many different colors. In the next email (when I come back from surfing (-;) I will show you how to do this way more efficiently with LASlayers (*). And I will also implement a new transform called '-set_RGB_of_class' that only changes the RGB values of a certain class as this would seem like a common thing to do.


Regards,

Martin @rapidlasso 

las2las_filtered_transform_RGB_2.jpg
las2las_filtered_transform_RGB_2_6.jpg
las2las_filtered_transform_RGB_2_6_5.jpg
Reply all
Reply to author
Forward
0 new messages