Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

image_to_array

3D array representation of images


Description

3D array that represents an image with dimensions (height,width,channels) or (channels,height,width) depending on the data_format.

Usage

image_to_array(img, data_format = c("channels_last", "channels_first"))

image_array_resize(
  img,
  height,
  width,
  data_format = c("channels_last", "channels_first")
)

image_array_save(
  img,
  path,
  data_format = NULL,
  file_format = NULL,
  scale = TRUE
)

Arguments

img

Image

data_format

Image data format ("channels_last" or "channels_first")

height

Height to resize to

width

Width to resize to

path

Path to save image to

file_format

Optional file format override. If omitted, the format to use is determined from the filename extension. If a file object was used instead of a filename, this parameter should always be used.

scale

Whether to rescale image values to be within 0,255

See Also


keras

R Interface to 'Keras'

v2.4.0
MIT + file LICENSE
Authors
Daniel Falbel [ctb, cph, cre], JJ Allaire [aut, cph], François Chollet [aut, cph], RStudio [ctb, cph, fnd], Google [ctb, cph, fnd], Yuan Tang [ctb, cph] (<https://orcid.org/0000-0001-5243-233X>), Wouter Van Der Bijl [ctb, cph], Martin Studer [ctb, cph], Sigrid Keydana [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.