erode.owin {spatstat} | R Documentation |
Perform morphological erosion of a window
erosion.owin(w, r, shrink.frame=TRUE, ..., strict=FALSE) erode.owin(w, r, shrink.frame=TRUE, ..., strict=FALSE)
w |
A window (object of class "owin" . |
r |
positive number: the radius of erosion. |
shrink.frame |
logical: if TRUE , erode the bounding
rectangle as well. |
... |
extra arguments to as.mask
controlling the pixel resolution |
strict |
Logical flag determining the fate of boundary pixels. See details. |
The morphological erosion of a set W by a distance r > 0 is the subset consisting of all points x in W such that the distance from x to the boundary of W is greater than or equal to r. In other words it is the result of trimming a margin of width r off the set W.
The functions erode.owin
and erosion.owin
are
identical; they compute the erosion of the window w
.
If w
is not
a rectangle, it must be approximated by a binary pixel image,
and the arguments "..."
are passed to as.mask
to determine the pixel resolution. There is a sensible default.
For non-rectangular windows, the erosion consists of all pixels
whose distance
from the boundary of w
is strictly greater than r
(if
strict=TRUE
) or is greater than or equal to r
(if
strict=FALSE
).
If shrink.frame
is false, the resulting window is given the
same outer, bounding rectangle as the original window w
.
If shrink.frame
is true, the original bounding rectangle
is also eroded by the same distance r
.
To simply compute the area of the eroded window,
use eroded.areas
.
Another object of class "owin"
representing the
eroded window.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
dilate.owin
for the opposite operation.
w <- owin(c(0,1),c(0,1)) v <- erode.owin(w, 0.1) # returns rectangle [0.1, 0.9] x [0.1,0.9] ## Not run: v <- erode.owin(w, 0.6) # erosion is empty ## End(Not run)