im {spatstat}R Documentation

Create a Pixel Image Object

Description

Creates an object of class "im" representing a two-dimensional pixel image.

Usage

  im(mat, xcol=seq(ncol(mat)), yrow=seq(nrow(mat)))

Arguments

mat matrix of grey level pixel values of the image.
xcol vector of x coordinates for the pixels
yrow vector of y coordinates for the pixels

Details

This function creates an object of class "im" representing a two-dimensional pixel image. See im.object for details of this class.

Note that the row index of the matrix mat corresponds to increasing y coordinate, while the column index of mat corresponds to increasing x coordinate. Thus xrow has one entry for each row of mat and ycol has one entry for each column of mat. A correct display of the image would be obtained by transposing, e.g. image.default(xcol, yrow, t(mat)), if you wanted to do it by hand.

Warnings

The internal representation of images is likely to change in the next release of this package.

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

See Also

im.object, Kmeasure, setcov

Examples

   whitenoise <- im(matrix(rnorm(10000, 100, 100)))
   image(whitenoise)

[Package Contents]