Professional Documents
Culture Documents
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = laplacian_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)
h = rot90(kernel, 2);
center = floor((size(h)+1)/2);
left = center(2) - 1;
right = n - center(2);
top = center(1) - 1;
bottom = m - center(1);
B = zeros(r , c);
for x = 1 : r
for y = 1 : c
for i = 1 : m
for j = 1 : n
q = x - 1;
w = y -1;
B(x, y) = B(x, y) + (Rep(i + q, j + w) * h(i, j));
end
end
end
end
% --- 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)
project=guidata(gcbo);
[namafile,direktori]= uigetfile({'*.jpg';'*.bmp';'*.png';'*.tif'},'Buka
Gambar');
if isequal(namafile,0)
return;
end
eval(['cd ''' direktori ''';']);
I=imread(namafile);
set(project.figure1,'CurrentAxes',project.axes1);
set(imshow(I));
set(project.figure1,'Userdata',I);
set(project.axes1,'Userdata',I);
%FILTER LAPLACIAN
%ARRAY BISA DI INPUT
array11 = str2double(char(get(handles.edit11,'String')));
array12 = str2double(char(get(handles.edit12,'String')));
array13 = str2double(char(get(handles.edit13,'String')));
array21 = str2double(char(get(handles.edit21,'String')));
array22 = str2double(char(get(handles.edit22,'String')));
array23 = str2double(char(get(handles.edit23,'String')));
array31 = str2double(char(get(handles.edit31,'String')));
array32 = str2double(char(get(handles.edit32,'String')));
array33 = str2double(char(get(handles.edit33,'String')));
%IMAGE LAPLACIAN
%uint8 itu unsigned integer 8 , yang artinya nilai max 255 dan min
0
imgconv = uint8(konvolusi(grayimage, lap));
end
%TAMPILKAN OUTPUT
set(project.figure1,'CurrentAxes',project.axes2);
set(imshow(imgconv));
set(project.axes2,'Userdata',imgconv);
end
hasil