COMPTE RENDU TP5 Exercice1: I=imread('cameraman.tif'); subplot(3,1,1); imshow(I
COMPTE RENDU TP5 Exercice1: I=imread('cameraman.tif'); subplot(3,1,1); imshow(I); tite('img'); % Calcul d'histogramme % I=double(I); p=0; for i=1 :256 S = sum(I==p); s = sum(S); h(i)=s; p=p+1; end subplot(3,1,2); bar(h); title('hstg'); % calcul d'histogramme avec imhist % his= imhist(uint8(I)); subplot(3,1,3); bar(his); title('his avec imhist'); Exercice2: IMG= imread('cameraman.tif'); % Binarisation% bin1=zeros( size(IMG)); [N,M]=size(IMG); seuil=128; for i=1:N for j=1:M if IMG(i,j) > seuil bin1(i,j) = 255; else bin1(i,j) = 0; end end end %commande im2bw% bin2= im2bw(IMG); % affichage de deux résultats. subplot(3,1,1) ; imshow(IMG); title('image orignal'); subplot(3,1,2) ; imshow(bin1);title('Binarisation par seuillage '); subplot(3,1,3) ; imshow(bin2);title('Binarisation avec la commande"im2bw" '); *Commentaire: %la binarisation par seuillage affiche le même résultat que la commande im2bw image original binarisation par seuillage commande im2bw uploads/Industriel/ compte-rendu-tp7.pdf
Documents similaires
-
18
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Sep 13, 2021
- Catégorie Industry / Industr...
- Langue French
- Taille du fichier 0.1516MB