Hausdorff distance explained

In mathematics, the Hausdorff distance, or Hausdorff metric, also called Pompeiu–Hausdorff distance,[1] measures how far two subsets of a metric space are from each other. It turns the set of non-empty compact subsets of a metric space into a metric space in its own right. It is named after Felix Hausdorff and Dimitrie Pompeiu.

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 someone can be forced to travel by an adversary who chooses a point in one of the two sets, from where they 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.

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

[0,1]\to\R3

.

Definition

Let

(M,d)

be a metric space. For each pair of non-empty subsets

X\subsetM

and

Y\subsetM

, the Hausdorff distance between

X

and

Y

is defined as

d_(X,Y) := \max\left\,

where

\operatorname{sup}

represents the supremum operator,

\operatorname{inf}

the infimum operator, and where

d(a,B):=infbd(a,b)

quantifies the distance from a point

a\inX

to the subset

B\subseteqX

.

An equivalent definition is as follows.[2] For each set

X\subsetM,

let X_\varepsilon := \bigcup_ \,which is the set of all points within

\varepsilon

of the set

X

(sometimes called the

\varepsilon

-fattening of

X

or a generalized ball of radius

\varepsilon

around

X

).Then, the Hausdorff distance between

X

and

Y

is defined as d_H(X,Y) := \inf\.

Equivalently,[1] \begind_H(X, Y) &= \sup_ \left| \inf_ d(w,x) - \inf_ d(w,y)\right| \\ &= \sup_ \left| \inf_ d(w,x) - \inf_ d(w,y)\right| \\ &= \sup_ | d(w, X) - d(w, Y)|,\end where

d(w,X):=infxd(w,x)

is the smallest distance from the point

w

to the set

X

.

Remark

It is not true for arbitrary subsets

X,Y\subsetM

that

dH(X,Y)=\varepsilon

implies

X\subseteqY\varepsilonandY\subseteqX\varepsilon.

For instance, consider the metric space of the real numbers

R

with the usual metric

d

induced by the absolute value,

d(x,y):=|y-x|,x,y\in\R.

Take

X:=(0,1]andY:=[-1,0).

Then

dH(X,Y)=1 

. However

X\nsubseteqY1

because

Y1=[-2,1)

, but

1\inX

.

But it is true that

X\subseteq\overline{Y\varepsilon}

and

Y\subseteq\overline{X\varepsilon}

; in particular it is true if

X,Y

are closed.

Properties

dH(X,Y)

may be infinite. If both X and Y are bounded, then

dH(X,Y)

is guaranteed to be finite.

dH(X,Y)=0

if and only if X and Y have the same closure.

Motivation

The definition of the Hausdorff distance can be derived by a series of natural extensions of the distance function

d(x,y)

in the underlying metric space M, as follows:[6]

d(x,Y)=inf\{d(x,y)\midy\inY\}.

For example, d(1,) = 2 and d(7,) = 1.

d(X,Y)=\sup\{d(x,Y)\midx\inX\}.

For example, d(\,\) = \sup\ = \sup\ = 2.

X\subseteq\overline{Y}

). For example,, but . However, we can create a metric by defining the Hausdorff distance to be:

dH(X,Y)=max\{d(X,Y),d(Y,X)\}.

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 (activated) 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[7] particularly when generating level of detail for efficient display of complex 3D models.

If

X

is the surface of Earth, and

Y

is the land-surface of Earth, then by finding the point Nemo, we see

dH(X,Y)

is around 2,704.8 km.

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 (usually a Euclidean space); then DH(X,Y) is the infimum of dH(I(X),Y) among all isometries I of the metric space M to itself. This distance measures how far the shapes X and Y are from being isometric.

The Gromov–Hausdorff convergence is a related idea: measuring the distance of two metric spaces M and N by taking the infimum of

dH(I(M),J(N))

among all isometric embeddings

I\colonM\toL

and

J\colonN\toL

into some common metric space L.

See also

External links

Notes and References

  1. Book: R. Tyrrell Rockafellar . R. Tyrrell . Rockafellar . Roger J-B Wets . Roger J-B . Wets . Variational Analysis . Springer-Verlag . 2005 . 3-540-62772-3 . 117 .
  2. Book: Munkres, James . James Munkres. [{{Google books |plainurl=yes |id=XjoZAQAAIAAJ |page=280 }} Topology ]. 2nd . . 1999 . 0-13-181629-2 . 280–281 .
  3. https://math.stackexchange.com/q/375296 Diameter and Hausdorff Distance
  4. https://math.stackexchange.com/q/732850 Hausdorff Distance and Intersection
  5. Completeness and total boundedness of the Hausdorff metric . Jeff . Henrikson . MIT Undergraduate Journal of Mathematics . 1999 . 69–80 . dead . https://web.archive.org/web/20020623095720/http://www-math.mit.edu/phase2/UJM/vol1/HAUSF.PDF . June 23, 2002 .
  6. Book: Barnsley , Michael . Michael Barnsley . Fractals Everywhere . . 1993 . Ch. II.6 . 0-12-079069-6.
  7. P. . Cignoni . C. . Rocchini . R. . Scopigno . Metro: Measuring Error on Simplified Surfaces . Computer Graphics Forum . 17 . 2 . 1998 . 167–174 . 10.1111/1467-8659.00236 . 10.1.1.95.9740 . 17783159 .