imagedata {biOps}R Documentation

Generate an imagedata

Description

This function makes an imagedata object from a matrix. This data structure is primary data structure to represent image in biOps package.

Usage

imagedata(mat, type=NULL, ncol=dim(mat)[1], nrow=dim(mat)[2])

Arguments

mat array, matrix or vector
type "rgb" or "grey"
ncol width of image
nrow height of image

Details

For grey scale image, matrix should be given in the form of 2 dimensional matrix. First dimension is row, and second dimension is column.

For rgb image, matrix should be given in the form of 3 dimensional array (row, column, channel). mat[,,1], mat[,,2], mat[,,3] are red plane, green plane and blue plane, respectively.

You can omit 'type' specification if you give a proper array or matrix.

Value

return an imagedata object

See Also

plot.imagedata print.imagedata

Examples

        p <- q <- seq(-1, 1, length=20)
        r <- 1 - outer(p^2, q^2, "+") / 2
        plot(imagedata(r))

[Package biOps version 0.2.1 Index]