MinkowskiSum {spatstat.geom} | R Documentation |
Minkowski Sum of Windows
Description
Compute the Minkowski sum of two spatial windows.
Usage
MinkowskiSum(A, B)
A %(+)% B
dilationAny(A, B)
Arguments
A , B |
Windows (objects of class |
Details
The operator A %(+)% B
and function MinkowskiSum(A,B)
are synonymous: they both compute the
Minkowski sum of the windows A
and B
.
The function dilationAny
computes the Minkowski dilation
A %(+)% reflect(B)
.
The Minkowski sum
of two spatial regions and
is another region, formed by taking all possible pairs of points,
one in
and one in
, and adding them as vectors.
The Minkowski Sum
is the set of all points
where
is in
and
is in
.
A few common facts about the Minkowski sum are:
-
The sum is symmetric:
.
-
If
is a single point, then
is a shifted copy of
.
-
If
is a square of side length
, and
is a square of side length
, with sides that are parallel to the coordinate axes, then
is a square of side length
.
-
If
and
are discs of radius
and
respectively, then
is a disc of redius
.
-
If
is a disc of radius
centred at the origin, then
is equivalent to the morphological dilation of
by distance
. See
dilation
.
The Minkowski dilation is the closely-related region
where
is the reflection of
through the origin.
The Minkowski dilation is the set of all vectors
such that, if
is shifted by
, the resulting set
has nonempty intersection with
.
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.
The arguments A
and B
can also be point patterns or line
segment patterns. These are interpreted as spatial regions, the
Minkowski sum is computed, and the result is returned as an object of
the most appropriate type. The Minkowski sum of two point patterns is
another point pattern. The Minkowski sum of a point pattern and a line
segment pattern is another line segment pattern.
Value
A window (object of class "owin"
) except that
if A
is a point pattern, then the result is an object of the same
type as B
(and vice versa).
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
See Also
Examples
B <- square(0.2)
RplusB <- letterR %(+)% B
opa <- par(mfrow=c(1,2))
FR <- grow.rectangle(Frame(letterR), 0.3)
plot(FR, main="")
plot(letterR, add=TRUE, lwd=2, hatch=TRUE, hatchargs=list(texture=5))
plot(shift(B, vec=c(3.675, 3)),
add=TRUE, border="red", lwd=2)
plot(FR, main="")
plot(letterR, add=TRUE, lwd=2, hatch=TRUE, hatchargs=list(texture=5))
plot(RplusB, add=TRUE, border="blue", lwd=2,
hatch=TRUE, hatchargs=list(col="blue"))
par(opa)
plot(cells %(+)% square(0.1))