1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| I=imread('westconcordorthophoto.png');
thetax=[1/2,1/4,1/2];thetay=[1/2 1/4 1/2].';theta1=[0 0 0,0 1 0,0 0 0];
dx1=(1./16).*[-0.5 0.5 0,-3 3 0,-0.5 0.5 0 ];dy1=(1./16).*[-0.5 -3 -0.5,0.5 3 0.,0 0 0 ];
figure,imshow(I)
n=3;%n est variable
Imgs = [];
I= double(I)/256;
s=struct('I',[],'w1',[],'w2',[])
for i=1:n
I =conv2(I,thetax,'same');
I =conv2(I,thetay,'same');
Imgs{i}=I; % un tableau de cellules:
[I1,I2]=gradient(I);
w1=immultiply(I1,sqrt(n));
w2=immultiply(I2,sqrt(n));
s(end+1)=struct('I',I,'w1',w1,'w2',w2);
end
for i1=n:1
s.i1=struct('w1',[w1],'w2',[w2]);
I=conv2(I,theta1,'same');
I5=conv2(w1,dx1,'same');
I6=conv2(w2,dy1,'same');
I=(I+I5+I6);
end
figure,imshow(I) |
Partager