The chamfer distance is a measure of dissimilarity between two finite nonempty point sets based on nearest-neighbor distances. For point sets and in a metric space with metric
, the directed chamfer distance from
to is commonly defined by
and a symmetric chamfer distance is
Some conventions divide the symmetric expression by 2, omit the normalizing factors, or replace
by its square (Fan et al. 2017). The convention must therefore be specified
when chamfer distances are compared.
Unlike the Hausdorff distance, which uses the largest nearest-neighbor distance, the chamfer distance averages nearest-neighbor
distances and is consequently less sensitive to isolated outliers.
Despite its name, the symmetric chamfer distance is not in general a metric,
since it can fail the triangle inequality.
For example, for ,
, and in the real line, the definition
above gives ,
, and .
Chamfer matching was introduced for image matching by Barrow et al. (1977),
and efficient implementations commonly use a distance transform (Borgefors 1988).