imagedata: Generate an imagedata

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

1
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

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

matiasb/biOps documentation built on May 21, 2019, 12:55 p.m.