deltametric | R Documentation |
Computes the discrepancy between two sets A
and B
according to Baddeley's delta-metric.
deltametric(A, B, p = 2, c = Inf, ...)
A , B |
The two sets which will be compared.
Windows (objects of class |
p |
Index of the |
c |
Distance threshold.
Either a positive numeric value, or |
... |
Arguments passed to |
Baddeley (1992a, 1992b) defined a distance
between two sets A
and B
contained in a space W
by
\Delta(A,B) = \left[
\frac 1 {|W|}
\int_W
\left| \min(c, d(x,A)) - \min(c, d(x,B)) \right|^p \, {\rm d}x
\right]^{1/p}
where c \ge 0
is a distance threshold parameter,
0 < p \le \infty
is the exponent parameter,
and d(x,A)
denotes the
shortest distance from a point x
to the set A
.
Also |W|
denotes the area or volume of the containing space W
.
This is defined so that it is a metric, i.e.
\Delta(A,B)=0
if and only if A=B
\Delta(A,B)=\Delta(B,A)
\Delta(A,C) \le \Delta(A,B) + \Delta(B,C)
It is topologically equivalent to the Hausdorff metric (Baddeley, 1992a) but has better stability properties in practical applications (Baddeley, 1992b).
If p=\infty
and c=\infty
the Delta metric
is equal to the Hausdorff metric.
The algorithm uses distmap
to compute the distance maps
d(x,A)
and d(x,B)
, then approximates the integral
numerically.
The accuracy of the computation depends on the pixel resolution
which is controlled through the extra arguments ...
passed
to as.mask
.
A numeric value.
and \rolf
Baddeley, A.J. (1992a)
Errors in binary images and an L^p
version of the Hausdorff metric.
Nieuw Archief voor Wiskunde 10, 157–183.
Baddeley, A.J. (1992b) An error metric for binary images. In W. Foerstner and S. Ruwiedel (eds) Robust Computer Vision. Karlsruhe: Wichmann. Pages 59–78.
distmap
X <- runifrect(20)
Y <- runifrect(10)
deltametric(X, Y, p=1,c=0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.