2. 相关
%%%%%%%%%%%%%%%%%%%%%%% 相关 %%%%%%%%%%%%%%%%%%%%%%%%
min=1e8;
fichier2='acquisition165.jpg';
x2=imread(fichier2);
fenetrei=fenetre;
xx=fenetrei.centre(1)
yy=fenetrei.centre(2);
for i=1:1:20
fenetrei.centre(1)=fenetrei.centre(1)-1;
fenetrei.centre(2)=yy;
for j=1:1:20
fenetrei.sommets=[];
fenetrei.centre(2)=fenetrei.centre(2)-1;
[fenetrei]=InitFen(fenetrei,x2);
figure(3)
clf;
image(fenetrei.wind_coul/255)
% pause(0.05)
%%%%%%%%%% 相关计算 %%%%%%%%%%%%%%%%%%%%%
f1=fenetre.wind_coul(:,:,1);
f2=fenetre.wind_coul(:,:,2);
f3=fenetre.wind_coul(:,:,3);
g1=fenetrei.wind_coul(:,:,1);
g2=fenetrei.wind_coul(:,:,2);
g3=fenetrei.wind_coul(:,:,3);
[n,m]=size(f1-g1);
sommefg=(f1-g1).^2+(f2-g2).^2+(f3-g3).^2;
SSD(i,j)=sum(sum(sommefg)); %计算 SSD
<span lang="EN-US">if SSD(i,j)
|