as.matrix.im {spatstat} | R Documentation |
Convert a pixel image to a matrix
## S3 method for class 'im': as.matrix(x, ...)
x |
A pixel image (object of class "im" ). |
... |
Ignored. |
This function takes the pixel image x
and returns a matrix containing the pixel values.
It is handy when you want to extract a summary of the pixel values. See the Examples.
A matrix.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
# artificial image Z <- setcov(square(1)) M <- as.matrix(Z) median(M) ## Not run: # plot the cumulative distribution function of pixel values plot(ecdf(as.matrix(Z))) ## End(Not run)