could you send code of Hausdorrf distance and average Hausdorff distance for segmention evaluation for images
3 views (last 30 days)
Show older comments
I have segment medical image and I want to evaluate the segmentation equality of the edges by Hausdorff distance and average Hausdorff distance because I have ground truth for segmented image. so could you send code read the two images(segmented image, ground truth image)and applies these metrics( Hausdorff distance and average Hausdorff distance). Many thanks in advance
0 Comments
Answers (1)
hossein
on 28 Aug 2019
function DistMap=f_hausdorf(Gt, Dc)
% Baptiste Magnier, 2017,
% compute the distance map based on the Hausdorff distance
% it corresponds to the max the the euclidean distance
% of the edge points between Gt and Dc
% biblio :
% D. P. Huttenlocher and W. J. Rucklidge,
% A multi-resolution technique for comparing images using the Hausdorff distance,
% IEEE Trans. on Pattern Analysis and Machine Intel.: Vol. 15(9), pp. 850�863, 1993.
if length(size(Gt))~=length(size(Dc))
error('Images Gt and Dc are not of the same size\n');
end
DistGt=bwdist(Gt);
DistDc=bwdist(Dc);
DistMap=double(xor(Gt,Dc)).*max(DistGt,DistDc);
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!