percentage of 'green' points over a raster cell

57 views
Skip to first unread message

Guillermo Castilla

unread,
Feb 12, 2020, 7:06:45 PM2/12/20
to LAStools - efficient tools for LiDAR processing

I have a drone-based image point cloud with thousands of points per sq. meter (where each point has a RedGreenBlue value between 0 and 255 for each channel),  and I would like to know the proportion of points that are ‘green’ (say where 2G - R - B >200) in each 1m cell of raster encompassing the point cloud. I guess doing this would involve a combination of lasfilter and lasvoxel, but could anyone suggest a suitable pipeline for this?

Martin Isenburg

unread,
Feb 14, 2020, 1:04:50 AM2/14/20
to LAStools - efficient command line tools for LIDAR processing
Hello,

we could add a filter that uses your formula for "greenness" aka 2G - R - B that then allows to eliminate points. Then we compute two rasters with point counts and by dividing one with the other you get the desired ratio of "greenness". On my example I have tried no filter, greenness above 10, above 20, and above 40 as you can see in the attached screenshots. Is that what you are looking for?

Regards from Indonesia,

Martin

On Thu, Feb 13, 2020 at 1:06 AM Guillermo Castilla <guillermo...@canada.ca> wrote:

I have a drone-based image point cloud with thousands of points per sq. meter (where each point has a RedGreenBlue value between 0 and 255 for each channel),  and I would like to know the proportion of points that are ‘green’ (say where 2G - R - B >200) in each 1m cell of raster encompassing the point cloud. I guess doing this would involve a combination of lasfilter and lasvoxel, but could anyone suggest a suitable pipeline for this?

--
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
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/5ce0b058-2126-410a-a87f-a165996a04fd%40googlegroups.com.
lasview_keep_rgb_greenness01.jpg
lasview_keep_rgb_greenness02_10plus.jpg
lasview_keep_rgb_greenness03_20plus.jpg
lasview_keep_rgb_greenness04_40plus.jpg

Guillermo Castilla

unread,
Feb 14, 2020, 6:51:29 PM2/14/20
to LAStools - efficient tools for LiDAR processing
Thanks Martin, that would indeed work. What lastools tool did you use to implement the filter, and what is the expression to be used?


On Thursday, February 13, 2020 at 11:04:50 PM UTC-7, Martin Isenburg wrote:
Hello,

we could add a filter that uses your formula for "greenness" aka 2G - R - B that then allows to eliminate points. Then we compute two rasters with point counts and by dividing one with the other you get the desired ratio of "greenness". On my example I have tried no filter, greenness above 10, above 20, and above 40 as you can see in the attached screenshots. Is that what you are looking for?

Regards from Indonesia,

Martin

On Thu, Feb 13, 2020 at 1:06 AM Guillermo Castilla <guillerm...@canada.ca> wrote:

I have a drone-based image point cloud with thousands of points per sq. meter (where each point has a RedGreenBlue value between 0 and 255 for each channel),  and I would like to know the proportion of points that are ‘green’ (say where 2G - R - B >200) in each 1m cell of raster encompassing the point cloud. I guess doing this would involve a combination of lasfilter and lasvoxel, but could anyone suggest a suitable pipeline for this?

--
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
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to last...@googlegroups.com.

Martin Isenburg

unread,
Feb 15, 2020, 4:36:43 AM2/15/20
to LAStools - efficient command line tools for LIDAR processing
Hello,

this has now been added to LASlib and can be used in lasgrid via these command switches to create two rasters. Then simply use a raster calculator to divide one raster by the other to calculate the percentage.

lasgrid -i in.laz -step 2 -counter_16bit -odix _all -obil
lasgrid -i in.laz -keep_RGB_greenness 40 65535 -step 2 -counter_16bit -odix _green40 -obil

Here is a preliminary version of lasgrid with this new function:


Regards,

Martin

Guillermo Castilla

unread,
Feb 19, 2020, 5:56:45 PM2/19/20
to LAStools - efficient tools for LiDAR processing
Thanks Martin!

When you said "we could add a filter that uses your formula", I didn't realize you meant you would create a new switch in a tool, awesome! 

For the record, the 'greenness' index I use (2G-R-B) is called "2G_RBi" and is described in Richardson et al. 2007 (Oecologia 152, 323–334). There are other possibilities, such as the Green-Red Vegetation Index (GRVI=(G-R)/(G+R+1)), described in Gitelson et al. 2002 (RSE 80, 76–87), or the percent green G%=100*G/(R+G+B+1), also described in Richardson et al. 2007. Would it be possible to implement those too in the future? 

A related question, in order to select a suitable threshold, is there a way to produce a histogram of the greenness index, possibly for a subset of points that fulfill a condition (e.g., where zi > Zthresh and  Xmin < x < Xmax and Ymin < y < Ymax)?

Thanks/Guillermo


On Saturday, February 15, 2020 at 2:36:43 AM UTC-7, Martin Isenburg wrote:
Hello,

this has now been added to LASlib and can be used in lasgrid via these command switches to create two rasters. Then simply use a raster calculator to divide one raster by the other to calculate the percentage.

lasgrid -i in.laz -step 2 -counter_16bit -odix _all -obil
lasgrid -i in.laz -keep_RGB_greenness 40 65535 -step 2 -counter_16bit -odix _green40 -obil

Here is a preliminary version of lasgrid with this new function:


Regards,

Martin
Reply all
Reply to author
Forward
0 new messages