Changeset 93
- Timestamp:
- 07/06/14 20:56:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prextra/hausdm.m
r5 r93 1 1 %HAUSDM Hausdorff distance between datasets of image blobs 2 2 % 3 % [DH,DM] = hausdm(A,B ,fid)3 % [DH,DM] = hausdm(A,B) 4 4 % 5 5 % Computes a Hausdorff distance matrix between the sets of binary images 6 6 % A and B, or datasets containing them as features. 7 % Progress is reported in fid (fid = 1: on the sreeen).8 7 % If A and B are image sets and 9 8 % size(A) is [may,max,na] … … 24 23 % P.O. Box 5046, 2600 GA Delft, The Netherlands 25 24 26 function [dh,dm] = hausdm(A,B,fid) 27 if nargin < 3, fid = 0; end 25 function [dh,dm] = hausdm(A,B) 28 26 29 if isdataset(A) & isdataset(B)30 [dh,dm] = hausdm(data2im(A),data2im(B) ,fid);27 if isdataset(A) && isdataset(B) 28 [dh,dm] = hausdm(data2im(A),data2im(B)); 31 29 dh = setdata(A,dh); 32 30 dm = setdata(A,dm); … … 34 32 end 35 33 36 [ ma1,ma2,na] = size(A);37 [ mb1,mb2,nb] = size(B);34 [dummy,dummy,na] = size(A); 35 [dummy,dummy,nb] = size(B); 38 36 dh = zeros(na,nb); 39 37 dm = zeros(na,nb); … … 45 43 K = [min(K):max(K)]; 46 44 a = double(a(K,J)); 47 if length(a(:)) > 045 if ~isempty(a(:)) 48 46 a = bord(a,0); 49 47 end … … 61 59 K = [min(K):max(K)]; 62 60 b = double(b(K,J)); 63 if length(b(:)) > 061 if ~isempty(b(:)) 64 62 b = bord(b,0); 65 63 end … … 73 71 dh(i,j) = max(max(min(dab)),max(min(dab'))); 74 72 dm(i,j) = max(mean(min(dab)),mean(min(dab'))); 75 % if fid, disp([i,j,dh(i,j),dm(i,j)]); end76 fprintf(fid,'%5d %5d %10.3f %8.3f \n',i,j,dh(i,j),dm(i,j));77 73 end 78 74 end
Note: See TracChangeset
for help on using the changeset viewer.