closing.owin {spatstat} | R Documentation |
Perform morphological closing of a window
closing.owin(w, r, ..., polygonal=TRUE)
w |
A window (object of class "owin" . |
r |
positive number: the radius of the closing. |
... |
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 ).
|
The morphological closing (Serra, 1982) of a set W by a distance r > 0 is the set of all points that cannot be separated from W by any circle of radius r. That is, a point x belongs to the closing W* if it is impossible to draw any circle of radius r that has x on the inside and W on the outside. The closing W* contains the original set W.
For a small radius r, the closing operation has the effect of smoothing out irregularities in the boundary of W. For larger radii, the closing operation smooths out concave features in the boundary. For very large radii, the closed set W* becomes more and more convex.
This function computes the closing of the window w
as a binary pixel mask. If w
is not already a mask, it is first
converted to a mask by as.mask
. The arguments
"..."
determine the pixel resolution. There is a sensible
default.
The algorithm simply applies dilate.owin
followed by
erode.owin
.
Another object of class "owin"
representing the
closed window.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
Serra, J. (1982) Image analysis and mathematical morphology. Academic Press.
opening.owin
for the opposite operation.
dilate.owin
, erode.owin
for the basic
operations.
owin
,
as.owin
for information about windows.
data(letterR) v <- closing.owin(letterR, 0.25, dimyx=256) plot(v, main="closing.owin") plot(letterR, add=TRUE)