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 \ominus 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 \ominus B = ((A^c \oplus (-B))^c
$$
where \(\oplus\) 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.