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.
workers
A positive numeric scalar or a function specifying the number
of parallel processes that can be active at the same time. By default, the
number of sections is set up to 30% of available cores.