LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
poi = "-drop_z_below 0 -inside 481280 3812940 481330 3812990"
las <- readLAS(LASfile, filter = poi)
col <- height.colors(50)
# Khosravipour et al. spikefree algorithm
chm <- rasterize_canopy(las, res = 0.25, spikefree(1.5))
plot(chm, col = col)
# Locally adaptive spikefree algorithm
chm <- rasterize_canopy(las, res = 0.25, lspikefree())
plot(chm, col = col)
Run the code above in your browser using DataLab