Professional Documents
Culture Documents
Compte Rendu TP1 - Soussijemail
Compte Rendu TP1 - Soussijemail
images numériques
a=Im1(120,200)
Im2=Im1(79:178,79:178);
[m n]=size(Im2);
figure (4),imshow(Im2)
imwrite(Im2,'lenapart1.jpg');
imwrite(Im2,'lenapart2.bmp');
Im2a=imred('lenapart1.jpg');
Im2a=imred('lenapart1.jpg');
figure(5),subplot(1,2,1),imshow(Im2a)
Résultats:
1)resultat:
Extrait_comp
Code:
function [C1,C2,C3]= extrait_comp(matriceimage)
C1=matriceimage(:,:,1);
C2=matriceimage(:,:,2);
C3=matriceimage(:,:,3);
figure,
subplot(221);imshow(matriceimage);
subplot(222);imshow(C1);
subplot(223);imshow(C2);
subplot(224);imshow(C3);
End
Code exécution:
clc ; clear all; close all;
Im1=imread('D:\images2020\clown.bmp')
figure, imshow(Im1);
Im2=rgb2hsv(Im1);
figure, imshow(Im2);
Im3=rgb2ycbcr(Im1);
figure, imshow(Im3);
[C1,C2,C3]=extrait_comp(Im1);
[C1,C2,C3]=extrait_comp(Im2);
[C1,C2,C3]=extrait_comp(Im3);
Résultat
function [ech2,ech4]=sousechan1(im)
[m n]=size(im);
ech2=im(1:2:m,1:2:n);
ech4=im(1:2:m,1:2:n);
figure, subplot(131),imshow(im);
subplot(133),imshow(ech2);
subplot(133),imshow(ech4);
End
-----------
clc ;clear all; close all;
Im1=imread ('D:\images2020\lena.bmp')
[e2 e4]=sousechan1(Im1);
Résultat
Quantification
function [mq127,mq31,mq3,mq1]=quanti(Im1)
Im1=double(Im1);
mm=max(max(Im1));
mq127=round(Im1*127/mm);
mq31=round(Im1*31/mm);
mq3=round(Im1*3/mm);
mq1=round(Im1*1/mm);
figure,
subplot(151);imshow(Im1/255);
subplot(152);imshow(mq127/255);
subplot(153);imshow(mq31/255);
subplot(154);imshow(mq3/255);
subplot(155);imshow(mq1/255);
End
-----------
clc;clear all;close all;
Im1=imread('D:\images2020\clown.bmp')
[C1,C2,C3]=extrait_comp(Im1);
[iq127r,iq31r]=quanti(C1);
[iq127v,iq31v]=quanti(C2);
[iq127b,iq31b]=quanti(C3);
Im2(:,:,1)=iq127r;
Im2(:,:,2)=iq127v;
Im2(:,:,3)=iq127b;
Im3(:,:,1)=iq31r;
Im3(:,:,2)=iq31v;
Im3(:,:,3)=iq31b;
IM3=uint8(Im3);
IM2=uint8(Im2);
figure;
subplot(121);
imshow(IM2);
subplot(122);
imshow(IM3);
Résultat