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

erosionAny

Morphological Erosion of Windows


Description

Compute the morphological erosion of one spatial window by another.

Usage

erosionAny(A, B)

A %(-)% B

Arguments

A,B

Windows (objects of class "owin").

Details

The operator A %(-)% B and function erosionAny(A,B) are synonymous: they both compute the morphological erosion of the window A by the window B.

The morphological erosion A %(-)% B of region A by region B is the spatial region consisting of all vectors z such that, when B is shifted by the vector z, the result is a subset of A.

Equivalently

(A^c %+% (-B))^c

where %+% is the Minkowski sum, A^c denotes the set complement, and (-B) is the reflection of B through the origin, consisting of all vectors -b where b is a point in B.

If B is a disc of radius r, then erosionAny(A, B) is equivalent to erosion(A, r). See erosion.

The algorithm currently computes the result as a polygonal window using the polyclip library. It will be quite slow if applied to binary mask windows.

Value

Another window (object of class "owin").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk

See Also

Examples

B <- square(c(-0.1, 0.1))
  RminusB <- letterR %(-)% B
  FR <- grow.rectangle(Frame(letterR), 0.3)
  plot(FR, main="", type="n")
  plot(letterR, add=TRUE, lwd=2, hatch=TRUE, box=FALSE)
  plot(RminusB, add=TRUE, col="blue", box=FALSE)
  plot(shift(B, vec=c(3.49, 2.98)),
       add=TRUE, border="red", lwd=2)

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.