Image objects are the base objects of the
Rvision package. They contain an
OpenCV image that can originate from an image
file, an array, a video file or a video stream. This image can be
manipulated using the functions of Rvision.
Function for creating Image objects from arrays
and image files.
Arguments
- ...
When created from an image file,
imagetakes one argument that is a character string indicating the path to the image file. When created from an array (e.g. a matrix), it takes this array as its single argument. AnImageobject can also be created without any argument, in which case it is empty and can be populated with an image later.- colorspace
A string indicating the desired color space for the image.
Slots
depthA function returning the bit depth of the object.
dim,ncol,nrow,nchanFunctions returning the dimensions of the object.
spaceA character string indicating the colorspace of the object.
pget,psetFunctions to get and set single pixel values.
toRA function to convert the object to an R array.
fromGPUA function retrieving the object from GPU memory.
toGPUA function sending the object to GPU memory.
GPUA boolean indicating whether the object is in GPU memory.
writeA function to write the object to a file.
Note
Image objects can be created from video files and video streams
using the following functions: video, stream.
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
noise <- image(array(sample(0:255, 100 * 100 * 3, replace = TRUE), dim = c(100, 100, 3)))