as.cimg.array: Turn an numeric array into a cimg object

as.cimg.arrayR Documentation

Turn an numeric array into a cimg object

Description

If the array has two dimensions, we assume it's a grayscale image. If it has three dimensions we assume it's a video, unless the third dimension has a depth of 3, in which case we assume it's a colour image,

Usage

## S3 method for class 'array'
as.cimg(obj, ...)

Arguments

obj

an array

...

ignored

Examples


as.cimg(array(1:9,c(3,3)))
as.cimg(array(1,c(10,10,3))) #Guesses colour image
as.cimg(array(1:9,c(10,10,4))) #Guesses video

imager documentation built on May 29, 2024, 1:38 a.m.