i
Perancangan Perangkat Lunak Mendeteksi Ketidaksesuaian gambar sikap posisi
tangan
Julius.H/0322048
Jurusan Teknik Elektro, Fakultas Teknik, Universitas Kristen Maranatha
Jl. Prof. Drg. Suria Sumantri 65, Bandung 40164, Indonesia
Email: M3NG_W4NG@hotmail.com
ABSTRAK
Sistem pendeteksian gambar yang dibuat dalam tugas akhir ini adalah
mendeteksi ketidaksesuaian gambar sikap posisi tangan, topik tugas akhir ini dapat
diaplikasikan dalam bidang keamanan untuk mendeteksi tingkah laku yang mengarah
pada tindakan kriminalitas.
Sistem ini dibuat dengan mengolah suatu gambar melalui beberapa tahap
langkah proses yang dilakukan, tahap langkah proses meliputi : gambar yang sudah
diambil dilakukan proses grayscale untuk dijadikan citra grayscale, kemudian dilakukan
proses edge detection agar didapat tepinya saja, kemudian batas dalam dari tepi gambar
tersebut diisi dengan warna putih, kemudian gambar tersebut dihaluskan, selanjutnya
gambar tersebut dilakukan proses pemilahan gambar menjadi beberapa daerah lalu
dilakukan perhitungan penjumlahan rata-rata nilai intensitas daerahnya, dan yang terakhir
dilakukan proses pendeteksian. Program ini dirancang dengan menggunakan MATLAB7.
Hasil pengujian dari realisasi perangkat lunak pendeteksi ketidaksesuaian
gambar sikap posisi tangan didapatkan rata-rata persentase keberhasilan sistem dalam
mendeteksi gambar tersebut adalah 85%.
ii
Software Design for Detecting Irregularities of Image Hand Position Attitude
Julius.H/0322048
Department of Electrical Engineering, Christian Maranatha University
Jl. Prof. Drg. Suria Sumantri 65, Bandung 40164, Indonesia
Email: M3NG_W4NG@hotmail.com
ABSTRACT
Image detecting system created in this Final Project is aimed to detecting
irregularities of image hand position attitude. This subject can be applied in security field
for detecting certain behaviour that leads to criminal acts.
The system is created by processing a particular image through several phases.
First, the captured image is converted to grayscale image by grayscale process. Edge
detection process then applied to get the border and the inner part is filled with white
colour, thereafter the image is smoothen, divided into several parts, and processed to get
the average of total intensity value of the parts, last, the detection processed is conducted.
This program is designed with MATLAB7.
The result of test from realization for detecting irregularities of image hand
position attitude have showed that the success average result of detecting the image is
85%.
DAFTAR ISI
Halaman
LEMBAR PENGESAHAN
PERNYATAAN ORISINALITAS LAPORAN
LAPORAN PERNYATAAN PERSETUJUAN PUBLIKASI
ABSTRAK ... i
ABSTRACT ... ii
KATA PENGANTAR ... iii
DAFTAR ISI ... v
DAFTAR GAMBAR ... viii
DAFTAR TABEL ... x
BAB I PENDAHULUAN ... 1
1.1
Latar Belakang ... 1
1.2
Tujuan ... 1
1.3
Identifikasi Masalah ... 1
1.4
Pembatasan Masalah ... 1
BAB II TEORI PENUNJANG ... 3
2.1
Pengantar Pengolahan Citra ... 3
2.1.1 Citra ... 3
2.1.2 Definisi Pengolahan Citra ... 4
2.1.3 Operasi Pengolahan Citra ... 6
2.2
Grayscaling ... 9
2.3
Tresholding ……….10
2.4
Citra Biner ………... 11
2.5
Edge Detection (Deteksi Tepi) ………... 11
2.5.1 Sobel ... 13
2.6
Algoritma Morphological ……… 15
2.7
Matlab ………. 16
2.7.1 Lingkup Matlab ... 16
2.7.2 Variabel pada Matlab ... 17
2.7.3 Matriks ... 17
2.7.4 Fungsi-fungsi Perintah Matlab ...……….. 18
2.7.4.1 Imerode ... 18
2.7.4.2 Imfill ... 19
2.7.5 M-File Editor ……….. 20
2.7.5.1 Aturan dan Sifat-sifat ……… 20
2.7.6 Graphic User Interface (GUI) pada Matlab ………... 21
2.7.6.1 Objek Figure ………. 22
2.7.6.2 Objek Uicontrol ……… 23
2.7.6.3 Property Callback sebagai Media Interaksi ….. 24
BAB III PERANCANGAN DAN REALISASI ALAT ... 25
3.1
Referensi Gambar ... 26
3.2
Input Gambar... 26
3.3
Olah n (n=1,2)... 26
3.4 Pendeteksian... 31
3.5 Hasil ... 41
BAB IV DATA PENGAMATAN ... 44
4.1 Hasil Pengujian ... 44
4.2 Analisa Data ... 51
BAB V KESIMPULAN DAN SARAN ... 52
5.1 Kesimpulan ...52
5.2 Saran ...53
DAFTAR PUSTAKA ... 54
LAMPIRAN
DAFTAR GAMBAR
Halaman
Gambar 2.1. Contoh Citra ... 3
Gambar 2.2. Contoh Pengolahan Citra (Perbaikan Kontras) ... 4
Gambar 2.3. Contoh Computer Graphics ... 5
Gambar 2.4. Contoh Pengolahan Citra (Pemberian Warna) ... 5
Gambar 2.5. Contoh Pengenalan Pola ... 6
Gambar 2.6. Contoh Operasi Penajaman ... 7
Gambar 2.7. Contoh Operasi Deblurring ... 7
Gambar 2.8. Contoh Operasi Segmentation ... 8
Gambar 2.9. Contoh Deteksi Tepi ... 8
Gambar 2.10. Komponen Mask pada Operator Sobel ... 13
Gambar 2.11. Mask Komponen Vertikal dan Horizontal …...………..14
Gambar 2.12. Contoh structure element ...15
Gambar 2.13 Contoh 3x3 nilai pixel antar tetangga …...…...…...………..15
Gambar 2.14 Contoh perhitungan 3x3 nilai pixel antar tetangga ... 15
Gambar 2.15 Tampilan utama Matlab ………...………... 17
Gambar 2.16 Gambar yang mengalami perinta Imerode ...19
Gambar 2.17 Data yang mengalami perintah Imfill ... 20
Gambar 2.18 Gambar yang mengalami perintah Imfill ... 20
Gambar 2.19 Contoh M-File ... 21
Gambar 2.20 Diagram Pemrograman Berbasis Objek ... 22
Gambar 3.1 Diagram Alir Keseluruhan ... 25
Gambar 3.2 Diagram Alir Olah n ... 27
Gambar 3.3 Diagram Alir Grid dan penjumlahan rata-rata daerahnya ... 28
Gambar 3.4 Gambar Proses Olah : Gambar Awal ... 29
Gambar 3.5 Gambar Proses Olah : Proses Grayscale ... 29
Gambar 3.6 Gambar Proses Olah : Proses edge detection ………...…………. 30
Gambar 3.7 Gambar Proses Olah : Proses Pengisian gambar …...…………... 30
Gambar 3.9 Diagram Alir Pendeteksian ……...……… 32
Gambar 3.9 Lanjutan Diagram Alir Pendeteksian ... 33
Gambar 3.9 Lanjutan Diagram Alir Pendeteksian ... 34
Gambar 3.10 Contoh 2 Gambar Referensi ... 36
Gambar 3.11 Contoh 1 Gambar untuk Pendeteksian ... 37
Gambar 3.12. Tampilan Program Menu Utama ... 40
Gambar 3.13. Hasil dari program ... 41
Gambar 4.1. Gambar Referensi ... 44
Gambar 4.2. Gambar dengan Referensi1 dan Output1 ...44
Gambar 4.3. Gambar dengan Referensi1 dan Output2 ... 45
Gambar 4.4. Gambar dengan Referensi1 dan Output3 ... 45
Gambar 4.5. Gambar dengan Referensi1 dan Output4 ... 45
Gambar 4.6. Gambar dengan Referensi2 dan Output1 ... 46
Gambar 4.7. Gambar dengan Referensi2 dan Output2 ... 46
Gambar 4.8. Gambar dengan Referensi2 dan Output3 ... 46
Gambar 4.9. Gambar dengan Referensi2 dan Output4 ... 47
Gambar 4.10.Gambar dengan Referensi3 dan Output1 ... 47
Gambar 4.11.Gambar dengan Referensi3 dan Output2 ... 47
Gambar 4.12.Gambar dengan Referensi3 dan Output3 ... 48
Gambar 4.13.Gambar dengan Referensi3 dan Output4 ... 48
Gambar 4.14.Gambar dengan Referensi4 dan Output1 ... 48
Gambar 4.15.Gambar dengan Referensi4 dan Output2 ... 49
Gambar 4.16.Gambar dengan Referensi4 dan Output3 ... 49
Gambar 4.17.Gambar dengan Referensi4 dan Output4 ... 49
DAFTAR TABEL
Halaman
Tabel 2.1. Tabel Nama-nama Komponen Pemrograman Windom Matlab ... 23
Tabel 3.1. Fungsi Komponen pada Tampilan Program Menu Utama ... 42
Tabel 4.1. Hasil Pengujian gambar yang di deteksi ... 50
LAMPIRAN A
Algoritma Graphical User Interface(programfinal2.m)
clear all; clc;
form1=figure(...'units','points',..'position',[130 190 800 300],...'color',[.8 .8 .9],...'menubar','none',...
'resize','off',…'numbertitle','off',...'name','Software For Detecting Image'); frame1=uicontrol('parent',form1,...'units','points',...'position',[0 270 800 50],...'backgroundcolor',[.3 .3 .4],...'style','Frame');
label1=uicontrol('parent',form1,...'units','points',...'position',[100 270 200 20],…
'backgroundcolor',[.3 .3
.4],...'style','Text',...'horizontalalignment','left',...'string','Referensi',...
fontname','arial',...'fontsize',10,...'fontweight','bold',...'foregroundcolor',[1 1 1]); layar1=axes('parent',form1,...'units','points',...'position',[30 80 180
180],...
’
xgrid','off',...'ygrid','off',...'xcolor',[1 1 1],...'ycolor',[1 1 1],...'fontsize',1,...'color',[1 1 1]); label2=uicontrol('parent',form1,...'units','points',...'position',[60 50 80 10],...'backgroundcolor',[.8 .8 .9],...'style','Text',... 'string','Referensi ke:',...'fontname','arial',...'fontsize',10,...
'fontweight','bold',...'foregroundcolor',[0 0 0]);
but1=uicontrol('parent',form1,...'style','radio',...'string','1',...'position',[90 40 50 10],...
'backgroundcolor',[.8 .8 .9],...'value',1,...
'callback',['set(but1,''value'',1),'...
'set(but2,''value'',0),'...
'set(but3,''value'',0),'...
'set(but4,''value'',0),']);
but2=uicontrol('parent',form1,...'style','radio',...'string','2',...'position',[120 40 50 10],...
backgroundcolor',[.8 .8 .9],...'value',1,...
'callback',['set(but2,''value'',1),'...
'set(but1,''value'',0),'...
'set(but3,''value'',0),'...
'set(but4,''value'',0),']);
but3=uicontrol('parent',form1,...'style','radio',...'string','3',...'position',[150 40 50 10],...'backgroundcolor',[.8 .8 .9],...'value',1,...
'callback',['set(but3,''value'',1),'...
'set(but1,''value'',0),'...
'set(but2,''value'',0),'...
'set(but4,''value'',0),']);
but4=uicontrol('parent',form1,...'style','radio',...'string','4',...'position',[180 40 50 10],...
'backgroundcolor',[.8 .8 .9],...'value',1,...
'callback',['set(but4,''value'',1),'...
'set(but1,''value'',0),'...
'set(but2,''value'',0),'...
tombol1=uicontrol('parent',form1,...'units','points',...'position',[80 10 80 15],...
'style','pushbutton',...'callback','programtb1',...'string','OLAH&SHOW',...'fontname','arial',...
'fontsize',10);
label3=uicontrol('parent',form1,...'units','points',...'position',[220 80 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label4=uicontrol('parent',form1,...'units','points',...'position',[220 100 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label5=uicontrol('parent',form1,…'units','points',...'position',[220 120 100 15],...
'backgroundcolor',[.8 .8
.9],...'style','Text',...'string','=======>',...'fontname','arial',...'fontsize',15,...
'fontweight','bold',...'foregroundcolor',[0 0 0]);
label6=uicontrol('parent',form1,...'units','points',...'position',[220 140 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label7=uicontrol('parent',form1,...'units','points',...'position',[220 160 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label8=uicontrol('parent',form1,...'units','points',...'position',[220 180 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label9=uicontrol('parent',form1,...'units','points',...'position',[220 200 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label10=uicontrol('parent',form1,...'units','points',...'position',[220 220 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
label11=uicontrol('parent',form1,...'units','points',...'position',[220 240 100 15],...
'backgroundcolor',[.8 .8 .9],...'style','Text',...'string','=======>',...'fontname','arial',...
'fontsize',15,...'fontweight','bold',...'foregroundcolor',[0 0 0]);
layar2=axes('parent',form1,...'units','points',...'position',[330 80 180 180],...'xgrid','off',...
'ygrid','off',...'xcolor',[1 1 1],...'ycolor',[1 1 1],...'fontsize',1,...'color',[1 1 1]); label12=uicontrol('parent',form1,...'units','points',...'position',[310 270 200 20],...
'backgroundcolor',[.3 .3 .4],...'style','Text',...'horizontalalignment','center',...
'string','Input',...'fontname','arial',...'fontsize',10,...'fontweight','bold',...
'foregroundcolor',[1 1 1]);
label13=uicontrol('parent',form1,...'units','points',...'position',[320 50 100 10],...
'backgroundcolor',[.8 .8 .9],...'style','Text',... 'string','Masukkan input:',...
edit1=uicontrol('parent',form1,...'units','points',...'position',[330 28 100
15],...'backgroundcolor',[1 1 1],...'style','Edit',...'string','',...'fontname','arial',...'fontsize',10); tombol2=uicontrol('parent',form1,...'units','points',...'position',[360 10 80 15],...
'style','pushbutton',...'callback','programtb2',...'string','OLAH&SHOW',...'fontname','arial',...
'fontsize',10);
label14=uicontrol('parent',form1,...'units','points',...'position',[560 270 200 20],...
'backgroundcolor',[.3 .3 .4],...'style','Text',...'string','Output',...'fontname','arial',...
'fontsize',10,...fontweight','bold',...'foregroundcolor',[1 1 1]);
layar3=axes('parent',form1,...'units','points',...'position',[580 80 180 180],...'xgrid','off',...
'ygrid','off',...'xcolor',[1 1 1],...'ycolor',[1 1 1],...'fontsize',1,...'color',[1 1 1]); tombol3=uicontrol('parent',form1,...'units','points',...'position',[520 160 50 50],...
'style','pushbutton',...'callback','programolah',...'string','OLAH',...'fontname','arial',...
'fontsize',10);
edit2=uicontrol('parent',form1,...'units','points',...'position',[590 40 150 15],...
'backgroundcolor',[1 1 1],...'style','Edit',...'string','',...'fontname','arial',...
'fontsize',10);
tombol4=uicontrol('parent',form1,...'units','points',...'position',[690 20 50 15],...'style','pushbutton',...
'string','EXIT',...'fontname','arial',...'fontsize',10,...'callback','close');
Algoritma programtb1.m
if(get(but1,'value'))==1
set(form1,'CurrentAxes',layar1); I=imread('gam13.bmp'); imshow(I);
Z=rgb2gray(I);
[junk threshold] = edge(Z, 'sobel'); fudgeFactor = .5;
WW= edge(Z,'sobel', threshold * fudgeFactor); WsFill= imfill(Ws,'holes');
Wsth= strel('diamond',1); fi1= imerode(WsFill,Wsth); fi2= imerode(fi1,Wsth); [K,L]=size(fi2);
for i=1:3 for j=1:4 x=0; for K=1:89 for L=1:50
x=x+fi2(((i-1)*89)+K,((j-1)*50)+L); end;
end;
Cf1(i,j)=x/4450; end;
elseif(get(but2,'value'))==1
set(form1,'CurrentAxes',layar1); I=imread('gam14.bmp'); imshow(I);
Z=rgb2gray(I);
[junk threshold] = edge(Z, 'sobel'); fudgeFactor = .5;
WW= edge(Z,'sobel', threshold * fudgeFactor); WsFill= imfill(Ws,'holes');
Wsth= strel('diamond',1); fi1= imerode(WsFill,Wsth); fi2= imerode(fi1,Wsth); [K,L]=size(fi2);
for i=1:3 for j=1:4 x=0; for K=1:89 for L=1:50
x=x+fi2(((i-1)*89)+K,((j-1)*50)+L); end;
end;
Cf2(i,j)=x/4450; end;
end;
elseif(get(but3,'value'))==1
set(form1,'CurrentAxes',layar1); I=imread('gam16.bmp'); imshow(I);
Z=rgb2gray(I);
[junk threshold] = edge(Z, 'sobel'); fudgeFactor = .5;
WW= edge(Z,'sobel', threshold * fudgeFactor); WsFill= imfill(Ws,'holes');
Wsth= strel('diamond',1); fi1= imerode(WsFill,Wsth); fi2= imerode(fi1,Wsth); [K,L]=size(fi2);
for i=1:3 for j=1:4 x=0; for K=1:89 for L=1:50
x=x+fi2(((i-1)*89)+K,((j-1)*50)+L); end;
end;
Cf3(i,j)=x/4450; end;
end;
elseif(get(but4,'value'))==1
set(form1,'CurrentAxes',layar1); I=imread('gam15.bmp'); imshow(I);
[junk threshold] = edge(Z, 'sobel'); fudgeFactor = .5;
WW= edge(Z,'sobel', threshold * fudgeFactor); WsFill= imfill(Ws,'holes');
Wsth= strel('diamond',1); fi1= imerode(WsFill,Wsth); fi2= imerode(fi1,Wsth); [K,L]=size(fi2);
for i=1:3 for j=1:4 x=0; for K=1:89 for L=1:50
x=x+fi2(((i-1)*89)+K,((j-1)*50)+L); end;
end;
Cf4(i,j)=x/4450; end;
end;
else
break;
end;
set(layar1,...
'xgrid','off',...
'ygrid','off',...
'xcolor',[1 1 1],...
'ycolor',[1 1 1],...
'fontsize',1,...
'color',[1 1 1]);
Algoritma programtb2.m
for V=layar2
set(form1,'CurrentAxes',layar2); F=get(edit1,'String'); I=imread(F);
imshow(I); Z=rgb2gray(I);
[junk threshold] = edge(Z, 'sobel'); fudgeFactor = .5;
WW= edge(Z,'sobel', threshold * fudgeFactor); WsFill= imfill(Ws,'holes');
Wsth= strel('diamond',1); fi1= imerode(WsFill,Wsth); fi2= imerode(fi1,Wsth); [K,L]=size(fi2);
x=0; for K=1:89 for L=1:50
x=x+fi2(((i-1)*89)+K,((j-1)*50)+L); end;
end;
CF(i,j)=x/4450; end;
end;
end; set(layar2,...
'xgrid','off',...
'ygrid','off',...
'xcolor',[1 1 1],...
'ycolor',[1 1 1],...
'fontsize',1,...
'color',[1 1 1]);
Algoritma programolah.m
if get(but1,'value')==1 F=get(edit1,'String'); I=imread(F); imshow(I); Z=rgb2gray(I);
[junk threshold] = edge(Z, 'sobel'); fudgeFactor = .5;
WW= edge(Z,'sobel', threshold * fudgeFactor); WsFill= imfill(Ws,'holes');
Wsth= strel('diamond',1); fi1= imerode(WsFill,Wsth); fi2= imerode(fi1,Wsth); [K,L]=size(fi2);
for i=1:3 for j=1:4 x=0; for K=1:89 for L=1:50
x=x+fi2(((i-1)*89)+K,((j-1)*50)+L); end;
end;
CF(i,j)=x/4450; end;
end; k=F; db=Cf1; in=CF; A=0;
for i=1
else
n(i)=0;
end;
end;
for i=2
if in(1,2)>=0&in(1,2)<=(db(1,2)+0.0952) n(i)=1;
else
n(i)=0;
end;
end;
for i=3
if in(1,3)>=0&in(1,3)<=(db(1,3)+0.108) n(i)=1;
else
n(i)=0;
end;
end;
for i=4
if in(1,4)>=0&in(1,4)<=db(1,4) n(i)=1;
else
n(i)=0;
end;
end;
for i=5
if in(2,1)>=0&in(2,1)<=(db(2,1)+0.021) n(i)=1;
else
n(i)=0;
end;
end;
for i=6
if in(2,2)>=0&in(2,2)<=(db(2,2)+0.4991) n(i)=1;
else
n(i)=0;
end;
end;
for i=7
if in(2,3)>=0&in(2,3)<=(db(2,3)+0.2126) n(i)=1;
else
n(i)=0;
end;
end;
for i=8
if in(2,4)>=0&in(2,4)<=(db(2,4)+0.0943) n(i)=1;
else
n(i)=0;
end;
end;
for i=9
if in(3,1)>=0&in(3,1)<=(db(3,1)+0.1317) n(i)=1;
n(i)=0;
end;
end;
for i=10
if in(3,2)>=0&in(3,2)<=(db(3,2)+0.5627) n(i)=1;
else
n(i)=0;
end;
end;
for i=11
if in(3,3)>=0&in(3,3)<=(db(3,3)+0.569) n(i)=1;
else
n(i)=0;
end;
end;
for i=12
if in(3,4)>=0&in(3,4)<=(db(3,4)+0.0797) n(i)=1;
else
n(i)=0;
end;
end;
for i=1:12 A=A+n(i);
end;
if A==12
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I); i='MATCHING'; set(edit2,'String',(i));
else
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I);
i='NO MATCHING'; set(edit2,'String',(i));
if(in(1,1)>=0.1&in(1,2)>=0.1&in(1,3)<=0.05&in(1,4)>=0.2) x=[25 65 65 25 25];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[140 180 180 140 140]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif(in(1,1)>=0.2&in(1,2)<=0.01&in(1,3)>=0.1&in(1,4)>=0.1) x=[15 50 50 15 15];
y=[20 20 150 150 20];
z=line(x,y,'color','r','linewidth',4); x=[140 180 180 140 140]; y=[20 20 150 150 20];
z=line(x,y,'color','r','linewidth',4);
y=[30 30 160 160 30];
z=line(x,y,'color','r','linewidth',4); x=[160 195 195 160 160]; y=[30 30 160 160 30];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.3&in(1,2)<=0.05&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[30 65 65 30 30];
y=[30 30 160 160 30];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.05&in(1,2)>=0.25&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[45 80 80 45 45];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.1&in(1,4)<=0.1&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[133 163 163 133 133];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.1&in(1,4)>=0.1&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[130 165 165 130 130];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.001&in(1,4)>=0.25&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[140 180 180 140 140];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.0005&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[15 68 68 15 15];
y=[15 15 155 155 15];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)>=0.15&in(1,3)<=0.1&in(1,4)>=0.15) x=[25 65 65 25 25];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[140 180 180 140 140]; y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.15&in(1,2)<=0.05&in(1,3)>=0.05&in(1,4)<=0.15) x=[25 65 65 25 25];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[140 180 180 140 140]; y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.05&in(1,2)>=0.15&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[30 70 70 30 30];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)<=0.05&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[25 70 70 25 25];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.05&in(1,4)>=0.2&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[140 180 180 140 140];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)<=0.15&in(1,3)<=0.005&in(1,4)<=0.0005) x=[35 80 80 35 35];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.0005&in(1,3)>=0.05&in(1,4)>=0.15) x=[20 65 65 20 20];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[135 170 170 135 135]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.0005&in(1,2)>=0.2&in(1,3)<=0.005&in(1,4)<=0.0005) x=[35 85 85 35 35];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.005&in(1,2)<=0.2&in(1,3)>=0.1&in(1,4)>=0.1) x=[40 75 75 40 40];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.0005&in(1,2)>=0.25&in(1,3)<=0.005&in(1,4)<=0.0005) x=[45 85 85 45 45];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.05&in(1,2)>=0.2&in(1,3)>=0.15&in(1,4)<=0.1) x=[40 75 75 40 40];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.15&in(1,4)<=0.1&in(1,1)<=0.001&in(1,2)<=0.001) x=[130 180 180 130 130];
y=[15 15 160 160 15];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)>=0.15&in(1,3)>=0.2&in(1,4)<=0.05) x=[30 75 75 30 30];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.1&in(1,4)>=0.2&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[140 180 180 140 140];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.05&in(1,3)<=0.01&in(1,4)>=0.2) x=[25 65 65 25 25];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[140 175 175 140 140]; y=[10 10 160 160 10];
elseif (in(1,3)<=0.05&in(1,4)>=0.2&in(1,1)<=0.001&in(1,2)<=0.001) x=[140 180 180 140 140];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.01&in(1,2)>=0.2&in(1,3)>=0.1&in(1,4)<=0.1) x=[40 80 80 40 40];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.1&in(1,4)<=0.2&in(1,1)<=0.005&in(1,2)<=0.005) x=[140 180 180 140 140];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.1&in(1,2)>=0.1&in(1,3)>=0.1&in(1,4)<=0.05) x=[40 80 80 40 40];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.1&in(1,3)<=0.1&in(1,4)<=0.005) x=[20 65 65 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.1&in(1,4)>=0.15&in(1,1)<=0.1&in(1,2)<=0.1) x=[140 180 180 140 140];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.1&in(1,2)>=0.1&in(1,3)<=0.1&in(1,4)>=0.1) x=[40 80 80 40 40];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[120 170 170 120 120]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); else
x=[1 200 200 1 1]; y=[1 1 267 267 1];
z=line(x,y,'color','r','linewidth',10); end;
end;
%Untuk olah perbandingan dengan database2
elseif get(but2,'value')==1 F=get(edit1,'String'); k=F;
db=Cf2; in=CF; A=0;
for i=1
if in(1,1)>=0&in(1,1)<=(db(1,1)+0.3239) n(i)=1;
n(i)=0;
end;
end;
for i=2
if in(1,2)>=0&in(1,2)<=(db(1,2)+0.1365) n(i)=1;
else
n(i)=0;
end;
end;
for i=3
if in(1,3)>=0&in(1,3)<=db(1,3) n(i)=1;
else
n(i)=0;
end;
end;
for i=4
if in(1,4)>=0&in(1,4)<=db(1,4) n(i)=1;
else
n(i)=0;
end;
end;
for i=5
if in(2,1)>=0&in(2,1)<=(db(2,1)+0.3037) n(i)=1;
else
n(i)=0;
end;
end;
for i=6
if in(2,2)>=0&in(2,2)<=(db(2,2)+0.3966) n(i)=1;
else
n(i)=0;
end;
end;
for i=7
if in(2,3)>=0&in(2,3)<=(db(2,3)+0.6155) n(i)=1;
else
n(i)=0;
end;
end;
for i=8
if in(2,4)>=0&in(2,4)<=db(2,4) n(i)=1;
else
n(i)=0;
end;
end;
for i=9
if in(3,1)>=0&in(3,1)<=(db(3,1)+0.1042) n(i)=1;
else
end;
end;
for i=10
if in(3,2)>=0&in(3,2)<=(db(3,2)+0.5326) n(i)=1;
else
n(i)=0;
end;
end;
for i=11
if in(3,3)>=0&in(3,3)<=(db(3,3)+0.316) n(i)=1;
else
n(i)=0;
end;
end;
for i=12
if in(3,4)>=0&in(3,4)<=(db(3,4)+0.1713) n(i)=1;
else
n(i)=0;
end;
end;
for i=1:12 A=A+n(i);
end;
if A==12
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I); i='MATCHING'; set(edit2,'String',(i));
else
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I);
i='NO MATCHING'; set(edit2,'String',(i));
if (in(1,4)<=0.005&in(1,2)<=0.05&in(1,1)<=0.0005&in(1,3)<=0.15) x=[40 70 70 40 40];
y=[175 175 267 267 175];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.15&in(1,4)>=0.1&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[45 70 70 45 45];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[15 15 160 160 15];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.001&in(1,4)>=0.25&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[40 60 60 40 40];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.2&in(1,4)<=0.005&in(1,1)<=0.005&in(1,2)<=0.005) x=[30 60 60 30 30];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[110 150 150 110 110]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.1&in(1,4)<=0.1&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[50 70 70 50 50];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[133 163 163 133 133]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.05&in(1,4)>=0.1&in(1,1)<=0.0005&in(1,2)<=0.0005) x=[30 60 60 30 30];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[135 175 175 135 135]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)>=0.15&in(1,3)<=0.05&in(1,4)>=0.2) x=[135 170 170 135 135];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.25&in(1,2)<=0.005&in(1,3)>=0.1&in(1,4)>=0.1) x=[135 180 180 135 135];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.005&in(1,3)<=0.005&in(1,4)>=0.2) x=[160 195 195 160 160];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.05&in(1,2)>=0.15&in(1,3)<=0.1&in(1,4)<=0.1) x=[133 163 163 133 133];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.01&in(1,2)>=0.01&in(1,3)>=0.01&in(1,4)>=0.01) x=[133 170 170 133 133];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.0001&in(1,2)>=0.01&in(1,3)<=0.01&in(1,4)>=0.01) x=[133 175 175 133 133];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)<=0.05&in(1,2)<=0.1&in(1,3)<=0.2&in(1,1)<=0.05) x=[40 70 70 40 40];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.1&in(1,4)>=0.1&in(1,1)<=0.005&in(1,2)<=0.005) x=[30 60 60 30 30];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[135 175 175 135 135]; y=[20 20 160 160 20];
elseif (in(1,1)<=0.05&in(1,2)>=0.2&in(1,3)>=0.1&in(1,4)<=0.1) x=[130 180 180 130 130];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)<=0.005&in(1,2)>=0.1&in(1,3)>=0.1&in(1,1)<=0.005) x=[30 60 60 30 30];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)<=0.005&in(1,2)<=0.1&in(1,3)>=0.1&in(1,1)<=0.005) x=[30 70 70 30 30];
y=[165 165 267 267 165]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.1&in(1,4)>=0.2&in(1,1)<=0.005&in(1,2)<=0.005) x=[30 60 60 30 30];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[135 175 175 135 135]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)<=0.05&in(1,3)<=0.1&in(1,4)>=0.1) x=[133 175 175 133 133];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)<=0.1&in(1,4)>=0.1&in(1,1)<=0.05&in(1,2)<=0.05) x=[30 60 60 30 30];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[135 175 175 135 135]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.1&in(1,2)>=0.1&in(1,3)>=0.15&in(1,4)<=0.05) x=[125 165 165 125 125];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)<=0.05&in(1,2)<=0.1&in(1,3)<=0.1&in(1,1)<=0.05) x=[40 70 70 40 40];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.1&in(1,4)<=0.1&in(1,1)<=0.005&in(1,2)<=0.005) x=[40 70 70 40 40];
y=[178 178 267 267 178 ]; z=line(x,y,'color','r','linewidth',4); x=[130 170 170 130 130]; y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.1&in(1,2)>=0.1&in(1,3)<=0.1&in(1,4)>=0.1) x=[125 170 170 125 125];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); else
x=[1 200 200 1 1]; y=[1 1 267 267 1];
z=line(x,y,'color','r','linewidth',10); end;
%Untuk olah perbandingan dengan database3
elseif get(but3,'value')==1 F=get(edit1,'String'); k=F;
db=Cf3; in=CF; A=0;
for i=1
if in(1,1)>=0&in(1,1)<=(db(1,1)+0.2799) n(i)=1;
else
n(i)=0;
end;
end;
for i=2
if in(1,2)>=0&in(1,2)<=db(1,2) n(i)=1;
else
n(i)=0;
end;
end;
for i=3
if in(1,3)>=0&in(1,3)<=(db(1,3)+0.0233) n(i)=1;
else
n(i)=0;
end;
end;
for i=4
if in(1,4)>=0&in(1,4)<=(db(1,4)+0.2662) n(i)=1;
else
n(i)=0;
end;
end;
for i=5
if in(2,1)>=0&in(2,1)<=(db(2,1)+0.337) n(i)=1;
else
n(i)=0;
end;
end;
for i=6
if in(2,2)>=0&in(2,2)<=(db(2,2)+0.3665) n(i)=1;
else
n(i)=0;
end;
end;
for i=7
if in(2,3)>=0&in(2,3)<=(db(2,3)+0.376) n(i)=1;
else
end;
end;
for i=8
if in(2,4)>=0&in(2,4)<=(db(2,4)+0.3259) n(i)=1;
else
n(i)=0;
end;
end;
for i=9
if in(3,1)>=0&in(3,1)<=(db(3,1)+0.1206) n(i)=1;
else
n(i)=0;
end;
end;
for i=10
if in(3,2)>=0&in(3,2)<=(db(3,2)+0.6063) n(i)=1;
else
n(i)=0;
end;
end;
for i=11
if in(3,3)>=0&in(3,3)<=(db(3,3)+0.6335) n(i)=1;
else
n(i)=0;
end;
end;
for i=12
if in(3,4)>=0&in(3,4)<=(db(3,4)+0.008) n(i)=1;
else
n(i)=0;
end;
end;
for i=1:12 A=A+n(i);
end;
if A==12
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I); i='MATCHING'; set(edit2,'String',(i));
else
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I);
i='NO MATCHING'; set(edit2,'String',(i));
if (in(1,2)<=0.04&in(1,2)~=0&in(1,3)<=0.005&in(1,4)<=0.005) x=[40 70 70 40 40];
z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.005&in(1,3)<=0.005&in(1,4)<=0.005&in(1,1)<=0.005) x=[40 70 70 40 40];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.05&in(1,3)<=0.2&in(1,4)<=0.005&in(1,1)<=0.005) x=[40 70 70 40 40];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.005&in(1,2)>=0.2&in(1,3)<=0.005&in(1,4)<=0.005) x=[125 145 145 125 125];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.25&in(1,3)<=0.005&in(1,4)<=0.005) x=[140 165 165 140 140];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.3&in(1,3)<=0.005&in(1,4)<=0.005) x=[135 165 165 135 135];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,3)<=0.005&in(1,4)<=0.005) x=[145 165 165 145 145];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.2&in(1,1)<=0.005&in(1,2)<=0.005) x=[35 65 65 35 35];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,3)>=0.15&in(1,1)<=0.005&in(1,2)<=0.005) x=[30 65 65 30 30];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)>=0.2&in(1,1)<=0.005&in(1,2)<=0.005) x=[35 65 65 35 35];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)<=0.05&in(1,1)<=0.005&in(1,2)<=0.005) x=[45 70 70 45 45];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.1&in(1,1)<=0.005&in(1,3)<=0.2&in(1,4)<=0.005) x=[40 70 70 40 40];
elseif (in(1,4)>=0.1&in(1,1)<=0.005&in(1,2)<=0.005&in(1,3)>=0.1) x=[30 60 60 30 30];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.1&in(1,1)<=0.005&in(1,3)>=0.1&in(1,4)<=0.005) x=[30 70 70 30 30];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,3)<=0.005&in(1,4)<=0.005&in(1,2)>=0.1) x=[130 155 155 130 130];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)>=0.1&in(1,1)<=0.005&in(1,2)<=0.005&in(1,3)<=0.1) x=[30 60 60 30 30];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)<=0.1&in(1,1)<=0.005&in(1,2)<=0.005&in(1,3)>=0.1) x=[40 70 70 40 40];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.1&in(1,1)<=0.1&in(1,3)>=0.1&in(1,4)<=0.005) x=[30 70 70 30 30];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,4)>=0.1&in(1,1)<=0.005&in(1,2)<=0.1&in(1,3)<=0.1) x=[30 60 60 30 30];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.1&in(1,1)<=0.005&in(1,3)<=0.1&in(1,4)<=0.005) x=[30 70 70 30 30];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4); x=[135 165 165 135 135]; y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,3)<=0.005&in(1,4)<=0.005&in(1,2)<=0.1) x=[130 155 155 130 130];
y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4); else
x=[1 200 200 1 1]; y=[1 1 267 267 1];
z=line(x,y,'color','r','linewidth',10); end;
end;
%Untuk olah perbandingan dengan database4
k=F; db=Cf4; in=CF; A=0;
for i=1
if in(1,1)>=0&in(1,1)<=db(1,1) n(i)=1;
else
n(i)=0;
end;
end;
for i=2
if in(1,2)>=0&in(1,2)<=db(1,2) n(i)=1;
else
n(i)=0;
end;
end;
for i=3
if in(1,3)>=0&in(1,3)<=(db(1,3)+0.1507) n(i)=1;
else
n(i)=0;
end;
end;
for i=4
if in(1,4)>=0&in(1,4)<=(db(1,4)+0.31) n(i)=1;
else
n(i)=0;
end;
end;
for i=5
if in(2,1)>=0&in(2,1)<=db(2,1) n(i)=1;
else
n(i)=0;
end;
end;
for i=6
if in(2,2)>=0&in(2,2)<=(db(2,2)+0.7067) n(i)=1;
else
n(i)=0;
end;
end;
for i=7
if in(2,3)>=0&in(2,3)<=(db(2,3)+0.3472) n(i)=1;
else
n(i)=0;
end;
end;
for i=8
n(i)=1;
else
n(i)=0;
end;
end;
for i=9
if in(3,1)>=0&in(3,1)<=(db(3,1)+0.1228) n(i)=1;
else
n(i)=0;
end;
end;
for i=10
if in(3,2)>=0&in(3,2)<=(db(3,2)+0.2975) n(i)=1;
else
n(i)=0;
end;
end;
for i=11
if in(3,3)>=0&in(3,3)<=(db(3,3)+0.5636) n(i)=1;
else
n(i)=0;
end;
end;
for i=12
if in(3,4)>=0&in(3,4)<=(db(3,4)+0.1023) n(i)=1;
else
n(i)=0;
end;
end;
for i=1:12 A=A+n(i);
end;
if A==12
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I); i='MATCHING'; set(edit2,'String',(i));
else
set(form1,'CurrentAxes',layar3); I=imread(k);
imshow(I);
i='NO MATCHING'; set(edit2,'String',(i));
if (in(1,1)<=0.005&in(1,3)>=0.001&in(1,4)<=0.005&in(1,2)<=0.2) x=[135 170 170 135 135];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.005&in(1,3)<=0.005&in(1,4)<=0.005&in(1,1)<=0.005) x=[135 180 180 135 135];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.35&in(1,1)<=0.005&in(1,3)<=0.005&in(1,4)<=0.005) x=[50 80 80 50 50];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[125 155 155 125 125]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.05&in(1,2)>=0.25&in(1,3)<=0.005&in(1,4)<=0.005) x=[40 75 75 40 40];
y=[15 15 160 160 15];
z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif(in(1,1)>=0.05&in(1,2)>=0.15&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[40 75 75 40 40];
y=[15 15 160 160 15];
z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.3&in(1,2)<=0.05&in(1,3)<=0.005&in(1,4)<=0.005) x=[25 65 65 25 25];
y=[15 15 160 160 15];
z=line(x,y,'color','r','linewidth',4); x=[130 165 165 130 130]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.005&in(1,3)<=0.005&in(1,4)<=0.005) x=[15 50 50 15 15];
y=[30 30 150 150 30];
z=line(x,y,'color','r','linewidth',4); x=[135 160 160 135 135]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)>=0.05&in(1,3)<=0.005&in(1,4)<=0.005) x=[25 60 60 25 25];
y=[20 20 150 150 20];
z=line(x,y,'color','r','linewidth',4); x=[125 155 155 125 125]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.2&in(1,1)<=0.0005&in(1,3)<=0.0005&in(1,4)<=0.0005) x=[50 80 80 50 50];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4); x=[125 150 150 125 125]; y=[170 170 267 267 170 ];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)>=0.15&in(1,3)<=0.05&in(1,4)>=0.2) x=[30 65 65 30 30];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.25&in(1,2)<=0.005&in(1,3)>=0.1&in(1,4)>=0.1) x=[15 50 50 15 15];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.2&in(1,2)<=0.005&in(1,3)<=0.005&in(1,4)>=0.2) x=[20 50 50 20 20];
y=[30 30 150 150 30];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.05&in(1,2)>=0.15&in(1,3)<=0.1&in(1,4)<=0.1) x=[40 75 75 40 40];
y=[20 20 160 160 20];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)>=0.15&in(1,3)<=0.1&in(1,4)>=0.1) x=[30 75 75 30 30];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)<=0.05&in(1,3)>=0.05&in(1,4)>=0.1) x=[30 75 75 30 30];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif(in(1,1)<=0.01&in(1,2)>=0.2&in(1,3)>=0.1&in(1,4)<=0.1) x=[30 75 75 30 30];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.3&in(1,2)<=0.05&in(1,3)<=0.005&in(1,4)>=0.3) x=[20 70 70 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.1&in(1,1)>=0.1&in(1,3)<=0.05&in(1,4)<=0.05) x=[40 80 80 40 40];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[125 155 155 125 125]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.1&in(1,2)>=0.1&in(1,3)>=0.1&in(1,4)<=0.05) x=[20 70 70 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)>=0.1&in(1,1)<=0.1&in(1,3)<=0.05&in(1,4)<=0.05) x=[40 80 80 40 40];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[125 155 155 125 125]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)<=0.05&in(1,3)>=0.2&in(1,4)<=0.05) x=[20 70 70 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.05&in(1,2)>=0.15&in(1,3)<=0.1&in(1,4)>=0.1) x=[20 80 80 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)<=0.1&in(1,2)>=0.15&in(1,3)>=0.1&in(1,4)<=0.1) x=[20 80 80 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.1&in(1,3)>=0.1&in(1,4)<=0.1&in(1,1)<=0.1) x=[135 180 180 135 135];
y=[175 175 267 267 175]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,2)<=0.1&in(1,1)>=0.1&in(1,3)<=0.05&in(1,4)<=0.05) x=[20 70 70 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); x=[125 155 155 125 125]; y=[170 170 267 267 170 ]; z=line(x,y,'color','r','linewidth',4);
elseif (in(1,1)>=0.1&in(1,2)<=0.1&in(1,3)<=0.1&in(1,4)>=0.1) x=[20 80 80 20 20];
y=[10 10 160 160 10];
z=line(x,y,'color','r','linewidth',4); else
x=[1 200 200 1 1]; y=[1 1 267 267 1];
z=line(x,y,'color','r','linewidth',10); end;
end;
else
break;
end; set(layar3,...
'xgrid','off',...
'ygrid','off',...
'xcolor',[1 1 1],...
'ycolor',[1 1 1],...
'fontsize',1,...
1
Bab I
Pendahuluan
1.1
Latar Belakang Masalah
Dewasa ini perkembangan teknologi maju dengan sangat pesat. Salah satu hasil
perkembangan teknologi tersebut adalah pengolahan citra. Banyak sekali aplikasi pada
dunia elektronika yang memanfaatkan pengolahan citra seperti pada sistem keamanan
melalui pengenalan sidik jari, pengenalan iris mata, dunia robotika, pendeteksian
ketidaksesuaian gambar sikap posisi tangan dan masih banyak lagi aplikasi yang lainnya.
Pada tugas akhir ini akan dibahas pengenalan pola pada sebuah gambar orang
yang dideteksi ketidaksesuaian sikap posisi tangannya. Gambar orang menarik untuk
diolah karena sering dijumpai oleh semua orang dan memiliki tingkat kerumitan
tersendiri terutama dari bentuk dasar dan pola yang terkandung di dalamnya. Aplikasi
pendeteksian ketidaksesuaian gambar sikap posisi tangan dapat diterapkan pada bidang
keamanan, misalnya dalam suatu posisi tangan mengangkat dan memegang senjata bisa
dianggap seseorang sedang melakukan tindak kejahatan.
1.2
Identifikasi Masalah
Bagaimana merancang dan merealisasikan perangkat lunak yang dapat
mendeteksi suatu perbedaan yang tidak sesuai dengan referensi gambar?
1.3
Tujuan
Membuat suatu aplikasi perangkat lunak yang dapat digunakan untuk mendeteksi
ketidaksesuaian gambar sikap posisi tangan.
1.4
Pembatasan Masalah
Program dibuat dengan Matlab 7.0.
Gambar yang dideteksi adalah ketidaksesuaian sikap posisi tangan gambar orang.
Mendeteksi gambar satu orang saja dengan ketentuan yang dideteksi setengah.
2
Menggunakan ukuran 267x200 pixel.
Latar dalam gambar harus warna homogen dan tidak ada objek lainnya.
1.5
Sistematika Penulisan
Laporan Tugas akhir ini disusun dengan sistematika sebagai berikut :
•
Bab 1 Pendahuluan
Bab ini berisi latar belakang masalah, identifikasi masalah, tujuan, pembatasan
masalah dan sistematika penulisan.
•
Bab 2 Teori Pendukung
Bab ini berisi mengenai Pengenalan pengolahan citra, pembahasan pengolahan
citra (Image Processing), pengenalan teknik grayscale, pengenalan metoda
Tresholding, pengenalan citra biner, pengenalan teknik edge detection,
pengenalan algoritma Morphological, pengenalan matlab.
•
Bab 3 Perancangan Program
Bab ini berisi perancangan program yang digunakan, dan penjelasan program
serta flowchart perancangan program.
•
Bab 4 Data Pengamatan
Bab ini berisi tampilan dari program yang dirancang dan hasil dari pengujian
program.
•
Bab 5 Kesimpulan dan Saran
52
BAB V
KESIMPULAN
5.1 Kesimpulan
Berikut ini adalah kesimpulan yang diperoleh dari pengamatan :
Pada Pengamatan yang ditinjau dari Tabel 4.2 Hasil persentase pengujian gambar
yang dideteksi, didapatkan persentase yang paling tinggi dalam keberhasilan
mendeteksi gambar adalah referensi1 (gambar referensi dengan sikap posisi kedua
tangan turun ke bawah) sebesar 92.5%, dan persentase yang paling rendah dalam
keberhasilan mendeteksi gambar adalah referensi3 (gambar referensi dengan
sikap posisi kedua tangan naik ke atas) sebesar 72.5%.
Pada Pengamatan yang ditinjau dari Tabel 4.1 Hasil pengujian gambar yang
dideteksi dan Tabel 4.2 Hasil persentase pengujian gambar yang dideteksi,
didapatkan pendeteksian dengan jumlah kesalahan terbanyak dan nilai persentase
paling rendah dalam mendeteksi gambar, yaitu :
Referensi3 dengan output4 (gambar referensi3 = gambar dengan sikap
posisi kedua tangan naik ke atas, dan gambar output4 = gambar dengan
sikap posisi kedua tangan naik ke atas) memiliki jumlah kesalahan 5 dan
nilai persentase sebesar 50%
Referensi4 dengan output3 (gambar referensi4 = gambar dengan sikap
posisi tangan kiri naik ke atas dan tangan kanan turun ke bawah, dan
gambar output3 = gambar dengan sikap posisi tangan kiri naik ke atas dan
tangan kanan turun ke bawah), memiliki jumlah kesalahan 5 dan nilai
persentase sebesar 50%
Program yang telah didisain dapat mendeteksi perbedaan gambar sikap posisi
tangan input gambar terhadap gambar sikap posisi tangan referensi gambar
dengan cukup baik dan mencapai tingkat keberhasilan pendeteksian rata-rata
53
5.2 Saran
Dalam tugas akhir ini beberapa saran untuk perbaikan antara lain :
Memperbanyak pengambilan gambar-gambar Referensi gambar agar didapatkan
batas nilai-nilai yang lebih baik dalam mendeteksi suatu Input gambar.
Dengan memperbanyak pembagian atau pemilahan daerah-daerah gambar (grid),
agar dapat lebih akurat dalam mendeteksi suatu gambar.
DAFTAR PUSTAKA
1.
ClayM. Thompson and Loren Shure, “Image Processing-Toolbox for use
with Matlab”, The MathWorks,Inc., 1995.
2.
Duane Hanselman, Bruce Littlefield, 1998, Mastering MATLAB 5 A
Comprehensive Tutorial And Reference, Prentice Hall, Upper Saddle River,
New Jersey 07458
3.
Gunaidi Abdia Away, “The Shortcut of MATLAB Programming”, Penerbit
Informatika Bandung, Juni 2006.
4.
M.A.Sid-Ahmed, “Image Processing Theory, Algorithms, and
Architecture” McGraw Hill, Inc
5.
“Matlab User’s Guide”, The MathWorks, Inc., 1992.
6.
Rinaldi Munir, “Pengolahan Citra Digital dengan Pendekatan
Algoritmik”, Penerbit Informatika Bandung, Juni 2004.
7.
http://www.mathtools.net/MATLAB, 13 Agustus 2007.
8.
http://www.mathtools.net/MATLAB/Mathematical Morphology, 12 Agustus
2007.
9.