function varargout = FingerPrintGUI(varargin)
% FINGERPRINTGUI M-file for FingerPrintGUI.fig
% FINGERPRINTGUI, by itself, creates a new FINGERPRINTGUI or raises the existing
% singleton*.
%
% H = FINGERPRINTGUI returns the handle to a new FINGERPRINTGUI or the handle to
% the existing singleton*.
%
% FINGERPRINTGUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FINGERPRINTGUI.M with the given input arguments.
%
% FINGERPRINTGUI('Property','Value',...) creates a new FINGERPRINTGUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before FingerPrintGUI_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to FingerPrintGUI_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 FingerPrintGUI
% Last Modified by GUIDE v2.5 20-Aug-2007 14:50:00
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @FingerPrintGUI_OpeningFcn, ...
'gui_OutputFcn', @FingerPrintGUI_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
% --- Executes just before FingerPrintGUI is made visible.
function FingerPrintGUI_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 FingerPrintGUI (see VARARGIN)
% Choose default command line output for FingerPrintGUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes FingerPrintGUI wait for user response (see UIRESUME)
% uiwait(handles.FingerPrintGUI);
set(handles.Binarize,'enable','off');
set(handles.AutomaticBW,'enable','off');
set(handles.ManualBW,'enable','off');
set(handles.Thining,'enable','off');
set(handles.FindMinutia,'enable','off');
set(handles.RemoveFalseMinutia,'enable','off');
set(handles.RegionOfInterest,'enable','off');
set(handles.ManualROI,'enable','off');
set(handles.AutomaticROI,'enable','off');
set(handles.Orientation,'enable','off');
set(handles.Validation,'enable','off');
set(handles.OriginalImage,'enable','off');
set(handles.Skeleton,'enable','off');
set(handles.Termination,'enable','off');
set(handles.Bifurcation,'enable','off');
set(handles.ExportMinutia,'enable','off');
% --- Outputs from this function are returned to the command line.
function varargout = FingerPrintGUI_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 Skeleton.
function Skeleton_Callback(hObject, eventdata, handles)
% hObject handle to Skeleton (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 Skeleton
if get(hObject,'value')==1
set(handles.OriginalImage,'value',0)
set(handles.WhiteImage,'value',0)
end
% --- Executes on button press in OriginalImage.
function OriginalImage_Callback(hObject, eventdata, handles)
% hObject handle to OriginalImage (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 OriginalImage
if get(hObject,'value')==1
set(handles.WhiteImage,'value',0)
set(handles.Skeleton,'value',0)
end
% --- Executes on button press in WhiteImage.
function WhiteImage_Callback(hObject, eventdata, handles)
% hObject handle to WhiteImage (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 WhiteImage
if get(hObject,'value')==1
set(handles.OriginalImage,'value',0)
set(handles.Skeleton,'value',0)
end
% --- Executes on button press in radiobutton7.
function radiobutton7_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton7 (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 radiobutton7
% --- Executes on button press in Termination.
function Termination_Callback(hObject, eventdata, handles)
% hObject handle to Termination (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 Termination
% --- Executes on button press in Bifurcation.
function Bifurcation_Callback(hObject, eventdata, handles)
% hObject handle to Bifurcation (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 Bifurcation
% --- Executes on button press in Binarize.
function Binarize_Callback(hObject, eventdata, handles)
% hObject handle to Binarize (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=getappdata(handles.FingerPrintGUI,'OriginalImage');
if get(handles.ManualBW,'value')==1
Threshold=str2num(get(handles.Threshold,'string'));
BinarizedImage=I(:,:,1)>Threshold;
else
BinarizedImage=I(:,:,1)>160;
end
setappdata(handles.FingerPrintGUI,'BinarizedImage',BinarizedImage);
set(handles.Thining,'enable','on')
axes(handles.axes1)
image(255*BinarizedImage),colormap(gray)
set(gca,'tag','axes1')
function Threshold_Callback(hObject, eventdata, handles)
% hObject handle to Threshold (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Threshold as text
% str2double(get(hObject,'String')) returns contents of Threshold as a double
% --- Executes during object creation, after setting all properties.
function Threshold_CreateFcn(hObject, eventdata, handles)
% hObject handle to Threshold (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit 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 RegionOfInterest.
function RegionOfInterest_Callback(hObject, eventdata, handles)
% hObject handle to RegionOfInterest (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=getappdata(handles.FingerPrintGUI,'Ori