A1 LISTING PROGRAM 1. Form Cover function varargout = cover(varargin) COVER MATLAB code for cover.fig COVER, by itself, creates a new COVER or raises the existing singleton*. H = COVER returns the handle to a new COVER or the handle to the existing singleton*. COVER('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in COVER.M with the given input arguments. COVER('Property','Value',...) creates a new COVER or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before cover_openingfcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to cover_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 cover Last Modified by GUIDE v2.5 20Jun2014 12:24:43 Begin initialization code DO NOT EDIT gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @cover_openingfcn,... 'gui_outputfcn', @cover_outputfcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); gui_mainfcn(gui_state, varargin{:}); End initialization code DO NOT EDIT
A2 Executes just before cover is made visible. function cover_openingfcn(hobject, eventdata, handles, varargin) This function has no output args, see OutputFcn. hobject handle to figure varargin command line arguments to cover (see VARARGIN) Choose default command line output for cover handles.axes1 = imshow('logo.jpg'); handles.output = hobject; Update handles structure guidata(hobject, handles); UIWAIT makes cover wait for user response (see UIRESUME) uiwait(handles.figure1); Outputs from this function are returned to the command line. function varargout = cover_outputfcn(hobject, eventdata, handles) varargout cell array for returning output args (see VARARGOUT); hobject handle to figure Get default command line output from handles structure varargout{1} = handles.output; function Untitled_2_Callback(hObject, eventdata, handles) hobject handle to Untitled_2 (see GCBO) Skripsi delete(handles.figure1) function Untitled_3_Callback(hObject, eventdata, handles) hobject handle to Untitled_3 (see GCBO) Help delete(handles.figure1) function Untitled_4_Callback(hObject, eventdata, handles) hobject handle to Untitled_4 (see GCBO)
A3 close; 2. Form Procces function varargout = Skripsi(varargin) SKRIPSI MATLAB code for Skripsi.fig SKRIPSI, by itself, creates a new SKRIPSI or raises the existing singleton*. H = SKRIPSI returns the handle to a new SKRIPSI or the handle to the existing singleton*. SKRIPSI('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in SKRIPSI.M with the given input arguments. SKRIPSI('Property','Value',...) creates a new SKRIPSI or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before Skripsi_OpeningFcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to Skripsi_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 Skripsi Last Modified by GUIDE v2.5 20Jun2014 11:25:37 Begin initialization code DO NOT EDIT gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Skripsi_OpeningFcn,... 'gui_outputfcn', @Skripsi_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); gui_mainfcn(gui_state, varargin{:}); End initialization code DO NOT EDIT
A4 Executes just before Skripsi is made visible. function Skripsi_OpeningFcn(hObject, eventdata, handles, varargin) This function has no output args, see OutputFcn. hobject handle to figure varargin command line arguments to Skripsi (see VARARGIN) Choose default command line output for Skripsi handles.output = hobject; Update handles structure guidata(hobject, handles); UIWAIT makes Skripsi wait for user response (see UIRESUME) uiwait(handles.figure1); Outputs from this function are returned to the command line. function varargout = Skripsi_OutputFcn(hObject, eventdata, handles) varargout cell array for returning output args (see VARARGOUT); hobject handle to figure 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) [nama_file,nama_path] = uigetfile({'*.jpg'},'buka File Citra'); if ~isequal(nama_file,0) handles.citra = imread(fullfile(nama_path,nama_file)); guidata(hobject,handles); axes(handles.axes1); imshow(handles.citra); return; ; Executes on button press in pushbutton2. function pushbutton2_callback(hobject, eventdata, handles) hobject handle to pushbutton2 (see GCBO) gambar = getimage(handles.axes1); red = gambar(:,:,1); if red <= 255 msgbox('gambar yang diproses harus berwarna(rgb)','peringatan','warn'); green = gambar(:,:,2); blue = gambar(:,:,3);
A5 grayscale = 0.3*red + 0.3*green + 0.3*blue; axes(handles.axes2); imshow(grayscale); ; function slider2_callback(hobject, eventdata, handles) hobject handle to slider2 (see GCBO) Hints: get(hobject,'value') returns position of slider get(hobject,'min') and get(hobject,'max') to determine range of slider F = getimage(handles.axes2); prob = get(hobject,'value'); probabilitas = + prob /100 ; if probabilitas < 0 probabilitas > 1 error ('nilai probabilitas harus antara 0 sd 1'); [m, n] = size(f); G = double(f); && double membuat rentang nilai 01 for i=1 : m for j=1 : n nilai_acak = rand; if nilai_acak <= probabilitas/2 G(i,j) = 0; if(nilai_acak > probabilitas/2) && (nilai_acak <= probabilitas) G(i,j) = 255; && adalah kondisi untuk semua sama dan benar G = uint8(g); handles.gui.g = G; citranoise = G; guidata(hobject, handles) axes(handles.axes3); imshow(citranoise); set(handles.text10,'string',probabilitas*100); Executes during object creation, after setting all properties. function slider2_createfcn(hobject, eventdata, handles) hobject handle to slider2 (see GCBO) handles empty handles not created until after all CreateFcns called Hint: slider controls usually have a light gray background. if isequal(get(hobject,'backgroundcolor'), get(0,'defaultuicontrolbackgroundcolor')) set(hobject,'backgroundcolor',[.9.9.9]);
A6 Executes on button press in pushbutton3. function pushbutton3_callback(hobject, eventdata, handles) hobject handle to pushbutton3 (see GCBO) tic; I=getimage(handles.axes3); temp=i; [b k c]=size(temp); for x=1:1:b for y=1:1:k for z=1:1:c matriks(1,1)=temp(x1,y1,z); matriks(1,1)=0; matriks(1,2)=temp(x1,y,z); matriks(1,2)=0; matriks(1,3)=temp(x1,y+1,z); matriks(1,3)=0; matriks(2,1)=temp(x,y1,z); matriks(2,1)=0; matriks(2,2)=temp(x,y,z); matriks(2,2)=0; matriks(2,3)=temp(x,y+1,z); matriks(2,3)=0; matriks(3,1)=temp(x+1,y1,z); matriks(3,1)=0; matriks(3,2)=temp(x+1,y,z); matriks(3,2)=0; matriks(3,3)=temp(x+1,y+1,z); matriks(3,3)=0; filtered(x,y,z)=0; for i=1:3
A7 for j=1:3 filtered(x,y,z)=filtered(x,y,z)+matriks(i,j); arithmatik(x,y,z) = (filtered(x,y,z)/9); arithmatik=uint8(arithmatik); handles.gui.arithmatik = arithmatik; guidata(hobject, handles) axes(handles.axes4); imshow(arithmatik); toc; set(handles.text21,'string',toc); Executes on slider movement. function slider3_callback(hobject, eventdata, handles) hobject handle to slider3 (see GCBO) Hints: get(hobject,'value') returns position of slider get(hobject,'min') and get(hobject,'max') to determine range of slider tic; I=getimage(handles.axes4); temp=i; [b k c]=size(temp); for x=1:1:b for y=1:1:k for z=1:1:c matriks(1,1)=temp(x1,y1,z); matriks(1,1)=0; matriks(1,2)=temp(x1,y,z); matriks(1,2)=0; matriks(1,3)=temp(x1,y+1,z); matriks(1,3)=0; matriks(2,1)=temp(x,y1,z); matriks(2,1)=0; matriks(2,2)=temp(x,y,z); matriks(2,2)=0; matriks(2,3)=temp(x,y+1,z);
A8 matriks(2,3)=0; matriks(3,1)=temp(x+1,y1,z); matriks(3,1)=0; matriks(3,2)=temp(x+1,y,z); matriks(3,2)=0; matriks(3,3)=temp(x+1,y+1,z); matriks(3,3)=0; nilai = get(hobject,'value'); A = + nilai; H=(1/9)*[1 1 1; 1 8 1; 1 1 1]; K=[0 0 0; 0 1 0; 0 0 0]; HB= ((A1).*K) + H; for i = 1:3 for j = 1:3 sharpened(i,j)= matriks(i,j)*hb(i,j); sharpened=uint8(sharpened); filtered(x,y,z)=0; for i=1:3 for j=1:3 filtered(x,y,z)=filtered(x,y,z)+sharpened(i,j ); filtered=uint8(filtered); handles.gui.filtered = filtered; guidata(hobject, handles) set(handles.text11,'string',a); axes(handles.axes5); imshow(filtered); toc; set(handles.text16,'string',toc); Executes during object creation, after setting all properties. function slider3_createfcn(hobject, eventdata, handles) hobject handle to slider3 (see GCBO) handles empty handles not created until after all CreateFcns called Hint: slider controls usually have a light gray background.
A9 if isequal(get(hobject,'backgroundcolor'), get(0,'defaultuicontrolbackgroundcolor')) set(hobject,'backgroundcolor',[.9.9.9]); Executes on button press in pushbutton4. function pushbutton4_callback(hobject, eventdata, handles) hobject handle to pushbutton4 (see GCBO) gray = getimage(handles.axes2); noise = getimage(handles.axes3); citra_gray = double(gray); citra_noise = double(noise); [M N] = size(gray); error = citra_gray citra_noise; MSE = sum(sum(error.* error)) / (M * N); if(mse > 0) PSNR = 10*log(255*255/MSE) / log(10) PSNR = 99 set(handles.text12,'string',psnr); Executes on button press in pushbutton5. function pushbutton5_callback(hobject, eventdata, handles) hobject handle to pushbutton5 (see GCBO) gray = getimage(handles.axes2); noise = getimage(handles.axes3); citra_gray = double(gray); citra_noise = double(noise); [M N] = size(gray); error = citra_gray citra_noise; MSE = sum(sum(error.* error)) / (M * N) if(mse > 0) PSNR = 10*log(255*255/MSE) / log(10) PSNR = 99 set(handles.text13,'string',mse); Executes on button press in pushbutton6. function pushbutton6_callback(hobject, eventdata, handles) hobject handle to pushbutton6 (see GCBO) noise = getimage(handles.axes2); arithmetic = getimage(handles.axes4); citra_noise = double(noise); citra_arithmetic = double(arithmetic); [M N] = size(noise); error = citra_noise citra_arithmetic;
A10 MSE = sum(sum(error.* error)) / (M * N) if(mse > 0) PSNR = 10*log(255*255/MSE) / log(10) PSNR = 99 set(handles.text17,'string',psnr); Executes on button press in pushbutton7. function pushbutton7_callback(hobject, eventdata, handles) hobject handle to pushbutton7 (see GCBO) noise = getimage(handles.axes2); arithmetic = getimage(handles.axes4); citra_noise = double(noise); citra_arithmetic = double(arithmetic); [M N] = size(noise); error = citra_noise citra_arithmetic; MSE = sum(sum(error.* error)) / (M * N) if(mse > 0) PSNR = 10*log(255*255/MSE) / log(10) PSNR = 99 set(handles.text18,'string',mse); Executes on button press in pushbutton8. function pushbutton8_callback(hobject, eventdata, handles) hobject handle to pushbutton8 (see GCBO) arithmetic = getimage(handles.axes2); highboost = getimage(handles.axes5); citra_arithmetic = double(arithmetic); citra_highboost = double(highboost); [M N] = size(arithmetic); error = citra_arithmetic citra_highboost; MSE = sum(sum(error.* error)) / (M * N) if(mse > 0) PSNR = 10*log(255*255/MSE) / log(10) PSNR = 99 set(handles.text14,'string',psnr); Executes on button press in pushbutton9. function pushbutton9_callback(hobject, eventdata, handles) hobject handle to pushbutton9 (see GCBO) arithmetic = getimage(handles.axes2); highboost = getimage(handles.axes5); citra_arithmetic = double(arithmetic); citra_highboost = double(highboost); [M N] = size(arithmetic);
A11 error = citra_arithmetic citra_highboost; MSE = sum(sum(error.* error)) / (M * N) if(mse > 0) PSNR = 10*log(255*255/MSE) / log(10) PSNR = 99 set(handles.text15,'string',mse); Executes on button press in pushbutton10. function pushbutton10_callback(hobject, eventdata, handles) hobject handle to pushbutton10 (see GCBO) Executes on slider movement. function slider5_callback(hobject, eventdata, handles) hobject handle to slider5 (see GCBO) Hints: get(hobject,'value') returns position of slider get(hobject,'min') and get(hobject,'max') to determine range of slider F = getimage(handles.axes2); mu = 0; Nilai bawaan mu deviasi = get(hobject,'value'); sigma = + deviasi [m n p] = size(f); noise = double(f); for i=1 : m for j=1 : n for k=1 : p derau = randn * sigma + mu; G(i,j,k) = round(noise(i,j,k) + derau); if G(i,j,k) > 255 G(i,j,k) = 255; if G(i,j,k) < 0 G(i,j,k) = 0; G = uint8(g); ; ; ; ; handles.gui.g = G; citranoise = G; guidata(hobject, handles) axes(handles.axes3); imshow(citranoise); set(handles.text9,'string',sigma); Executes during object creation, after setting all properties. function slider5_createfcn(hobject, eventdata, handles) hobject handle to slider5 (see GCBO)
A12 handles empty handles not created until after all CreateFcns called Hint: slider controls usually have a light gray background. if isequal(get(hobject,'backgroundcolor'), get(0,'defaultuicontrolbackgroundcolor')) set(hobject,'backgroundcolor',[.9.9.9]); function Untitled_1_Callback(hObject, eventdata, handles) hobject handle to Untitled_1 (see GCBO) cover delete(handles.figure1) function Untitled_2_Callback(hObject, eventdata, handles) hobject handle to Untitled_2 (see GCBO) Help delete(handles.figure1) Executes on button press in pushbutton11. function pushbutton11_callback(hobject, eventdata, handles) hobject handle to pushbutton11 (see GCBO) [nama_file_simpan, path_simpan]=uiputfile(... {'*.jpg','(*.jpg)'; '*.*','Semua File(*.*)'},... 'Menyimpan Citra Hasil'); G=getimage(handles.axes5); imwrite(g,fullfile(path_simpan,nama_file_simpan),'jpg'); function Untitled_3_Callback(hObject, eventdata, handles) hobject handle to Untitled_3 (see GCBO) close; 3. Form Help function varargout = Help(varargin) HELP MATLAB code for Help.fig HELP, by itself, creates a new HELP or raises the existing singleton*.
A13 H = HELP returns the handle to a new HELP or the handle to the existing singleton*. HELP('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in HELP.M with the given input arguments. HELP('Property','Value',...) creates a new HELP or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before Help_OpeningFcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to Help_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 Help Last Modified by GUIDE v2.5 16Jul2014 13:43:48 Begin initialization code DO NOT EDIT gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Help_OpeningFcn,... 'gui_outputfcn', @Help_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); gui_mainfcn(gui_state, varargin{:}); End initialization code DO NOT EDIT Executes just before Help is made visible. function Help_OpeningFcn(hObject, eventdata, handles, varargin) This function has no output args, see OutputFcn. hobject handle to figure varargin command line arguments to Help (see VARARGIN) Choose default command line output for Help handles.output = hobject; Update handles structure guidata(hobject, handles);
A14 UIWAIT makes Help wait for user response (see UIRESUME) uiwait(handles.figure1); Outputs from this function are returned to the command line. function varargout = Help_OutputFcn(hObject, eventdata, handles) varargout cell array for returning output args (see VARARGOUT); hobject handle to figure Get default command line output from handles structure varargout{1} = handles.output; Executes on selection change in listbox2. function listbox2_callback(hobject, eventdata, handles) hobject handle to listbox2 (see GCBO) Hints: contents = cellstr(get(hobject,'string')) returns listbox2 contents as cell array contents{get(hobject,'value')} returns selected item from listbox2 Executes during object creation, after setting all properties. function listbox2_createfcn(hobject, eventdata, handles) hobject handle to listbox2 (see GCBO) 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'); function Untitled_1_Callback(hObject, eventdata, handles) hobject handle to Untitled_1 (see GCBO) cover delete(handles.figure1) function Untitled_2_Callback(hObject, eventdata, handles) hobject handle to Untitled_2 (see GCBO) Skripsi delete(handles.figure1)
A15 function Untitled_3_Callback(hObject, eventdata, handles) hobject handle to Untitled_3 (see GCBO) close;
B CURRICULUM VITAE Nama Alamat Sekarang Alamat Orang Tua : Lorent Oliver Barus : Jln. Bunga Cempaka No.51 UTR LK III Padang Bulan Medan : Jln. Bunga Cempaka No.51 UTR LK III Padang Bulan Medan Telp/Hp : 08566261664 Email : lorent_barus@yahoo.com Riwayat Pidikan SD Impres Medan dari Tahun 1998 s/d Tahun 2004 SMP Budi Murni 2 Medan dari Tahun 2004 s/d Tahun 2007 SMU Budi Murni 2 Medan dari Tahun 2007 s/d Tahun 2010 dari Tahun 2010 s/d Tahun 2014 Keahlian Bahasa : Bahasa Indonesia Bahasa Pemrograman : MATLAB