This function computes the Modified Hausdorff Distance (MHD) which is
proven to function better than the directed HD as per Dubuisson et al.
in the following work:
M. P. Dubuisson and A. K. Jain. A Modified Hausdorff distance for object
matching. In ICPR94, pages A:566-568, Jerusalem, Israel, 1994.
The function computed the forward and reverse distances and outputs the
minimum of both.
Format for calling function:
MHD = ModHausdorffDist(A,B);
MHD = Modified Hausdorff Distance.
A -> Point set 1
B -> Point set 2
No. of samples of each point set may be different but the dimension of
the points must be the same.
Sorry, disregard my previous comment (I don't know how to delete it).
I believe the code disagrees with the modHausdorff distance explanation in the paper cited.
The problem is that the code is summing all min distances (and not all distances within points)
Remove this (twice for A and B) and it should be simliar to the paper explanation
if tempdist < mindist
Thanks, it was really helpful. You can, however, replace the for loops with the following lines:
D = pdist2(A,B);
% Calculating the forward HD
mins = min(D, , 2);
fhd = sum(mins) / Asize(1);
% Calculating the reverse HD
mins = min(D, , 1);
rhd = sum(mins) / Bsize(1);
This will work much much faster but may need more memory to run for very large point sets.
Hi, I have a question regrading about this function. Can you tell me how I can normalize the output for this output?
let me see,thank you anyway~
OK，I know ，thank you!
An elementary correction has been made to the code in the last line where a 'min' instead of a 'max' has been submitted. Please note the correction.
Elementary Correction => 'min' of the last line in the code changed to 'max' as per the paper mentioned in the description.