www.pudn.com > lianma.rar > train.m, change:2011-12-18,size:350b


function [trainset]= train( ) 
f=imread('D:\butterfly.gif'); 
f=f.*255; 
se=strel('disk',12); 
B=imopen(f,se); 
[M,N] = size(B); 
% 8-connectivity, counterclockwise 
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); 
trainset=c.diffmm; 
end