as.matrix.im {spatstat}R Documentation

Convert Pixel Image to Matrix

Description

Convert a pixel image to a matrix

Usage

  ## S3 method for class 'im':
  as.matrix(x, ...)

Arguments

x A pixel image (object of class "im").
... Ignored.

Details

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.

Value

A matrix.

Author(s)

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

Examples

   # 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)

[Package spatstat version 1.11-3 Index]