Calculate Hausdorff distance in millimiter
2 次查看(过去 30 天)
显示 更早的评论
Hi,
i have calculated the hausdorff distance, the code that computes the euclidean distance is
function[dist] = compute_dist(A, B)
m = size(A, 1);
n = size(B, 1);
dim= size(A, 2);
for k = 1:m
C = ones(n, 1) * A(k, :);
D = (C-B) .* (C-B);
D = sqrt(D * ones(dim,1));
dist(k) = min(D);
end
giving pixel spacing wich is 1.093x1.093 mm²
if i do
function[dist] = compute_dist(A, B)
m = size(A, 1);
n = size(B, 1);
dim= size(A, 2);
for k = 1:m
C = ones(n, 1) * A(k, :);
D = (1.0973*C-1.0973*B) .* (1.0973*C-1.0973*B);
D = sqrt(D * ones(dim,1));
%D=D*1.0937;
dist(k) = min(D);
end
is it true
Thanks
1 个评论
Image Analyst
2016-8-10
What's A and C represent? And what's their size/shape? Why are there no comments in this code???
The Hausdorf algorithm can be found here: http://cgm.cs.mcgill.ca/~godfried/teaching/cg-projects/98/normand/main.html
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!