loadImages {imageseg}R Documentation

Load image files with magick

Description

This function loads images from disk to R, where one can inspect them and then pass them on to imagesToKerasInput, which converts them to input for keras (TensorFlow) models.

Usage

loadImages(
  imageDir,
  fileNames,
  pattern,
  patternInclude = TRUE,
  imageFormats = c("JPG|TIF|PNG|JPEG|TIFF")
)

Arguments

imageDir

character. Directory containing the images to load

fileNames

character. File names to load (they will still be filtered by pattern, if defined)

pattern

character. Pattern to search in file names

patternInclude

logical. Include images with pattern in file names (TRUE) or exclude (FALSE)

imageFormats

character. Image file formats to read.

Value

A list with 2 slots: "img" contains images as a tibble, "info" contains basic information about the images.

Examples

# Example 1: Canopy
wd_images_can <- system.file("images/canopy/resized",
                             package = "imageseg")

images_can <- loadImages(imageDir = wd_images_can)
images_can

# Example 2: Understory
wd_images_us <- system.file("images/understory/resized",
                             package = "imageseg")
images_us <- loadImages(imageDir = wd_images_us)
images_us


[Package imageseg version 0.5.0 Index]