closing {spatstat.geom} | R Documentation |
Morphological Closing
Description
Perform morphological closing of a window, a line segment pattern or a point pattern.
Usage
closing(w, r, ...)
## S3 method for class 'owin'
closing(w, r, ..., polygonal=NULL)
## S3 method for class 'ppp'
closing(w, r, ..., polygonal=TRUE)
## S3 method for class 'psp'
closing(w, r, ..., polygonal=TRUE)
Arguments
w |
A window (object of class |
r |
positive number: the radius of the closing. |
... |
extra arguments passed to |
polygonal |
Logical flag indicating whether to compute a polygonal
approximation to the erosion ( |
Details
The morphological closing (Serra, 1982)
of a set by a distance
is the set of all points that cannot be
separated from
by any circle of radius
.
That is, a point
belongs to the closing
if it is impossible to draw any circle of radius
that
has
on the inside and
on the outside.
The closing
contains the original set
.
For a small radius , the closing operation
has the effect of smoothing out irregularities in the boundary of
. For larger radii, the closing operation smooths out
concave features in the boundary. For very large radii,
the closed set
becomes more and more convex.
The algorithm applies dilation
followed by
erosion
.
Value
If r > 0
, an object of class "owin"
representing the
closed region. If r=0
, the result is identical to w
.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.
References
Serra, J. (1982) Image analysis and mathematical morphology. Academic Press.
See Also
opening
for the opposite operation.
dilation
, erosion
for the basic
operations.
owin
,
as.owin
for information about windows.
Examples
v <- closing(letterR, 0.25)
plot(v, main="closing")
plot(letterR, add=TRUE)
plot(closing(cells, 0.1))
points(cells)