In mathematics, the Hausdorff distance, or Hausdorff metric, also called Pompeiu–Hausdorff distance, measures how far two subsets of a metric space are from each other. It turns the set of non-emptycompact subsets of a metric space into a metric space in its own right. It is named after Felix Hausdorff. Informally, two sets are close in the Hausdorff distance if every point of either set is close to some point of the other set. The Hausdorff distance is the longest distance you can be forced to travel by an adversary who chooses a point in one of the two sets, from where you then must travel to the other set. In other words, it is the greatest of all the distances from a point in one set to the closest point in the other set. It seems that this distance was first introduced by Hausdorff in his book Grundzüge der Mengenlehre, first published in 1914, although a very close relative appeared in the doctoral thesis of Maurice Fréchet in 1906, in his study of the space of all continuous curves from.
Definition
Let X and Y be two non-empty subsets of a metric space. We define their Hausdorff distance by where sup represents the supremum and inf the infimum. Equivalently, where that is, the set of all points within of the set . Equivalently, that is,, where is the distance from the point to the set.
Remark
It is not true for arbitrary subsets that implies For instance, consider the metric space of the real numbers with the usual metric induced by the absolute value, Take Then. However because, but. But it is true that and ; in particular it is true if are closed.
Properties
In general, dH may be infinite. If both X and Y are bounded, then dH is guaranteed to be finite.
For every point x of M and any non-empty sets Y, Z of M: d ≤ d + dH, where d is the distance between the point x and the closest point in the set Y.
|diameter-diameter| ≤ 2 dH.
If the intersection X ∩ Y has a non-empty interior, then there exists a constant r > 0, such that every set X′ whose Hausdorff distance from X is less than r also intersects Y.
On the set of all subsets of M, dH yields an extended pseudometric.
On the set F of all non-empty compact subsets of M, dH is a metric.
*The topology of F depends only on the topology of M, not on the metric d.
Motivation
The definition of the Hausdorff distance can be derived by a series of natural extensions of the distance functiond in the underlying metric space M, as follows:
Define a distance function between any point x of M and any non-empty setY of M by:
Define a distance function between any two non-empty sets X and Y of M by:
If X and Y are compact then d will be finite; d=0; and d inherits the triangle inequality property from the distance function in M. As it stands, d is not a metric because d is not always symmetric, and does not imply that . For example,, but. However, we can create a metric by defining the Hausdorff distance to be:
Applications
In computer vision, the Hausdorff distance can be used to find a given template in an arbitrary target image. The template and image are often pre-processed via an edge detector giving a binary image. Next, each 1 point in the binary image of the template is treated as a point in a set, the "shape" of the template. Similarly, an area of the binary target image is treated as a set of points. The algorithm then tries to minimize the Hausdorff distance between the template and some area of the target image. The area in the target image with the minimal Hausdorff distance to the template, can be considered the best candidate for locating the template in the target. In computer graphics the Hausdorff distance is used to measure the difference between two different representations of the same 3D object particularly when generating level of detail for efficient display of complex 3D models.
Related concepts
A measure for the dissimilarity of two shapes is given by Hausdorff distance up to isometry, denoted DH. Namely, let X and Y be two compact figures in a metric space M ; then DH is the infimum of dH along all isometriesI of the metric space M to itself. This distance measures how far the shapesX and Y are from being isometric. The Gromov–Hausdorff convergence is a related idea: we measure the distance of two metric spacesM and N by taking the infimum of dH,J) along all isometric embeddings I:M→L and J:N→L into some common metric space L.