img2r: Convert a vpImage object to a matrix or an array

Description Usage Arguments Value See Also Examples

Description

This function converts a vpImage object to a 2D matrix or a 3D array that can be used in R. Binary, grayscale, and 2D numeric vpImage objects will be converted to 2D matrices. RGB and 3D numeric vpImage objects will be converted to 3D arrays.

Usage

1

Arguments

image

The vpImage object to convert.

Value

This function returns either a 2D matrix or a 3D arrays depending on the input vpImage object.

See Also

r2img, vpImage

Examples

1
2
3
4
filename <- system.file("sample_img/SampleVideo_1080x720_5mb.png", package = "videoplayR")
img <- readImg(filename)
imgMat <- img2r(img)
imgMat

swarm-lab/videoplayR documentation built on May 30, 2019, 9:36 p.m.