r2img: Convert a matrix or an array to a vpImage object
Description
This function converts a 2D matrix or a 3D array to a vpImage object to that
can be manipulated using the videoplayR image and video
manipulation toolbox. Binary matrices will be converted to binary vpImage
objects. Integer matrices with values in [0, 255] will be converted to
grayscale vpImage objects. Numeric matrics will be converted to 2D numeric
vpImage objects. 3D integer arrays with values in [0, 255] will be converted
to RGB vpImage objects. 3D numeri arrays will be converted to 3D numeric
vpImage objects.
Usage
r2img(array, numeric = FALSE)
Arguments
array
The matrix or array to convert.
numeric
A logical value indicating if the matrix or array should be
treated as a numeric object. If FALSE (default), the matrix or array will be
casted to an integer matrix or array. If TRUE, the matrix or array will be
converted to a numeric vpImage object.