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
and the Hausdorff distance is its symmetrization
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,
.
The Hausdorff distance records the largest nearest-neighbor discrepancy between the two sets. The related chamfer distance instead averages nearest-neighbor discrepancies.