Nama: I Made Bayu Krisna Putra NIM: F1B015027 Tugas PCD Segementasi 2018 Memisahkan Suatu Objek Dalam Foto Script

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Nama : I Made Bayu Krisna Putra

NIM : F1B015027

Tugas PCD Segementasi 2018

Memisahkan suatu objek dalam foto

Script :

close all;
clear all;
clc;

A= imread ('bayu.jpg');
size (A);

r= A (:,:,1);
g= A (:,:,2);
b= A (:,:,3);
grey= 0.3*(r) + 0.5*(g) + 0.2*(b);

[n,m] = size (grey);


B= double (grey);
for i= 1:n;
for j=1:m;
if B(i,j)>190;
C(i,j)=1;
else
C(i,j)=0;
end
end
end
Y=C

figure,
subplot (2,2,1), imshow(A);
title('Gambar Ori');
subplot (2,2,2), imshow(grey);
title('Gambar Grey');
subplot (2,2,3), imhist(grey);
title('Histogram Grey');
subplot (2,2,4), imshow(Y);
title('Gambar Segmentasi');
Hasil :

Gambar Ori Gambar Grey

4
x 10 Histogram Grey Gambar Segmentasi
4

0
0 100 200
Nama : Eva Estianingsih

NIM :

Tugas PCD 2018

Script :

close all;
clear all;
clc;

A= imread ('eva.jpg');
size (A);

r= A (:,:,1);
g= A (:,:,2);
b= A (:,:,3);
grey= 0.3*(r) + 0.5*(g) + 0.2*(b);

[n,m] = size (grey);


B= double (grey);
for i= 1:n;
for j=1:m;
if B(i,j)>225;
C(i,j)=1;
else
C(i,j)=0;
end
end
end
Y=C

figure,
subplot (2,2,1), imshow(A);
title('Gambar Ori');
subplot (2,2,2), imshow(grey);
title('Gambar Grey');
subplot (2,2,3), imhist(grey);
title('Histogram Grey');
subplot (2,2,4), imshow(Y);
title('Gambar Segmentasi');
Hasil :

Gambar Ori Gambar Grey

Histogram Grey Gambar Segmentasi

15000

10000

5000

0
0 100 200

You might also like