R: Image Converter

image_converter {mlpack} | R Documentation

## Image Converter

### Description

A utility to load an image or set of images into a single dataset that can then be used by other mlpack methods and utilities. This can also unpack an image dataset into individual files, for instance after mlpack methods have been used.

### Usage

    image_converter(
      input,
      channels = NA,
      dataset = NA,
      height = NA,
      quality = NA,
      save = FALSE,
      verbose = FALSE,
      width = NA
    )

### Arguments

`input` | Image filenames which have to be loaded/saved (character vector).
`channels` | Number of channels in the image. Default value "0" (integer).
`dataset` | Input matrix to save as images (numeric matrix).
`height` | Height of the images. Default value "0" (integer).
`quality` | Compression of the image if saved as jpg (0-100). Default value "90" (integer).
`save` | Save a dataset as images. Default value "FALSE" (logical).
`verbose` | Display informational messages and the full list of parameters and timers at the end of execution. Default value "FALSE" (logical).
`width` | Width of the image. Default value "0" (integer).

### Details

This utility takes an image or an array of images and loads them to a matrix. You can optionally specify the height "height" width "width" and channel "channels" of the images that needs to be loaded; otherwise, these parameters will be automatically detected from the image. There are other options too, that can be specified such as "quality".

You can also provide a dataset and save them as images using "dataset" and "save" as an parameter.

### Value

A list with several components:

`output` | Matrix to save images data to, Onlyneeded if you are specifying 'save' option (numeric matrix).

### Author(s)

mlpack developers

### Examples

    #  An example to load an image :

    ## Not run:
    output <- image_converter(input=X, height=256, width=256, channels=3)
    Y <- output$output

    ## End(Not run)

    #  An example to save an image is :

    ## Not run:
    image_converter(input=X, height=256, width=256, channels=3, dataset=Y,
      save=TRUE)

    ## End(Not run)

[Package mlpack version 3.4.2.1 Index]