Filtering points by RGB

928 views
Skip to first unread message

Jonas Bohlin

unread,
Nov 12, 2013, 6:48:05 AM11/12/13
to last...@googlegroups.com
Hi
Is there any way of filtering the point cloud using RGB values? I would like to filter out points within a certain R, B and G interval. It is possible to do for intensity in Las2Las, but I can't find anything similar for RGB?

Filter points based on their intensity.
  -keep_intensity 20 380
  -drop_intensity_below 20
  -drop_intensity_above 380
  -drop_intensity_between 4000 5000

/Jonas

andekyl4

unread,
Nov 14, 2013, 7:59:09 PM11/14/13
to last...@googlegroups.com
I have had success using GPS time and Intensity as placeholders for other attributes.  Adjust field parsing by converting to txt, and then using the -iparse argument.  Not elegant but it may get the job done. 

Martin Isenburg

unread,
Dec 6, 2013, 4:55:37 PM12/6/13
to last...@googlegroups.com
Hello,

I have added capability to the latest release of LAStools (version 131205). Here some examples on how to use it:

lasinfo -i Pine_Ridge_2012.laz -histo R 4096 ^
             -keep_RGB_red 0 4095

lasinfo -i Pine_Ridge_2012.laz -histo G 4096 ^
             -keep_RGB_green 0 4095

lasinfo -i Pine_Ridge_2012.laz -histo B 4096 ^
             -keep_RGB_blue 0 4095

las2las -i in.laz ^
              -keep_RGB_red 0 4095 ^
              -keep_RGB_green 0 4095 ^
              -keep_RGB_blue 0 4095 ^
              -o out.laz

Regards,

Martin @rapidlasso

Andy Ritchie

unread,
Mar 8, 2016, 7:09:02 PM3/8/16
to LAStools - efficient tools for LiDAR processing
I've been able to very effectively filter out water in some small datasets using meshlab's conditional vertex selection tool (which uses the muparser lib). It would be great if I could use lastools to filter point data from SfM photogrammetry and classify points based on a range of RGB values, rather than just a single channel (but it's nice to have the single channel tools - thanks Martin!). 

Maybe there's a way to do this already that I am missing, and I could picture doing something like this with a complicated heirarchy of directories and merging and splitting files, but it sure would be nice to be able to delete points meeting certain criteria with RGB together.

Here are a couple examples to illustrate what I'm talking about (general examples of what I've used in meshlab, with made-up values):

filter points based on color ranges/combinations:
    -drop_color "red 30 120 AND blue 40 70 AND green 40 70" 
    -drop_color "red < 20 OR blue < 10 OR green < 10"
    -keep_color "red 80 120 AND blue 80 120 AND green 80 120"

GeorgeM

unread,
Mar 9, 2016, 2:09:23 PM3/9/16
to LAStools - efficient tools for LiDAR processing
Hi Martin,
I may suggest something to this workflow: it would be much more powerful to add some arithmetics possibility based on the rgb values of the point cloud. In this way, it would be possible to calculate ndvi or greennes indices or whatever measure on the fly and filter a point cloud based upon that measures. A range of color values rarely reflect real world phisics. Dense image matching outputs nowdays nice (accurately) colorized point clouds from proper aerial imagery orientations and sensor geometry and it would be one step further for filtering the cloud itself and drop traditional raster filtering techniques. (I say accurately colorized because a point cloud to be colorised not necessarily matches with existing orthoimages, in other words without the proper knoledge one can easily colorize the point cloud with not the right colors at that 3d coordinate (different errors and distortions of orthoimage workflows, etc.)).
Greetings,
GeorgeM.

Floris Groesz

unread,
Mar 11, 2016, 8:08:35 AM3/11/16
to LAStools - efficient tools for LiDAR processing
I agree with GeorgM on the request for arithmetic options, not only for RGB but a LAStool that is more versatile. I posted something similar earlier: a "point calculator" tool (similar to a raster calculator tool in GIS.)
https://groups.google.com/forum/?fromgroups#!searchin/lastools/point$20calculator/lastools/UclqfuGVUI4/aKZs2RLNDwAJ
Classification of points by absolute RGB is not often giving good results. Ratio's and indexes are more useful.
 
@Andy: Is point based classification giving acceptable results? My experience is that if you want to classify objects (like water bodies) you should think objects from the start. point based classification (or pixel based) is creating many errors and does not allow to take the actual object into account. I prefer to use eCognition for this kind of work. This approach uses object based image classification and can take object and neighborhood characteristics into account. *Sorry for the advertisement Martin*, but I think that eCognition is more suitable for classification of objects while LAStools is the best for all (advanced) pre-processing.

Floris


Alejandro Hinojosa

unread,
Mar 11, 2016, 4:23:02 PM3/11/16
to last...@googlegroups.com
Hi,

I following  closely this thread, currently I am working with point clouds generated  from Ebee (sensefly) drone using RGB and   NIR cameras, I was thinking of a way to classify vegetation using the color (range in  values), also on calculating the NDVI on the fly with the NIR points and add it as scaled value in the user field to  be later used in veg stuff: health, biomass, classification,...

Cheers

Alejandro

Andy Ritchie

unread,
Mar 11, 2016, 4:25:14 PM3/11/16
to LAStools - efficient tools for LiDAR processing
I agree with GeorgM and Floris that some point-based algebra would be nice, but even being able to say something like keep_RGB "(R > 40 AND G > 40 AND B > 40) AND (R > B) AND (G < B)" would give the tool a lot more power.

@Floris: I'm still looking for a less tedious way to classify water bodies, wood, vegetation, etc. My biggest need is extracting noisy water surface elevation from point clouds or DEMs for river flights with SfM for these flights on the Elwha River (~90 so far)

 I've had moderate success using supervised classification in Arc, and moderate success using some functions in ImageJ. My best results come from generating a stddev and point density grid and clipping points with a stddev/density threshold where the data start to get noisy, but I still end up with "patches" of false returns. 

Lately I've resorted to hand-picking good wetted edge points and generating a synthetic water surface with emperical bayesian kriging algorithms, then applying that to a hand-digitized mask for the wetted width (very tedious). Object-based classification looks like it might be really helpful for the water masking portion, but I haven't checked out eCognition (looks expensive, but I will definitely investigate). Optiks (FOSS) also looks promising.

Martin Isenburg

unread,
Mar 12, 2016, 11:40:57 PM3/12/16
to LAStools - efficient command line tools for LIDAR processing
Hello,

The next version of LAStools will allow you to group filters with simple boolean expressions via the new '-filter_and' and the new '-filter_or' options that always group the preceding two filters into a logical AND operation or OR operation. Here an example.

:: drop all returns with intensity below 100
lasview -i ..\data\fusa.laz -drop_intensity_below 100

:: drop all last returns 
lasview -i ..\data\fusa.laz -drop_last

:: drop all returns that have an intensity below 100 *OR* that are last returns:
lasview -i ..\data\fusa.laz -drop_intensity_below 100 -drop_last
lasview -i ..\data\fusa.laz -drop_intensity_below 100 -drop_last -filter_or

:: drop all returns that have an intensity below 100 *AND* that are last returns:
lasview -i ..\data\fusa.laz -drop_intensity_below 100 -drop_last -filter_and

As for the "point calculator" type operations ... nice idea. (-:

Martin

--

Susana Gonzalez

unread,
Mar 13, 2016, 5:26:37 PM3/13/16
to last...@googlegroups.com

Hi Alejandro,

We are processing the NIR points from our Phantom 3. We compute NDVI and then we do a supervise classification in ArcMap. The result is not amazing but it’s a good start.

Cheers

Susana

Reply all
Reply to author
Forward
0 new messages