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).
Barrow, H. G.; Tenenbaum, J. M.; Bolles, R. C.; and Wolf, H. C. "Parametric Correspondence and Chamfer Matching: Two New
Techniques for Image Matching." In Proceedings of the Fifth International
Joint Conference on Artificial Intelligence (Ed. R. Reddy). Los Altos, CA:
William Kaufmann, pp. 659-663, 1977. https://www.ijcai.org/Proceedings/77-2/Papers/024.pdf.Borgefors,
G. "Hierarchical Chamfer Matching: A Parametric Edge Matching Algorithm."
IEEE Trans. Pattern Anal. Mach. Intell.10, 849-865, 1988. https://doi.org/10.1109/34.9107.Fan,
H.; Su, H.; and Guibas, L. J. "A Point Set Generation Network for 3D Object
Reconstruction from a Single Image." In Proceedings of the 2017 IEEE Conference
on Computer Vision and Pattern Recognition (Ed. J. Rehg, Y. Liu, Y. Wu,
and C. Taylor). Piscataway, NJ: IEEE, pp. 2463-2471, 2017. https://doi.org/10.1109/CVPR.2017.264.