function result = GetDR_Rotation(dif,weight,xtarg,xback,r,theta)
[m n]=size(dif);
result=ones(m,n).*inf;
top=r+1;    left=r+1;
bottom=m-r; right=n-r;
for jj=left:right
    for ii=top:bottom
%         if dif(ii,jj)~=0
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            %Rotation invariant tranform
            p=dif(ii-r:ii+r,jj-r:jj+r);
            Rp=radon(p,theta);
            FRp=abs(fft(Rp,[],2));
            p=reshape(FRp,numel(FRp),1);
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            d1=(p-xtarg);
            d1=d1'*d1;
            d0=(p-xback);
            d0=d0'*d0;
            result(ii,jj)=d1/d0;
%         end
    end
end