Disusun Oleh:
Kelas : IF16C
NIM : 16416255201024
2019
DAFTAR ISI
Daftar isi…………………………………………………………………………………........i
BAB I PENDAHULUAN................................................……………………………………3
1.1LATAR BELAKANG…………..…………………………………………............3
1.2DASAR TEORI…………………………………………………………………….3
1.2.1 Pengertian Citra Digital……………………………………………..........3
1.2.2 Pengolahan Citra Digital………………………………………………..4
1.3 Pengertian Matlab…………………………………………………………………4
1.4 Citra Biner…………………………………………………………………….…..5
1.5 Pengertian Ciri (Feature) dan Pola (Pattern)…………………………….…5
BAB II IMPLEMENTASI……………………………………………………………………6
4.1 Matlab R2010a………………………………………………………………………...6
4.2 Buat GUI……………………………………………………………………………….6
4.3 Pilih Jenis GUI…………………………………………………………………………7
4.4 Tampilan GUI…………………………………………………………………………..7
4.5 Kode fungsi utama…………………………………………………………………….8
4.6 manga…………………………………………………………………………….........9
4.7 Tampilan program setelah dijalankan……………………………………………….9
BAB III PENUTUP……………………………………………………………………………10
4.1 Kesimpulan…………………………………………………………………………10
4.2 Saran……………………………………………………………………………..…10
DAFTAR PUSTAKA…………………………………………………………………………..11
BAB 1
PENDAHULUAN
3. Buat GUI seperti gambar berikut lalu simpan dengan nama “jumlahmangga”.
imshow(RGB);
I = rgb2gray(RGB);
threshold = graythresh(I);
bw = im2bw(I,threshold);
bw = bwareaopen(bw,30);
se = strel('disk',2);
bw = imclose(bw,se);
bw = imfill(bw,'holes');
[B,L] = bwboundaries(bw,'noholes');
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'w', 'LineWidth', 2)
end
stats = regionprops(L,'Area','Centroid','Eccentricity');
for k = 1:length(B)
boundary = B{k};
delta_sq = diff(boundary).^2;
perimeter = sum(sqrt(sum(delta_sq,2)));
area = stats(k).Area;
eccentricity = stats(k).Eccentricity;
metric = 4*pi*area/perimeter^2;
centroid = stats(k).Centroid;
text(centroid(1),centroid(2)-16,num2str(k),'Color','r',...
'FontSize',20,'FontWeight','bold');
disp('===================================')
disp(strcat(['Object number = ', num2str(k)]))
disp(strcat(['Area = ',num2str(area)]))
disp(strcat(['Perimeter = ',num2str(perimeter)]))
disp(strcat(['Metric = ',num2str(metric)]))
disp(strcat(['Eccentricity = ',num2str(eccentricity)]))
if metric>0.8
text(centroid(1)-16,centroid(2)+16,'Bukan Buah
mangga','Color','r',...
'FontSize',20,'FontWeight','bold');
else
text(centroid(1)-16,centroid(2)+16,'MANGGAH','Color','b',...
'FontSize',20,'FontWeight','bold');
end
end
4.1 Kesimpulan