# NOT RUN {
# Example 1: Canopy
wd_can <- system.file("images/canopy/raw",
package = "imageseg")
wd_out_can <- file.path(tempdir(), "canopy", "resized")
resizeImages(imageDir = wd_can,
type = "canopy",
outDir = wd_out_can)
filename_resized <- list.files(wd_out_can, full.names = TRUE)
# check output
img_can <- magick::image_read(filename_resized)
img_can
# Example 2: Understory
wd_us <- system.file("images/understory/raw",
package = "imageseg")
wd_out_us <- file.path(tempdir(), "understory", "resized")
# note, these are png images
resizeImages(imageDir = wd_us,
type = "understory",
outDir = wd_out_us)
filename_resized <- list.files(wd_out_us, full.names = TRUE)
# check output
img_us <- magick::image_read(filename_resized)
img_us
# }
Run the code above in your browser using DataLab