PERBANDINGAN METODE HARRIS CORNER DETECTION, EDGE BASED CORNER DETECTION DAN FAST CORNER DETECTION DALAM APLIKASI PENDETEKSI SENYUM PADA WAJAH MANUSIA Oleh Eduard Royce Siswanto NIM : 612009003 Skripsi Untuk melengkapi syarat-syarat memperoleh Ijasah Sarjana Teknik Fakultas Teknik Elektronika dan Komputer Program Studi Teknik Elektro 2013
105
Embed
PERBANDINGAN METODE HARRIS CORNER DETECTION, EDGE BASED CORNER DETECTION DAN FAST CORNER DETECTION DALAM APLIKASI PENDETEKSI SENYUM PADA WAJAH MANUSIA
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PERBANDINGAN METODE HARRIS CORNER DETECTION,
EDGE BASED CORNER DETECTION DAN FAST CORNER
DETECTION DALAM APLIKASI PENDETEKSI SENYUM PADA
WAJAH MANUSIA
Oleh
Eduard Royce Siswanto
NIM : 612009003
Skripsi
Untuk melengkapi syarat-syarat memperoleh
Ijasah Sarjana Teknik
Fakultas Teknik Elektronika dan Komputer
Program Studi Teknik Elektro
2013
v
DAFTAR ISI
INTISARI .............................................................................................................. i
ABSTRACT ........................................................................................................... ii
KATA PENGANTAR ............................................................................................ iii
DAFTAR ISI .......................................................................................................... v
DAFTAR GAMBAR ............................................................................................. viii
DAFTAR TABEL .................................................................................................. x
DAFTAR LAMBANG ........................................................................................... xi
DAFTAR SINGKATAN ........................................................................................ xiii
BAB I. PENDAHULUAN...................................................................................... 1
1.1 Latar Belakang Masalah ........................................................................ 1
1.2 Tujuan ................................................................................................... 3
1.3 Batasan Masalah ................................................................................... 3
1.4 Hipotesis Awal ...................................................................................... 4
[14] Edward Rosten and Tom Drummond, “Fusing Points and Lines For High
Performance Tracking”, IEEE International Conference on Computer Vision
no 2, October 2005, pp 1508-1511.
[15] Indian Face [Online], http://www.face-rec.org/databases/, diakses pada tanggal
20 Oktober 2012
49
LAMPIRAN A
SOURCE CODE PEMROGRAMAN YANG DIBUAT DENGAN MATLAB
A.1 Source Code Pra Proses Color Segmentation
clear all; clc; ctr = 0; kk = 1; dir='/Users/edoroyce/Documents/MATLAB/3/'; y = imread('/Users/edoroyce/Documents/MATLAB/senyum/1.jpg'); pic = y; for mm = 1:size(pic,1) for nn = 1:size(pic,2) if pic(mm,nn,1) < 80 || pic(mm,nn,2) > 80 || pic(mm,nn,3) > 100 gsc = 0; pic(mm,nn,:) = [gsc gsc gsc]; end end end
A.2 Source Code Metode Harris Corner Detection
level = graythresh(pic); bw = im2bw(pic,level); im = double(bw(:,:,1)); sigma = 2; % masking derivatif dx = [-1 0 1; -1 0 1; -1 0 1]; dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.04; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:));
50
%cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [i, j] = ind2sub(size(points), k); ykiri = points(i,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; save skripsi_harris_nocol tengah
A.3 Source Code Metode Edge Based Corner Detection
level = graythresh(pic); bw = im2bw(pic,level); bw3 = edge(bw,'sobel',0.5); % sobel edge detection im = double(bw3(:,:,1)); sigma = 2; % masking derivatif dx = [-1 0 1; -1 0 1; -1 0 1]; dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.04; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:));
51
%cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [i, j] = ind2sub(size(points), k); ykiri = points(i,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; save skripsi_edge_nocol tengah
A.4 Source Code Metode FAST Corner Detection
pic = rgb2gray(pic); [yy xx]=size(pic); ttl=yy.*xx; thres = 11; for i=4:xx-3 for j=4:yy-3 ctr=0; bts1 = y(j,i) + thres; bts2 = y(j,i) - thres; if y(j-3,i) > bts1 ctr=ctr+1; elseif y(j-3,i) < bts2 ctr=ctr+1; end if y(j+3,i) > bts1 ctr=ctr+1; elseif y(j+3,i) < bts2 ctr=ctr+1; end if y(j,i+3) > bts1 ctr=ctr+1; elseif y(j,i+3) < bts2 ctr=ctr+1; end if y(j,i-3) > bts1 ctr=ctr+1; elseif y(j,i-3) < bts2 ctr=ctr+1; end if ctr>=3
52
spn(kk,1) = i; spn(kk,2) = j; kk=kk+1; end end end %cari koordinat x kiri [xkiri, k] = min(spn(:,1)); [ii, jj] = ind2sub(size(spn), k); ykiri = spn(ii,2); fast_ykiri(1,1)=ykiri; %cari koordinat x kanan [xkanan, k] = max(spn(:,1)); [iii, jjj] = ind2sub(size(spn), k); ykanan = spn(iii,2); fast_ykanan(1,1)=ykanan; point = [ykanan,xkanan ; ykiri,xkiri]; tengah=(fast_ykiri+fast_ykanan)/2; save skripsi_edge_nocol tengah
A.5 Source Code Citra dengan Subyek Lebih Dari Satu
clear all; close all; clc; load skripsi_harris_col tengah img=imread('/Users/edoroyce/Downloads/FaceDetect/tes3.jpg'); detector = buildDetector(); [bbox bbimg faces bbfaces] = detectFaceParts(detector,img); for j=1:size(bbfaces,1) for l=1:3 img_crop(:,:,l)=img(bbox(j,14)+12:bbox(j,14)+bbox(j,16)-5,bbox(j,13)+5:bbox(j,13)+bbox(j,15)-5,l); %ymin:ymax,xmin:xmax,L menunjuk ke layer R/G/B %bbox(2,14) <<< 2 nya menunjuk ke faces ke n end a{j}=img_crop; pic = img_crop; for mm = 1:size(pic,1) for nn = 1:size(pic,2) if pic(mm,nn,1)<80||pic(mm,nn,2)>80||pic(mm,nn,3)>100 gsc = 0; pic(mm,nn,:) = [gsc gsc gsc]; end end end %===================HARRIS=========================== level = graythresh(pic); bw = im2bw(pic,level);
53
im = double(bw(:,:,1)); sigma = 0.5; % derivatif mask dx = [-1 0 1; -1 0 1; -1 0 1]; dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.08; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:)); %cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [iii, jjj] = ind2sub(size(points), k); ykiri = points(iii,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah tpl = ['subyek ', num2str(j),' tersenyum']; disp(tpl); else tpl = ['subyek ', num2str(j),' tidak tersenyum']; disp(tpl); end %draw(img_crop,point);
54
%figure;imshow(img_crop); clear img_crop; end figure; imshow(bbimg);
A.6 Source Code Graphical User Interface
function varargout = GUI_SKRIPSI_EDO(varargin) % GUI_SKRIPSI_EDO MATLAB code for GUI_SKRIPSI_EDO.fig % GUI_SKRIPSI_EDO, by itself, creates a new GUI_SKRIPSI_EDO or raises the existing % singleton*. % % H = GUI_SKRIPSI_EDO returns the handle to a new GUI_SKRIPSI_EDO or the handle to % the existing singleton*. % % GUI_SKRIPSI_EDO('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GUI_SKRIPSI_EDO.M with the given input arguments. % % GUI_SKRIPSI_EDO('Property','Value',...) creates a new GUI_SKRIPSI_EDO or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before GUI_SKRIPSI_EDO_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to GUI_SKRIPSI_EDO_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help GUI_SKRIPSI_EDO % Last Modified by GUIDE v2.5 12-Sep-2013 21:36:05 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @GUI_SKRIPSI_EDO_OpeningFcn, ... 'gui_OutputFcn', @GUI_SKRIPSI_EDO_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT
55
% --- Executes just before GUI_SKRIPSI_EDO is made visible. function GUI_SKRIPSI_EDO_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to GUI_SKRIPSI_EDO (see VARARGIN) % Choose default command line output for GUI_SKRIPSI_EDO handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes GUI_SKRIPSI_EDO wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = GUI_SKRIPSI_EDO_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename,pathname] = uigetfile('/Users/edoroyce/Documents/MATLAB/SUBJECT SMILE DETECTOR/uji/*.JPG'); if isequal(filename,0) disp('User Canceled') else disp(['User Selected ', fullfile(pathname, filename)]) end a=strcat(pathname,filename); pict=imread(a); y = imresize(pict,[1000 1500]); detector = buildDetector(); [bbox bbimg faces bbfaces] = detectFaceParts(detector,y,2); for l=1:3 img_crop(:,:,l)=y(bbox(1,14)+27:bbox(1,14)+bbox(1,16)-27,bbox(1,13):bbox(1,13)+bbox(1,15),l); end handles.gambar = img_crop; guidata(hObject,handles); set(handles.text2, 'String',a); axes(handles.axes1);imshow(pict); % --- Executes on selection change in listbox1. function listbox1_Callback(hObject, eventdata, handles) % hObject handle to listbox1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
56
% Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array % contents{get(hObject,'Value')} returns selected item from listbox1 % --- Executes during object creation, after setting all properties. function listbox1_CreateFcn(hObject, eventdata, handles) % hObject handle to listbox1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in radiobutton1. function radiobutton1_Callback(hObject, eventdata, handles) % hObject handle to radiobutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of radiobutton1 % --- Executes on button press in radiobutton2. function radiobutton2_Callback(hObject, eventdata, handles) % hObject handle to radiobutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of radiobutton2 % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) aa = get(handles.listbox1,'value'); tic; y = handles.gambar; bbb = handles.bb; if aa == 1 if bbb == 1 load skripsi_harris_col tengah %======Color Segmentation=================== pic = y; for mm = 1:size(pic,1) for nn = 1:size(pic,2) if pic(mm,nn,1)<80||pic(mm,nn,2)>80||pic(mm,nn,3)>100 gsc = 0; pic(mm,nn,:) = [gsc gsc gsc]; end end end %=======Harris Corner Detection============= coba = rgb2gray(pic); level = graythresh(coba); bw = im2bw(pic,level); im = double(bw(:,:,1)); sigma = 0.5; % derivatif mask dx = [-1 0 1; -1 0 1; -1 0 1];
57
dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.08; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:)); %cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [i, j] = ind2sub(size(points), k); ykiri = points(i,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah set(handles.text7, 'String', 'Senyum'); else set(handles.text7, 'String', 'Bukan Senyum'); end waktu=toc; set(handles.text9,'String',waktu); else %===============NO COLOR SEGMENTATION==============
dx = [-1 0 1; -1 0 1; -1 0 1]; dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.04; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:)); %cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [i, j] = ind2sub(size(points), k); ykiri = points(i,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah set(handles.text7, 'String', 'Senyum'); else set(handles.text7, 'String', 'Bukan Senyum'); end waktu=toc; set(handles.text9,'String',waktu); end else if aa == 2 if bbb == 1
load skripsi_edge_col tengah %======Color Segmentation=================== pic = y; for mm = 1:size(pic,1) for nn = 1:size(pic,2) if pic(mm,nn,1)<80||pic(mm,nn,2)>80||pic(mm,nn,3)>100 gsc = 0; pic(mm,nn,:) = [gsc gsc gsc]; end
59
end end %=======Edge Based Corner Detection============= coba = rgb2gray(pic); level = graythresh(coba); bw = im2bw(pic,level); bw3 = edge(bw,'sobel',0.5); im = double(bw3(:,:,1)); sigma = 1.5; % derivatif mask dx = [-1 0 1; -1 0 1; -1 0 1]; dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.03; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:)); %cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [i, j] = ind2sub(size(points), k); ykiri = points(i,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah set(handles.text7, 'String', 'Senyum'); else set(handles.text7, 'String', 'Bukan Senyum'); end waktu=toc; set(handles.text9,'String',waktu); else %set(handles.text9,'String','No');
60
load skripsi_edge_nocol tengah %========Edge Based Corner Detection============ coba = rgb2gray(y); level = graythresh(coba); bw = im2bw(y,level); bw3 = edge(bw,'sobel',0.5); im = double(bw3(:,:,1)); sigma = 1.5; % derivatif mask dx = [-1 0 1; -1 0 1; -1 0 1]; dy = dx'; % citra derivatif Ix = conv2(im, dx, 'same'); Iy = conv2(im, dy, 'same'); s_I = sigma; g = fspecial('gaussian',max(1,fix(6*s_I+1)), s_I); Ix2 = conv2(Ix.^2, g, 'same'); Iy2 = conv2(Iy.^2, g, 'same'); Ixy = conv2(Ix.*Iy, g, 'same'); %hitung nilai interest point k = 0.15; cim = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; % metode Harris %cari nilai maksimal [r,c,max_local] = findLocalMaximum(cim,3*s_I); %threshold = 1% dari max value t = 0.01*max(max_local(:)); %cari nilai yg lebih besar dr threshold [r,c] = find(max_local>=t); %buat interest point points = [r,c]; %cari koordinat x kiri [xkiri, k] = max(points(:,2)); [i, j] = ind2sub(size(points), k); ykiri = points(i,1); %cari koordinat x kanan [xkanan, k] = min(points(:,2)); [ii, jj] = ind2sub(size(points), k); ykanan = points(ii,1); point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah set(handles.text7, 'String', 'Senyum'); else set(handles.text7, 'String', 'Bukan Senyum'); end waktu=toc; set(handles.text9,'String',waktu);
61
end else if bbb == 1 load skripsi_fast_col tengah kk=1; %============Color Segmentation============= pic=y; for mm = 1:size(pic,1) for nn = 1:size(pic,2) if pic(mm,nn,1)<80||pic(mm,nn,2)>80||pic(mm,nn,3)>100 gsc = 0; pic(mm,nn,:) = [gsc gsc gsc]; end end end %============FAST Corner Detection=========== y=rgb2gray(pic); [yy xx]=size(y); ttl=yy.*xx; thres = 3; for i=4:xx-3 for j=4:yy-3 ctr=0; bts1 = y(j,i) + thres; bts2 = y(j,i) - thres; if y(j-3,i) > bts1 ctr=ctr+1; elseif y(j-3,i) < bts2 ctr=ctr+1; end if y(j+3,i) > bts1 ctr=ctr+1; elseif y(j+3,i) < bts2 ctr=ctr+1; end if y(j,i+3) > bts1 ctr=ctr+1; elseif y(j,i+3) < bts2 ctr=ctr+1; end if y(j,i-3) > bts1 ctr=ctr+1; elseif y(j,i-3) < bts2 ctr=ctr+1; end if ctr>=3 spn(kk,1) = i; spn(kk,2) = j; kk=kk+1; end end end %cari koordinat x kiri [xkiri, k] = min(spn(:,1)); [ii, jj] = ind2sub(size(spn), k); ykiri = spn(ii,2);
62
fast_ykiri(1,1)=ykiri; %cari koordinat x kanan [xkanan, k] = max(spn(:,1)); [iii, jjj] = ind2sub(size(spn), k); ykanan = spn(iii,2); fast_ykanan(1,1)=ykanan; point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah set(handles.text7, 'String', 'Senyum'); else set(handles.text7, 'String', 'Bukan Senyum'); end waktu=toc; set(handles.text9,'String',waktu); else %=========FAST Corner Detection========= kk=1; pic=y; load skripsi_fast_nocol tengah y=rgb2gray(pic); [yy xx]=size(y); ttl=yy.*xx; thres = 18; for i=4:xx-3 for j=4:yy-3 ctr=0; bts1 = y(j,i) + thres; bts2 = y(j,i) - thres; if y(j-3,i) > bts1 ctr=ctr+1; elseif y(j-3,i) < bts2 ctr=ctr+1; end if y(j+3,i) > bts1 ctr=ctr+1; elseif y(j+3,i) < bts2 ctr=ctr+1; end if y(j,i+3) > bts1 ctr=ctr+1; elseif y(j,i+3) < bts2 ctr=ctr+1; end if y(j,i-3) > bts1 ctr=ctr+1; elseif y(j,i-3) < bts2 ctr=ctr+1; end if ctr>=3 spn(kk,1) = i; spn(kk,2) = j; kk=kk+1; end end end
63
%cari koordinat x kiri [xkiri, k] = min(spn(:,1)); [ii, jj] = ind2sub(size(spn), k); ykiri = spn(ii,2); fast_ykiri(1,1)=ykiri; %cari koordinat x kanan [xkanan, k] = max(spn(:,1)); [iii, jjj] = ind2sub(size(spn), k); ykanan = spn(iii,2); fast_ykanan(1,1)=ykanan; point = [ykanan,xkanan ; ykiri,xkiri]; rata=(ykiri+ykanan)/2; if rata<tengah set(handles.text7, 'String', 'Senyum'); else set(handles.text7, 'String', 'Bukan Senyum'); end waktu=toc; set(handles.text9,'String',waktu); end end end % --- Executes during object creation, after setting all properties. function pushbutton1_CreateFcn(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % --- Executes on button press in radiobutton5. function radiobutton5_Callback(hObject, eventdata, handles) % hObject handle to radiobutton5 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of radiobutton5 % --- Executes when selected object is changed in uipanel1. function uipanel1_SelectionChangeFcn(hObject, eventdata, handles) % hObject handle to the selected object in uipanel1 % eventdata structure with the following fields (see UIBUTTONGROUP) % EventName: string 'SelectionChanged' (read only) % OldValue: handle of the previously selected object or empty if none was selected % NewValue: handle of the currently selected object % handles structure with handles and user data (see GUIDATA) if hObject == handles.radiobutton1 colorr = 1; else colorr = 2;
64
end handles.bb=colorr; guidata(hObject,handles);
65
LAMPIRAN B
TABEL HASIL PENGUJIAN PERANGKAT LUNAK
B.1 Tabel Hasil Percobaan Pertama
B.1.1 Metode Harris Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode Harris
Corner Detection percobaan pertama dapat dilihat pada Tabel B.1.
Tabel B.1. Akurasi Metode Harris Corner Detection Percobaan Pertama
Sigma k (sensitivitas) TN TP Akurasi (%) Waktu Komputasi (mili detik)
0.5 0.03 5 40 22.5 13.2
0.5 0.04 5 40 22.5 13.2
0.5 0.05 5 40 22.5 13.0
0.5 0.06 4 41 22.5 13.3
0.5 0.07 4 41 22.5 13.0
0.5 0.08 4 41 22.5 12.6
0.5 0.09 5 38 21.5 13.1
0.5 0.1 7 38 22.5 12.6
0.5 0.11 7 39 23 13.8
0.5 0.12 7 39 23 14.9
0.5 0.13 9 36 22.5 14.4
0.5 0.14 7 39 23 14.3
0.5 0.15 8 40 24 14.1
1 0.03 7 42 24.5 30.3
1 0.04 8 41 24.5 23.6
1 0.05 7 42 24.5 29.8
1 0.06 8 42 25 29.9
1 0.07 12 42 27 30.2
1 0.08 14 40 27 29.0
1 0.09 11 40 25.5 29.4
1 0.1 10 40 25 29.9
1 0.11 10 40 25 31.3
1 0.12 11 40 25.5 31.3
1 0.13 11 42 26.5 31.1
1 0.14 13 38 25.5 31.2
1 0.15 12 38 25 31.0
1.5 0.03 8 41 24.5 45.8
1.5 0.04 8 42 25 45.8
1.5 0.05 7 40 23.5 45.5
1.5 0.06 6 41 23.5 45.2
1.5 0.07 8 37 22.5 45.5
66
1.5 0.08 8 37 22.5 45.0
1.5 0.09 8 37 22.5 45.5
1.5 0.1 8 39 23.5 45.4
1.5 0.11 7 40 23.5 46.3
1.5 0.12 8 40 24 45.4
1.5 0.13 8 40 24 44.7
1.5 0.14 7 42 24.5 45.4
1.5 0.15 7 40 23.5 45.5
2 0.03 9 49 29 71.4
2 0.04 9 49 29 70.6
2 0.05 9 48 28.5 70.9
2 0.06 9 49 29 70.6
2 0.07 9 47 28 70.5
2 0.08 10 47 28.5 70.4
2 0.09 10 44 27 70.7
2 0.1 10 43 26.5 70.6
2 0.11 10 45 27.5 69.9
2 0.12 10 45 27.5 7.04
2 0.13 13 44 28.5 71.9
2 0.14 14 41 27.5 70.4
2 0.15 13 35 24 70.7
67
B.1.2 Metode Edge Based Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode Edge
Based Corner Detection percobaan pertama dapat dilihat pada Tabel B.2.
Tabel B.2. Akurasi Metode Edge Based Corner Detection Percobaan Pertama
Sigma k (sensitivitas) TN TP Akurasi (%) Waktu Komputasi (mili detik)
0.5 0.03 38 36 37 15.4
0.5 0.04 38 36 37 15.6
0.5 0.05 37 36 36.5 15.7
0.5 0.06 39 36 37.5 15.3
0.5 0.07 37 36 36.5 16.1
0.5 0.08 38 33 35.5 16.0
0.5 0.09 36 34 35 16.6
0.5 0.1 37 39 38 15.1
0.5 0.11 40 37 38.5 19.4
0.5 0.12 40 37 38.5 20.3
0.5 0.13 39 37 38 19.8
0.5 0.14 39 38 38.5 20.0
0.5 0.15 39 37 38 15.7
1 0.03 35 40 37.5 32.7
1 0.04 35 39 37 31.6
1 0.05 33 41 37 32.0
1 0.06 33 41 37 32.7
1 0.07 33 41 37 32.0
1 0.08 33 41 37 32.1
1 0.09 33 41 37 31.9
1 0.1 36 40 38 31.7
1 0.11 33 41 37 36.0
1 0.12 33 42 37.5 36.1
1 0.13 34 40 37 36.9
1 0.14 38 40 39 36.3
1 0.15 35 40 37.5 33.6
1.5 0.03 38 42 40 48.0
1.5 0.04 38 41 39.5 47.8
1.5 0.05 41 42 41.5 48.4
1.5 0.06 41 42 41.5 47.7
1.5 0.07 40 41 40.5 48.1
1.5 0.08 40 43 41.5 47.7
1.5 0.09 40 42 41 47.0
1.5 0.1 40 41 40.5 48.2
1.5 0.11 41 40 40.5 51.1
1.5 0.12 42 38 40 50.9
1.5 0.13 40 36 38 51.5
68
1.5 0.14 41 38 39.5 50.9
1.5 0.15 42 42 42 50.9
2 0.03 41 39 40 71.3
2 0.04 40 38 39 79.9
2 0.05 41 36 38.5 70.1
2 0.06 40 37 38.5 70.4
2 0.07 40 37 38.5 71.4
2 0.08 40 37 38.5 70.7
2 0.09 42 38 40 71.2
2 0.1 43 38 40.5 70.3
2 0.11 43 39 41 75.7
2 0.12 43 38 40.5 76.4
2 0.13 43 38 40.5 75.1
2 0.14 43 39 41 76.3
2 0.15 43 39 41 75.2
69
B.1.3 Metode FAST Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode FAST
Corner Detection percobaan pertama dapat dilihat pada Tabel B.3.
Tabel B.3. Akurasi Metode FAST Corner Detection Percobaan Pertama
Threshold TN TP Akurasi (%) Waktu Komputasi (mili detik)
1 38 76 57 21.4
2 45 64 54.5 20.5
3 49 65 57 19.1
4 48 55 51.5 17.6
5 49 47 48 17.2
6 58 50 54 16.6
7 60 51 55.5 14.5
8 64 49 56.5 14.1
9 72 41 56.5 14.1
10 70 48 59 13.9
11 72 41 56.5 14.4
12 67 31 49 13.3
13 70 30 50 13.7
14 72 33 52.5 13.1
15 70 32 51 13.6
16 74 32 53 12.9
17 77 39 58 13.2
18 80 39 59.5 13.1
19 86 30 58 13.1
20 90 23 56.5 13.1
21 79 30 54.5 13.0
22 82 29 55.5 13.0
23 83 33 58 13.0
24 79 28 53.5 13.2
25 60 27 43.5 12.9
70
B.2 Tabel Hasil Percobaan Kedua
B.2.1 Metode Harris Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode Harris
Corner Detection percobaan kedua dapat dilihat pada Tabel B.4.
Tabel B.4. Akurasi Metode Harris Corner Detection Percobaan Kedua
Sigma k (sensitivitas) TN TP Akurasi (%) Waktu Komputasi (mili detik)
0.5 0.03 85 46 65.5 45.1
0.5 0.04 86 49 67.5 51.6
0.5 0.05 86 49 67.5 50.6
0.5 0.06 87 49 68 49.4
0.5 0.07 88 49 68.5 44.7
0.5 0.08 88 50 69 48.8
0.5 0.09 88 49 68.5 47.3
0.5 0.1 88 49 68.5 50.2
0.5 0.11 88 49 68.5 50.1
0.5 0.12 85 49 67 49.9
0.5 0.13 86 46 66 49.6
0.5 0.14 86 46 66 50.4
0.5 0.15 86 46 66 48.5
1 0.03 84 41 62.5 65.1
1 0.04 84 44 64 66.6
1 0.05 83 43 63 64.9
1 0.06 84 43 63.5 66.5
1 0.07 84 42 63 62.1
1 0.08 86 41 63.5 64.6
1 0.09 84 43 63.5 59.1
1 0.1 84 41 62.5 65.8
1 0.11 83 42 62.5 66.0
1 0.12 83 44 63.5 67.0
1 0.13 83 43 63 65.2
1 0.14 84 43 63.5 65.5
1 0.15 84 40 62 69.2
1.5 0.03 88 44 66 80.1
1.5 0.04 88 44 66 79.9
1.5 0.05 89 45 67 80.0
1.5 0.06 89 45 67 80.4
1.5 0.07 89 44 66.5 75.6
1.5 0.08 89 44 66.5 81.2
1.5 0.09 88 44 66 80.1
1.5 0.1 88 45 66.5 79.5
1.5 0.11 88 45 66.5 78.4
71
1.5 0.12 89 44 66.5 79.8
1.5 0.13 89 45 67 80.0
1.5 0.14 89 45 67 80.1
1.5 0.15 89 46 67.5 80.6
2 0.03 84 42 63 103.9
2 0.04 83 40 61.5 104.6
2 0.05 84 40 62 103.2
2 0.06 84 41 62.5 105.0
2 0.07 84 41 62.5 103.6
2 0.08 85 40 62.5 104.5
2 0.09 84 40 62 103.4
2 0.1 84 40 62 103.3
2 0.11 84 39 61.5 103.5
2 0.12 85 40 62.5 104.8
2 0.13 85 40 62.5 104.5
2 0.14 84 39 61.5 103.8
2 0.15 82 39 60.5 103.3
72
B.2.2 Metode Edge Based Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode Edge
Based Corner Detection percobaan kedua dapat dilihat pada Tabel B.5.
Tabel B.5. Akurasi Metode Edge Based Corner Detection Percobaan Kedua
Sigma k (sensitivitas) TN TP Akurasi (%) Waktu Komputasi (mili detik)
0.5 0.03 81 40 60.5 64.9
0.5 0.04 81 38 59.5 64.0
0.5 0.05 82 40 61 64.9
0.5 0.06 82 38 60 62.8
0.5 0.07 82 38 60 51.3
0.5 0.08 82 38 60 61.6
0.5 0.09 82 37 59.5 63.8
0.5 0.1 82 37 59.5 63.3
0.5 0.11 81 37 59 62.3
0.5 0.12 81 37 59 59.4
0.5 0.13 80 37 58.5 62.6
0.5 0.14 80 37 58.5 65.1
0.5 0.15 80 41 60.5 63.9
1 0.03 81 35 58 78.2
1 0.04 81 36 58.5 78.1
1 0.05 81 36 58.5 78.6
1 0.06 82 36 59 80.0
1 0.07 82 36 59 75.2
1 0.08 82 38 60 75.5
1 0.09 82 38 60 77.7
1 0.1 82 38 60 77.6
1 0.11 82 38 60 77.5
1 0.12 82 39 60.5 78.9
1 0.13 82 39 60.5 77.5
1 0.14 81 41 61 80.0
1 0.15 81 41 61 79.4
1.5 0.03 80 46 63 92.0
1.5 0.04 80 47 63.5 91.1
1.5 0.05 78 47 62.5 89.4
1.5 0.06 77 46 61.5 91.4
1.5 0.07 78 44 61 91.4
1.5 0.08 77 45 61 90.7
1.5 0.09 79 45 62 94.5
1.5 0.1 79 45 62 102.9
1.5 0.11 79 45 62 92.5
1.5 0.12 79 44 61.5 93.0
1.5 0.13 78 44 61 89.5
73
1.5 0.14 78 43 60.5 90.0
1.5 0.15 79 42 60.5 92.7
2 0.03 80 38 59 117.8
2 0.04 81 37 59 115.7
2 0.05 80 38 59 115.7
2 0.06 81 36 58.5 115.5
2 0.07 80 36 58 114.9
2 0.08 80 38 59 115.8
2 0.09 79 37 58 114..2
2 0.1 79 38 58.5 118.6
2 0.11 79 37 58 115.8
2 0.12 82 36 59 115.8
2 0.13 81 38 59.5 114.3
2 0.14 82 38 60 116.9
2 0.15 82 36 59 114.7
74
B.2.3 Metode FAST Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode FAST
Corner Detection percobaan kedua dapat dilihat pada Tabel B.6.
Tabel B.6. Akurasi Metode FAST Corner Detection Percobaan Kedua
Threshold TN TP Akurasi (%) Waktu Komputasi (mili detik)
1 91 41 66 47.8
2 91 39 65 47.6
3 91 40 65.5 46.6
4 88 39 63.5 46.8
5 91 36 63.5 47.3
6 88 35 61.5 47.1
7 88 35 61.5 47.3
8 91 36 63.5 47.1
9 91 35 63 47.0
10 91 32 61.5 47.0
11 91 35 63 46.2
12 91 32 61.5 47.0
13 91 30 60.5 46.9
14 91 28 59.5 46.5
15 90 29 59.5 46.4
16 90 27 58.5 47.0
17 90 28 59 46.7
18 90 27 58.5 47.1
19 90 25 57.5 46.5
20 90 25 57.5 46.6
21 89 25 57 47.0
22 88 25 56.5 46.7
23 87 25 56 48.1
24 84 25 54.5 46.5
25 85 23 54 46.8
75
B.3 Tabel Hasil Percobaan Ketiga
B.3.1 Metode Harris Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode Harris
Corner Detection percobaan ketiga dapat dilihat pada Tabel B.7.
Tabel B.7. Akurasi Metode Harris Corner Detection Percobaan Ketiga
Sigma k (sensitivitas) TN TP Akurasi (%) Waktu Komputasi (mili detik)
0.5 0.03 85 61 73 45.1
0.5 0.04 86 61 73.5 51.6
0.5 0.05 86 66 76 50.6
0.5 0.06 87 66 76.5 49.4
0.5 0.07 88 66 77 44.7
0.5 0.08 88 67 77.5 49.2
0.5 0.09 88 66 77 47.3
0.5 0.1 88 66 77 50.2
0.5 0.11 88 66 77 50.1
0.5 0.12 85 66 75.5 49.9
0.5 0.13 86 62 74 49.6
0.5 0.14 86 62 74 50.4
0.5 0.15 86 62 74 48.5
1 0.03 84 54 69 65.1
1 0.04 84 59 71.5 66.6
1 0.05 83 57 70 64.9
1 0.06 84 56 70 66.5
1 0.07 84 55 69.5 62.1
1 0.08 86 55 70.5 64.6
1 0.09 84 56 70 59.1
1 0.1 84 54 69 65.8
1 0.11 83 55 69 66.0
1 0.12 83 58 70.5 67.0
1 0.13 83 57 70 65.2
1 0.14 84 57 70.5 65.5
1 0.15 84 53 68.5 69.2
1.5 0.03 88 61 74.5 80.1
1.5 0.04 88 61 74.5 79.9
1.5 0.05 89 62 75.5 80.0
1.5 0.06 89 62 75.5 80.4
1.5 0.07 89 61 75 75.6
1.5 0.08 89 61 75 81.2
1.5 0.09 88 61 74.5 80.1
1.5 0.1 88 62 75 79.5
1.5 0.11 88 62 75 78.4
76
1.5 0.12 89 59 74 79.8
1.5 0.13 89 59 74 80.0
1.5 0.14 89 59 74 80.1
1.5 0.15 89 60 74.5 80.6
2 0.03 84 58 71 103.2
2 0.04 83 56 69.5 104.6
2 0.05 84 57 70.5 103.2
2 0.06 84 57 70.5 105.0
2 0.07 84 57 70.5 103.6
2 0.08 85 56 70.5 104.5
2 0.09 84 55 69.5 103.4
2 0.1 84 55 69.5 103.3
2 0.11 84 54 69 103.5
2 0.12 85 55 70 104.8
2 0.13 85 54 69.5 104.5
2 0.14 84 53 68.5 103.8
2 0.15 82 54 68 103.3
77
B.3.2 Metode Edge Based Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode Edge
Based Corner Detection percobaan ketiga dapat dilihat pada Tabel B.8.
Tabel B.8. Akurasi Metode Edge Based Corner Detection Percobaan Ketiga
Sigma k (sensitivitas) TN TP Akurasi (%) Waktu Komputasi (mili detik)
0.5 0.03 81 54 67.5 64.9
0.5 0.04 81 51 66 64.6
0.5 0.05 82 54 68 64.9
0.5 0.06 82 51 66.5 62.8
0.5 0.07 82 51 66.5 51.3
0.5 0.08 82 51 66.5 61.6
0.5 0.09 82 51 66.5 63.8
0.5 0.1 82 51 66.5 63.3
0.5 0.11 81 50 65.5 62.3
0.5 0.12 81 51 66 59.4
0.5 0.13 80 51 65.5 62.6
0.5 0.14 80 51 65.5 65.1
0.5 0.15 80 55 67.5 63.9
1 0.03 81 50 65.5 78.2
1 0.04 81 50 65.5 78.1
1 0.05 81 49 65 78.6
1 0.06 82 49 65.5 80.0
1 0.07 82 49 65.5 75.2
1 0.08 82 52 67 75.5
1 0.09 82 51 66.5 77.7
1 0.1 82 51 66.5 77.6
1 0.11 82 51 66.5 77.5
1 0.12 82 52 67 78.9
1 0.13 82 52 67 77.5
1 0.14 81 54 67.5 80.0
1 0.15 81 55 68 79.4
1.5 0.03 80 59 69.5 91.0
1.5 0.04 80 60 70 90.1
1.5 0.05 78 60 69 89.4
1.5 0.06 77 59 68 91.4
1.5 0.07 78 57 67.5 91.4
1.5 0.08 77 58 67.5 90.7
1.5 0.09 79 58 68.5 94.5
1.5 0.1 79 58 68.5 102.9
1.5 0.11 79 58 68.5 92.5
1.5 0.12 79 57 68 93.0
1.5 0.13 78 58 68 89.5
78
1.5 0.14 78 56 67 90.0
1.5 0.15 79 56 67.5 92.7
2 0.03 80 53 66.5 117.8
2 0.04 81 53 67 115.7
2 0.05 80 54 67 115.7
2 0.06 81 52 66.5 115.5
2 0.07 80 52 66 114.9
2 0.08 80 54 67 115.8
2 0.09 79 53 66 114.2
2 0.1 79 54 66.5 118.6
2 0.11 79 52 65.5 115.8
2 0.12 82 51 66.5 115.8
2 0.13 81 53 67 114.3
2 0.14 82 52 67 116.9
2 0.15 82 50 66 114.7
79
B.3.3 Metode FAST Corner Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode FAST
Corner Detection percobaan ketiga dapat dilihat pada Tabel B.9.
Tabel B.9. Akurasi Metode FAST Corner Detection Percobaan Ketiga
Threshold TN TP Akurasi (%) Waktu Komputasi (mili detik)
1 91 54 72.5 47.7
2 91 52 71.5 47.5
3 91 54 72.5 46.6
4 88 53 70.5 46.7
5 91 50 70.5 47.3
6 88 49 68.5 47.0
7 88 50 69 47.2
8 91 51 71 47.1
9 91 50 70.5 47.0
10 91 47 69 46.9
11 91 51 71 46.2
12 91 47 69 46.9
13 91 46 68.5 46.9
14 91 43 67 46.5
15 90 44 67 46.3
16 90 41 65.5 47.0
17 90 43 66.5 46.6
18 90 41 65.5 47.0
19 90 40 65 46.4
20 90 40 65 46.6
21 89 40 64.5 46.9
22 88 40 64 46.7
23 87 40 63.5 48.1
24 84 41 62.5 46.5
25 85 39 62 46.8
80
B.4 Tabel Hasil Penambahan Batas Nilai Rata-rata Metode FAST Corner
Detection
Tabel akurasi dan kombinasi parameter yang digunakan pada metode FAST
Corner Detection dengan penambahan nilai koordinat x rata-rata ekspresi tersenyum
sebanyak 2 piksel dapat dilihat pada Tabel B.10.
Tabel B.10. Akurasi Metode FAST Corner Detection dengan Penambahan
Batas Nilai Rata-rata
Threshold TN TP Akurasi (%) Waktu Komputasi (mili detik)
1 94 66 80 45.7
2 94 62 78 44.8
3 94 64 79 45.0
4 94 68 81 44.4
5 96 64 80 43.6
6 94 58 76 44.0
7 92 56 74 44.5
8 98 58 78 44.2
9 98 58 78 42.9
10 98 58 78 46.2
11 98 54 76 43.8
12 98 54 76 43.1
13 98 50 74 43.0
14 98 46 72 42.2
15 98 46 72 44.7
16 98 46 72 48.4
17 98 46 72 46.9
18 98 46 72 44.7
19 98 44 71 46.4
20 98 46 72 44.7
21 98 46 72 46.9
22 94 44 69 45.7
23 94 44 69 46.8
24 88 46 67 46.9
25 88 46 67 46.4
81
LAMPIRAN C
PENURUNAN HUBUNGAN DETERMINAN, TRACE DAN �� METODE
HARRIS CORNER DETECTION
Persamaan tanggapan sudut Harris dapat dihitung dengan mengurangkan
determinan dari matriks M dengan trace kuadratnya, dimana � = (15)
dan persamaan tanggapan sudut Harris dapat ditulis seperti persamaan (16) �� = � � − � × �� 2(�) (16)
Pada tulisannya, Harris menyebutkan untuk mengetahui suatu titik sudut atau
bukan adalah dengan menghitung eigenvalue dari matriks M, dengan syarat sebagai
berikut:
1. �1 dan �2 bernilai 0, maka tidak ada perubahan intensitas di titik tersebut.
2. �1 ≫ 0 � �2 ≈ 0 atau sebaliknya, maka titik merupakan tepian.
3. �1 � �2 bernilai ≫ 0, maka titik merupakan sudut.
Akan tetapi menghitung eigenvalue akan memakan waktu komputasi yang
sangat panjang, maka Harris membuat persamaan baru yang bisa merepresentasikan
eigenvalue tanpa harus memperhitungkan nilai eigenvalue itu sendiri. Secara
matematis terdapat hubungan antara eigenvalue dengan determinan dan trace suatu
matriks seperti dapat dilihat pada persamaan (17) dan persamaan (18) � � = �1 × �2 (17) �� � = �1 + �2 (18)
Sehingga persamaan tanggapan detektor Harris dapat dituliskan menjadi
persamaan (19) �� = �1 × �2 − � × (�1 + �2)2 (19)
Penurunan persamaan �� dengan memperhitungkan determinan matriks M dan trace-
nya dapat dilihat pada persamaan (20) �� = � � − � × �� 2 �
= − 2 − � × ( + )2
= − 2 − � × ( 2 + 2 + 2)
= − 2 − � 2 − 2� − � 2 (20)
82
Persamaan (21) merupakan perhitungan eigenvalue dari matriks M � = − � − � � � = 0 (21)