The Hausdorff distance is a distance between nonempty subsets of a metric space.
Let
be a metric space, and define the distance
from a point
to a nonempty subset
by
. The directed Hausdorff distance from
to
is
|
(1)
|
and the Hausdorff distance is its symmetrization
|
(2)
|
On the collection of nonempty compact subsets of ,
is a metric called the Hausdorff
metric. For more general subsets it can be infinite,
and distinct sets with the same closure can have Hausdorff
distance zero. For nonempty closed intervals
and
in the real line,
.
When
and
are nonempty finite sets, the supremum
and infimum become a maximum
and minimum, respectively, giving
|
(3)
|
For example, for
and
in the real line with the Euclidean
distance,
,
so
.
The Hausdorff distance records the largest nearest-neighbor discrepancy between the two sets. The related chamfer distance instead averages nearest-neighbor discrepancies.