imagedata {biOps} | R Documentation |
This function makes an imagedata object from a matrix. This data structure is primary data structure to represent image in biOps package.
imagedata(mat, type=NULL, ncol=dim(mat)[1], nrow=dim(mat)[2])
mat |
array, matrix or vector |
type |
"rgb" or "grey" |
ncol |
width of image |
nrow |
height of image |
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.
return an imagedata object
plot.imagedata
print.imagedata
p <- q <- seq(-1, 1, length=20) r <- 1 - outer(p^2, q^2, "+") / 2 plot(imagedata(r))