CHMsmoothing: LiDAR-derived Canopy Height Model (CHM) smoothing

Description Usage Arguments Value Author(s) See Also Examples

View source: R/CHMsmoothing.r

Description

LiDAR-derived Canopy Height Model (CHM) smoothing is used to eliminate spurious local maxima caused by tree branches.

Usage

1

Arguments

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.

Value

Returns a CHM-smoothed raster.

Author(s)

Carlos Alberto Silva.

See Also

focal in the raster package.

Examples

 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)

rLiDAR documentation built on Oct. 5, 2021, 9:07 a.m.

Related to CHMsmoothing in rLiDAR...