Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.matrix.owin

Convert Pixel Image to Matrix


Description

Converts a pixel image to a matrix.

Usage

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

Arguments

x

A window (object of class "owin").

...

Arguments passed to as.mask to control the pixel resolution.

Details

The function as.matrix.owin converts a window to a logical matrux.

It first converts the window x into a binary pixel mask using as.mask. It then extracts the pixel entries as a logical matrix.

The resulting matrix has entries that are TRUE if the corresponding pixel is inside the window, and FALSE if it is outside.

The function as.matrix is generic. The function as.matrix.owin is the method for windows (objects of class "owin").

Use as.im to convert a window to a pixel image.

Value

A logical matrix.

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

m <- as.matrix(letterR)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.