LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile)
chm <- rasterize_canopy(las, 0.5, dsmtin())
sto <- pitfill_stonge2008(chm)
#terra::plot(c(chm, sto), col = lidR::height.colors(25))
Run the code above in your browser using DataLab