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 26 27 28 29 30 31 32 33
| im1 = rand(3)>.5;
im2 = rand(3)>.5;
figure
colormap(gray)
subplot(2,2,1)
imagesc(im1)
axis image
title('im1')
subplot(2,2,2)
imagesc(im2)
axis image
title('im2')
subplot(2,2,3)
imagesc(im1 & im2)
title('im1 & im2')
axis image
% comparer l'im1 avec l'im2
for i=1:size(im1,1)
for j=1:size(im1,2)
if im1(i,j) && (im1(i,j)==im2(i,j))
im1(i,j)=1;
else
im1(i,j)=0;
end
end
end
subplot(2,2,4)
imagesc(im1)
title('im1(i,j) && (im1(i,j)==im2(i,j))')
axis image |
Partager