Filter löschen
Filter löschen

Calculate Hausdorff distance in millimiter

2 Ansichten (letzte 30 Tage)
sbei arafet
sbei arafet am 10 Aug. 2016
Kommentiert: Image Analyst am 10 Aug. 2016
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 Kommentar
Image Analyst
Image Analyst am 10 Aug. 2016
What's A and C represent? And what's their size/shape? Why are there no comments in this code???

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by