spatial_pattern=zeros(winlenth,winlenth);
spatial_pattern((winlenth-3)/2:(winlenth+5)/2,(winlenth-3)/2:(winlenth+5)/2)=target_spatial;
s=zeros(1,winlenth*winlenth);
for i=1:winlenth
for j=1:winlenth
s((i-1)*winlenth+j)=spatial_pattern(i,j);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%% RX运算%%%%%%%%
%【滑】 【动】 【窗】 【去均值】???????????????????
for i=(winlenth+1)/2:(winlenth-1)/2+SizeA(1)
for j=(winlenth+1)/2:(winlenth-1)/2+SizeA(2)
AAA=AA(i-(winlenth-1)/2:i+(winlenth-1)/2,j-(winlenth-1)/2:j+(winlenth-1)/2,:);%滑
x=[];
xn=zeros(SizeA(3),1);
for m=1:winlenth
for n=1:winlenth %动
xn(:)=AAA(m,n,:);
x=[x,xn];
end
end %窗
for n=1:winlenth*winlenth %去均值
x(:,n)=x(:,n)-WinMean;
end %
% figure,imshow();
xx=x*s';
RXdet(i-(winlenth-1)/2,j-(winlenth-1)/2)=xx'*InvCov*xx/(s*s');
end
end
figure,imshow(RXdet,[]);