# opening.owin

##### Morphological Opening of a Window

Perform morphological opening of a window

##### Usage

`opening.owin(w, r, ...)`

##### Arguments

- w
- A window (object of class
`"owin"`

. - r
- positive number: the radius of the opening.
- ...
- extra arguments passed to
`as.mask`

controlling the pixel resolution

##### Details

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

.

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

This function computes the opening 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 `erode.owin`

followed by
`dilate.owin`

.

##### Value

- Another object of class
`"owin"`

representing the opened window.

##### References

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

##### See Also

`closing.owin`

for the opposite operation.

`dilate.owin`

, `erode.owin`

for the basic
operations.
`owin`

,
`as.owin`

for information about windows.

##### Examples

```
data(letterR)
v <- opening.owin(letterR, 0.3, dimyx=256)
plot(v, main="opening.owin")
plot(letterR, add=TRUE)
```

*Documentation reproduced from package spatstat, version 1.15-2, License: GPL (>= 2)*