Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
% --- Executes just before segmentasi is made visible. function segmentasi_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn.
% % % %
handle to figure reserved - to be defined in a future version of MATLAB structure with handles and user data (see GUIDATA) command line arguments to segmentasi (see VARARGIN)
% Choose default command line output for segmentasi handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes segmentasi wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = segmentasi_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 openfile. function openfile_Callback(hObject, eventdata, handles) [filename, pathname] = uigetfile('*.jpg; *.png; *.bmp', 'Input Gambar','F:\ARIF'); if isequal(filename,0) || isequal(pathname,0) disp('user cancel'); else axes(handles.axes2); im = imread(filename); imshow(im); save 'F:\ARIF\imdata.mat' im; end function im = segment(im) imbw = im2bw(im); id = find(imbw == 0); imR = im(:, :, 1); imG = im(:, :, 2); imB = im(:, :, 3); imR(id) = imR(id)/4; imG(id) = imG(id)/4; imB(id) = imB(id)/4; im(:,:,1) = imR; im(:,:,2) = imG; im(:,:,3) = imB; % --- Executes on button press in segmentasi. function segmentasi_Callback(hObject, eventdata, handles) load 'F:\ARIF\imdata.mat' im;