LoadImage: Load images and concatenate channels.

Description Usage Arguments Details Value Examples

Description

Load images using the given loader() function, and concatenate all images loaded as a new multi-channel image.

Usage

1
2
3
4
5
LoadImage(files, loader, h = NULL, w = NULL, nch = NULL,
  channel_last = TRUE, ret.flatten = FALSE)

LoadPNG(files, h = NULL, w = NULL, nch = NULL, channel_last = TRUE,
  ret.flatten = FALSE)

Arguments

files

files to load.

loader

a function to load the images.

h

OPTIONAL, height of the image. Default: Evaluated during run.

w

OPTIONAL, width of the image. Default: Evaluated during run.

nch

OPTIONAL, total channel number of the concatenated image. Default: Evaluated during run.

channel_last

whether the images are channel_last format. Default: TRUE

ret.flatten

whether to return a flatten vector. Default: FALSE

Details

It is encouraged to provide h and w unless ret.flatten is TRUE, since an extra loading is run to evaluate them thus reducing performance.

Value

a 3-d array.

Examples

1
2
3
4
dummy <- function(id) matrix(runif(64), 8, 8)
files <- c("ch1", "ch2", "ch3")
img <- LoadImage(files, dummy)
img_flat <- LoadImage(files, dummy, ret.flatten = TRUE)

imlijunda/AwkwardMLTools documentation built on May 13, 2019, 11:33 a.m.