Description Usage Arguments Value Author(s) See Also Examples
LiDAR-derived Canopy Height Model (CHM) smoothing is used to eliminate spurious local maxima caused by tree branches.
1 | CHMsmoothing(chm, filter, ws, sigma)
|
chm |
A LiDAR-derived Canopy Height Model (CHM) RasterLayer or SpatialGridDataFrame file. |
filter |
Filter type: mean, median, maximum or Gaussian. Default is mean. |
ws |
The dimension of a window size, e.g. 3,5, 7 and so on. Default is 5. |
sigma |
Used only when filter parameter is equal to Gaussian, e.g. 0.5, 1.0, 1.5 and so on. Default is 0.67. |
Returns a CHM-smoothed raster.
Carlos Alberto Silva.
focal
in the raster package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #=======================================================================#
# Importing the LiDAR-derived CHM file
data(chm) # or set a CHM. e.g. chm<-raster("CHM_stand.asc")
#=======================================================================#
# Example 01: Smoothing the CHM using a Gaussian filter
#=======================================================================#
# Set the ws:
ws<-3 # dimension 3x3
# Set the filter type
filter<-"Gaussian"
# Set the sigma value
sigma<-0.6
# Smoothing CHM
sCHM<-CHMsmoothing(chm, filter, ws, sigma)
#=======================================================================#
# Example 02: Smoothing the CHM using a mean filter
#=======================================================================#
# Set the ws:
ws<-5 # dimension 5x5
# Set the filter type
filter<-"mean"
# Smoothing and plotting LiDAR-derived CHM
sCHM<-CHMsmoothing(chm, filter, ws)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.