www.pudn.com > lianma.rar > ƥ.txt, change:2011-12-17,size:552b


f=imread('D:\query images.tif'); 
%se=strel('disk',10); 
%fc=imclose(f,se); 
fc=imfill(f,'hole'); 
figure,imshow(fc) 
se=strel('disk',15); 
fco=imopen(fc,se); 
 
bw=fco; 
[L,num] = bwlabel(bw); % 
for t=1:num 
    [r c]=find(L==t); 
    r1=min(r); 
    c1=min(c); 
    r2=max(r); 
    c2=max(c); 
   B=bw(r1:r2,c1:c2); 
flag_index=2; 
[M,N]=size(B); 
b = boundaries(B, 4, 'cww');   
d = cellfun('length', b); 
[max_d, k] = max(d); 
b = b{1}; 
bim = bound2im(b, M, N, min(b(:,1)), min(b(:,2))); 
 
c = fchcode(b); 
c.diffmm 
figure;imshow(bim); 
end