Goal
For binary images, intensity information is poor and shape extraction is often difficult. Therefore binary images have to be compared without using feature extraction.
The Local Dissimilarity Map (LDM) is an useful way to compare two binary images, providing a localized and quantified information.
The LDM is computed from the following equation:
![]()
where
is the distance transform of image
(giving the distance to the nearest foreground pixel). For binary images, the equation can be simplified into :
![]()
References
Read the paper (PDF file - also click on the arrow below) :
- [2008,article] bibtex
E. Baudrier, F. Nicolier, G. Millon, and S. Ruan, "The Adaptative Local Hausdorff-Distance Map as a new Dissimilarity Measure," Pattern Recognition, vol. 41, iss. 5, pp. 1461-1478, 2008.@ARTICLE{Baudrier2008,
author = {E. Baudrier and F. Nicolier and G. Millon and S. Ruan},
title = {The Adaptative Local Hausdorff-Distance Map as a new Dissimilarity Measure},
journal = {Pattern Recognition},
year = {2008},
volume = {41},
pages = {1461--1478},
number = {5},
month = {may},
url = {http://pixel-shaker.fr/wp-content/uploads/publications/Baudrier2008.pdf} }
Examples
(black is foreground)
(Images are from "L'histoire des Quatres fils Aymon" - see Médiathèque de l'Agglomération Troyenne)
Java implementation
(Feel free to contact me for any question/remark/bug)
- Standalone jar file : LDMBinary.jar (sources included, see crestic/tip/LDM.java)
java -jar LDMBinary.jar ImageA ImageB [options] (Please note that ImageA and ImageB are binarized if necessary) Options usage: -out LDM image (default: ldm.png) -display Display images - no output -help Describe command line
Sage notebook
With code and test images : reference_implementation_ldm.sws