function varargout = operations(varargin)
% OPERATIONS MATLAB code for operations.fig
% OPERATIONS, by itself, creates a new OPERATIONS or raises the existing
% singleton*.
%
% H = OPERATIONS returns the handle to a new OPERATIONS or the handle to
% the existing singleton*.
%
% OPERATIONS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in OPERATIONS.M with the given input arguments.
%
% OPERATIONS('Property','Value',...) creates a new OPERATIONS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before operations_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to operations_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 operations
% Last Modified by GUIDE v2.5 14-Apr-2021 16:12:14
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @operations_OpeningFcn, ...
'gui_OutputFcn', @operations_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 operations is made visible.
function operations_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 operations (see VARARGIN)
% Choose default command line output for operations
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% uiwait(handles.figure1);
% UIWAIT makes operations wait for user response (see UIRESUME)
% uiwait(handles.figure2);
% --- Outputs from this function are returned to the command line.
function varargout = operations_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;
%程序进入等待状态,等待用户的操作。当用户点击button时,程序会调用这个按钮的回调函数,对事件进行处理!
% varargout{1}=handles.im1;
% varargout{2}=handles.x0;
% varargout{3}=handles.y0;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (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 edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 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)
cla(handles.axes1,'reset');
cla(handles.axes2,'reset');
[FileName,PathName] = uigetfile('*.jpg;*.tif','Select the jpg-file','testfingerprinter');%FileName:返回的文件名,PathName:返回的文件的路径名,FilterIndex:选择的文件类型,FilterSpec:文件类型设置,DialogTitle:打开对话框的标题,DefaultName:默认指向的文件名
file=[PathName,FileName];
im1 = imread(file);
im1=imresize(im1,[256,256]);
axes(handles.axes1);%打开axes1的句柄 进行axes1的操作
imshow(im1);
title('指纹原图像');
handles.im1=im1;
set(gcf,'UserData',im1);
set(handles.pushbutton2,'enable','on');
guidata(hObject,handles);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cla(handles.axes2,'reset');
global x0;global y0;
im1=get(gcf,'UserData');
if isempty(im1)
errordlg('请输入指纹','警告');
return;
end
image_size=size(im1);
dimension=numel(image_size);%分辨im1是灰度图像还是彩色图像,如果dimension的维度是二维,是灰度图像。如果维度是三维,是彩色图像
if dimension==2
I=im2double(im1);%将矩阵数据类型转换成double型
% img_bw=gbfilter(I);
dk=daikuan(1.5);
[img_bw,gbfall]=gbfilter1(I,6,1,0,dk);
im2=normalize(gbfall);%归一化和切割
im3=derection_bw(im2);%二值化
[x0,y0]=centerpoint(im3);%求取指纹中心点(x0,y0)
end
if dimension==3
I=rgb2gray(im2double(im1));%将彩色图像转换成灰度图像
% img_bw=gbfilter(I);
dk=daikuan(1.5);
[img_bw,gbfall]=gbfilter1(I,6,1,0,dk);
im2=normalize(gbfall);%归一化和切割
im3=derection_bw(im2);%二值化
[x0,y0]=centerpoint(im3);
end
axes(handles.axes2);
imshow(im1);
title('指纹图像中心点');
hold on;plot(x0,y0,'ro');hold off;
handles.im1=im3;
handles.x0=x0;
handles.y0=y0;
set(gcf,'UserData',{I,x0,y0});
set(hObject,'enable','off');
guidata(hObject,handles);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(operations,'Visible','off');
global x0;global y0;global nameta;
global gama;global phi;global dk;
[gbfall,nameta,gama,phi,dk]=operations1;%调出子界面,运行完返回,将结果赋给Gabor滤波结果和nameta
axes(handles.axes2);
imshow(gbfall);
set(operations,'Visible','off');
title('Gabor滤波后');
hold on;plot(x0,y0,'ro');hold off;
guidata(hObject,handles);
set(gcf,'UserData',{gbfall,x0,y0});
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cla(handles.axes2,'reset');
X=get(gcf,'UserData');
if isempty(X)
errordlg('请输入指纹','警告');
return;
end
im4=X{1};
x0=X{2};
y0=X{3};
im5=derection_bw(im4);%二值化
axes(handles.axes2);
imshow(im5);
title('二值化后');
hold on;plot(x0,y0,'ro');hold off;
set(gcf,'UserData',{im5,x0,y0});
% --- Executes on button press in pushbutton4.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cla(handles.axes2,'reset');
X=get(gcf,'UserData');
if isempty(X)
errordlg('请输入指纹','警告');
return;
end
if iscell(X)
im5=X{1};
x0=X{2};
y0=X{3};
% im5=handles.im1;
% x0=handles.x0;
% y0=handles.y0;
theta0=LL

猰貐的新时代
- 粉丝: 1w+
- 资源: 3029
最新资源
- Ollama安装包Mac版
- 【人工智能比赛获奖源码】+【PyQt5混元大模型】+【桌面聊天应用】+【效率辅助工具】
- 三相VIENNA整流器Simulink仿真详解:输入电压与输出电压规格化设定,高效率与精准控制特性的系统分析展示,三相VIENNA整流技术详解:Simulink仿真分析与电路设计特点 输入220V
- 是德Keysight Infiniium MXR/EXR-Series Oscilloscopes使用说明书下载
- 按年龄和国家划分的全球平均人体身高.zip
- 《基于多时段动态电价策略优化电动汽车有序充电,实现电网负荷平衡与用户充电成本节约》,《基于多时段动态电价策略与粒子群算法的电动汽车有序充电优化》,《基于多时段动态电价的电动汽车有序充电策略优化》 平台
- LabVIEW与YOLOv5融合:多模型并行推理的ONNX Runtime封装DLL,支持视频、图片双模式CPU/GPU切换式识别,实现灵活选择高性价比推演模式,可迅速标注及高效训练,LabVIEW与
- Chatbox MAC安装包
- 质心侧偏角与横摆角速度相平面法在车辆动力学控制中的协调应用与程序实现,车辆动力学控制的质心侧偏角与横摆角速度相平面法研究及程序实现,相平面法,车辆动力学控制,协调控制使用,质心侧偏角-横摆角速度相平面
- IIS假死监视工具,发现假死就重启iis和释放程序池
- FPGA采集CameraLink相机Full模式解码输出方案:从输入到HDMI高清视频输出的实现流程,FPGA采集CameraLink相机Full模式解码输出实现方案:从相机输入到HDMI视频输出精细
- c++-继承与派生-例题源代码
- 【毕业设计参考】AVR寻迹小车.rar
- springcloud
- 波特兰建筑许可数据.zip
- Vuforia package-10-28-4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


