www.pudn.com > ROLD-EPR.zip > OBJfun.m, change:2005-10-13,size:797b


function [y,passvec1,passvec2,passvec3,passvec4]=OBJfun(Img,noisevec,phi,alpha,nearcoordinate,nearvec) 
%global nearcoordinate nearvec 
passvec1=noisevec-Img(nearcoordinate(:,1)); 
passvec2=noisevec-Img(nearcoordinate(:,2)); 
passvec3=noisevec-Img(nearcoordinate(:,3)); 
passvec4=noisevec-Img(nearcoordinate(:,4)); 
y=sum(feval(phi,passvec1(nearvec(:,1)),alpha))+sum(feval(phi,passvec2(nearvec(:,2)),alpha))+... 
                              sum(feval(phi,passvec3(nearvec(:,3)),alpha))+sum(feval(phi,passvec4(nearvec(:,4)),alpha))+... 
                              sum(2*feval(phi,passvec1(~nearvec(:,1)),alpha))+sum(2*feval(phi,passvec2(~nearvec(:,2)),alpha))+... 
                              sum(2*feval(phi,passvec3(~nearvec(:,3)),alpha))+sum(2*feval(phi,passvec4(~nearvec(:,4)),alpha));