You are on page 1of 7

TUGAS 3

Pengolahan Citra

DOSEN : ROSIDA VIVIN NAHARI, S.Kom., M.T

OLEH :
Juhariyanto (150411100017)

PROGRAM STUDI TEKNIK INFORMATIKA


FAKULTAS TEKNIK
UNIVERSITAS TRUNOJOYO
2017
1. File Project

2. Hasil GUI (Sebelum RUN)


3. Source code

function varargout = Tugas3(varargin)


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Tugas3_OpeningFcn, ...
'gui_OutputFcn', @Tugas3_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

function Tugas3_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

guidata(hObject, handles);

function varargout = Tugas3_OutputFcn(hObject, eventdata, handles)


varargout{1} = handles.output;

function pushbutton2_Callback(hObject, eventdata, handles)


global a
[filename, pathname] = uigetfile('*.jpg','Pick an M-file');
if isequal(filename,0) || isequal(pathname,0)
disp('User pressed cancel')
else
a=imread(filename);
axes(handles.axes1);
imshow(a);
handles.a=a;
set(handles.Normal,'enable','on');
set(handles.FFT,'enable','on');
set(handles.DCT,'enable','on');
end
guidata(hObject, handles);
axes(handles.axes1);
imshow(a);

function FFT_Callback(hObject, eventdata, handles)


global a
global gray
gray =rgb2gray(a);
ftt = fft2(gray);
absolute = abs(ftt);
axes(handles.axes2);
imshow(absolute,[]);

function DCT_Callback(hObject, eventdata, handles)


global a
global gray
gray =rgb2gray(a);
dct = dct2(gray);
axes(handles.axes2);
imshow(dct);

function Normal_Callback(hObject, eventdata, handles)


global a
axes(handles.axes2);
imshow(a);
4. Hasil Run
a. Tampilan awal saat run

b. Tampilan saat pilih gambar atau Normal


c. Tampilan saat pilih FFT

d. Tampilan saat pilih DCT