cimg2Raster {lidaRtRee} | R Documentation |
Cimg to SpatRaster conversion
Description
converts a cimg object to a SpatRaster object
Usage
cimg2Raster(cimg, r = NULL)
Arguments
cimg |
raster object. raster of canopy height model, preferably filtered to avoid effect of holes on volume and surface computation |
r |
SpatRaster object. defines the extent and projection of conversion result |
Value
A SpatRaster object
See Also
Examples
data(chm_chablais3)
chm_chablais3 <- terra::rast(chm_chablais3)
# convert raster to cimg object
chm_cim <- raster2Cimg(chm_chablais3)
# apply filtering
chm_cim_filt <- dem_filtering(chm_cim,
nl_filter = "Closing",
nl_size = 3,
sigma = 0
)$non_linear_image
# convert to SpatRaster
chm_filt <- cimg2Raster(chm_cim_filt, chm_chablais3)
# plot SpatRaster
terra::plot(chm_chablais3)
# plot cimg object
plot(chm_cim)
# plot filtered cimg object
plot(chm_cim_filt)
# plot filtered SpatRaster
terra::plot(chm_filt)
[Package lidaRtRee version 4.0.5 Index]