opening {spatstat.geom}R Documentation

Morphological Opening

Description

Perform morphological opening of a window, a line segment pattern or a point pattern.

Usage

 opening(w, r, ...)

 ## S3 method for class 'owin'
opening(w, r, ..., polygonal=NULL)

 ## S3 method for class 'ppp'
opening(w, r, ...)

 ## S3 method for class 'psp'
opening(w, r, ...)

Arguments

w

A window (object of class "owin" or a line segment pattern (object of class "psp") or a point pattern (object of class "ppp").

r

positive number: the radius of the opening.

...

extra arguments passed to as.mask controlling the pixel resolution, if a pixel approximation is used

polygonal

Logical flag indicating whether to compute a polygonal approximation to the erosion (polygonal=TRUE) or a pixel grid approximation (polygonal=FALSE).

Details

The morphological opening (Serra, 1982) of a set WW by a distance r>0r > 0 is the subset of points in WW that can be separated from the boundary of WW by a circle of radius rr. That is, a point xx belongs to the opening if it is possible to draw a circle of radius rr (not necessarily centred on xx) that has xx on the inside and the boundary of WW on the outside. The opened set is a subset of W.

For a small radius rr, the opening operation has the effect of smoothing out irregularities in the boundary of WW. For larger radii, the opening operation removes promontories in the boundary. For very large radii, the opened set is empty.

The algorithm applies erosion followed by dilation.

Value

If r > 0, an object of class "owin" representing the opened region. If r=0, the result is identical to w.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

and Rolf Turner rolfturner@posteo.net

References

Serra, J. (1982) Image analysis and mathematical morphology. Academic Press.

See Also

closing for the opposite operation.

dilation, erosion for the basic operations.

owin, as.owin for information about windows.

Examples

  v <- opening(letterR, 0.3)
  plot(letterR, type="n", main="opening")
  plot(v, add=TRUE, col="grey")
  plot(letterR, add=TRUE)

[Package spatstat.geom version 3.3-2 Index]