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

pixelcentres

Extract Pixel Centres as Point Pattern


Description

Given a pixel image or binary mask window, extract the centres of all pixels and return them as a point pattern.

Usage

pixelcentres(X, W = NULL, ...)

Arguments

X

Pixel image (object of class "im") or window (object of class "owin").

W

Optional window to contain the resulting point pattern.

...

Optional arguments defining the pixel resolution.

Details

If the argument X is a pixel image, the result is a point pattern, consisting of the centre of every pixel whose pixel value is not NA.

If X is a window which is a binary mask, the result is a point pattern consisting of the centre of every pixel inside the window (i.e. every pixel for which the mask value is TRUE).

Otherwise, X is first converted to a window, then converted to a mask using as.mask, then handled as above.

Value

A point pattern (object of class "ppp").

Author(s)

and Ege Rubak rubak@math.aau.dk

See Also

Examples

pixelcentres(letterR, dimyx=5)

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.