
Last chance! 50% off unlimited learning
Sale ends in
Converts a pixel image to a matrix or an array.
# S3 method for im
as.matrix(x, ...)
# S3 method for im
as.array(x, ...)
A matrix or array.
A pixel image (object of class "im"
).
See below.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner r.turner@auckland.ac.nz
The function as.matrix.im
converts the pixel image x
into a matrix containing the pixel values.
It is handy when you want to extract a summary of the pixel values.
See the Examples.
The function as.array.im
converts the pixel image to an array.
By default this is a three-dimensional array of dimension ...
are given, they will be passed
to array
, and they may change the dimensions of the
array.
as.matrix.owin
# artificial image
Z <- setcov(square(1))
M <- as.matrix(Z)
median(M)
# plot the cumulative distribution function of pixel values
# plot(ecdf(as.matrix(Z)))
Run the code above in your browser using DataLab