Learn R Programming

pliman (version 2.1.0)

image_augment: Augment Images

Description

This function takes an image and augments it by rotating it multiple times.

Usage

image_augment(
  img,
  pattern = NULL,
  times = 12,
  type = "export",
  dir_original = NULL,
  dir_processed = NULL,
  parallel = FALSE,
  verbose = TRUE
)

Value

If type is "export," augmented images are saved. If type is "return," a list of augmented images is returned.

Arguments

img

An Image object.

pattern

A regular expression pattern to select multiple images from a directory.

times

The number of times to rotate the image.

type

The type of output: "export" to save images or "return" to return a list of augmented images.

dir_original

The directory where original images are located.

dir_processed

The directory where processed images will be saved.

parallel

Whether to perform image augmentation in parallel.

verbose

Whether to display progress messages.

Examples

Run this code
if(interactive()){
library(pliman)
img <- image_pliman("sev_leaf.jpg")
imgs <- image_augment(img, type = "return", times = 4)
image_combine(imgs)
}

Run the code above in your browser using DataLab