www.pudn.com > PCNN.rar > PCNN_large_arrange.asv, change:2009-06-14,size:1381b


function R=PCNN_large_arrange(matrix,link_arrange,np,pre_flag) 
% R=PCNN_large_arrange(matrix,link_arrange,np,pre_flag) 
% compute the fire times of each pixel in the PCNN  
% np is the iterative times 
% R is the fire times of coefficients of wavelet decomposition 
 
disp('PCNN is processing...') 
[p,q]=size(matrix); 
% computes the normalized matrix of the matrixA and  matrixB 
F_NA=Normalized(matrix); 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% Initialize the parameters.  
% You'd better change them according to your applications  
alpha_L=1; 
alpha_Theta=0.2; 
 beta=3; 
vL=1.00; 
vTheta=20; 
% Generate the null matrix that could be used 
L=zeros(p,q); 
U=zeros(p,q); 
Y=zeros(p,q); 
Y0=zeros(p,q); 
Theta=zeros(p,q); 
% Compute the linking strength. 
center_x=round(link_arrange/2); 
center_y=round(link_arrange/2); 
W=zeros(link_arrange,link_arrange); 
for i=1:link_arrange 
    for j=1:link_arrange 
        if (i==center_x)&&(j==center_y) 
            W(i,j)=0; 
        else 
            W(i,j)=1./sqrt((i-center_x).^2+(j-center_y).^2); 
        end 
    end 
end 
%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% F=F_NA; 
% for n=1:np 
%      K=conv2(Y,W,'same') ; 
%      
%     L=exp(-alpha_L)*L+vL*K; 
%      
%     Theta=exp(-alpha_Theta)*Theta+vTheta*Y; 
%     U=F.*(1+beta*L); 
%     Y=im2double(U>Theta); 
%     Y0=Y0+Y;    
% end 
          
%% 
  
% R=Y0;