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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
function Emp
%Lecture des 4 images
a=imread('D:\Cours\Ecosse5th\5thYear\Projet\Software\Matlab\Empreintes\Emp1.jpg');
b=imread('D:\Cours\Ecosse5th\5thYear\Projet\Software\Matlab\Empreintes\Emp2.jpg');
c=imread('D:\Cours\Ecosse5th\5thYear\Projet\Software\Matlab\Empreintes\Emp3.jpg');
d=imread('D:\Cours\Ecosse5th\5thYear\Projet\Software\Matlab\Empreintes\Emp4.jpg');
%préallocation de l'espace mémoire des nouvelles images
NewA=zeros(194,193);
NewB=zeros(194,193);
NewC=zeros(194,193);
NewD=zeros(194,193);
%Threshold et création des nouvelles images binaires
for y=1:194
for x=1:193
if(a(y,x)>125)
NewA(y,x)=1;
else
NewA(y,x)=0;
end
if(b(y,x)>125)
NewB(y,x)=1;
else
NewB(y,x)=0;
end
if(c(y,x)>125)
NewC(y,x)=1;
else
NewC(y,x)=0;
end
if(d(y,x)>125)
NewD(y,x)=1;
else
NewD(y,x)=0;
end
end
end
figure(2)
colormap('gray');
subplot(4,2,1);
imshow(a);
subplot(4,2,2);
imshow(NewA);
subplot(4,2,3);
imshow(b);
subplot(4,2,4);
imshow(NewB);
subplot(4,2,5);
imshow(c);
subplot(4,2,6);
imshow(NewC);
subplot(4,2,7);
imshow(d);
subplot(4,2,8);
imshow(NewD);
%Superposer les 4 images
res = NewA & NewB & NewC & NewD;
figure(3)
colormap('gray');
imshow(res);
end |
Partager