0
点赞
收藏
分享

微信扫一扫

【指纹识别】基于模板匹配算法指纹识别匹配门禁系统matlab源码

Python百事通 2022-01-16 阅读 53

一、简介

模型参考这里。

二、源代码

function varargout = gui1(varargin)
% GUI1 MATLAB code for gui1.fig
%      GUI1, by itself, creates a new GUI1 or raises the existing
%      singleton*.
%
%      H = GUI1 returns the handle to a new GUI1 or the handle to
%      the existing singleton*.
%
%      GUI1('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI1.M with the given input arguments.
%
%      GUI1('Property','Value',...) creates a new GUI1 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before gui1_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to gui1_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 gui1
 
% Last Modified by GUIDE v2.5 19-May-2018 10:57:01
 
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @gui1_OpeningFcn, ...
                   'gui_OutputFcn',  @gui1_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 gui1 is made visible.
function gui1_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 gui1 (see VARARGIN)
% Choose default command line output for gui1
handles.output = hObject;
A=imread('指纹3.jpg');
set(handles.pushbutton1,'CData',A);
B=imread('指纹19.jpg');
set(handles.pushbutton3,'CData',B);
 
C=imread('指纹18.jpg');
set(handles.pushbutton7,'CData',C);
 
D=imread('指纹6.jpg');
set(handles.pushbutton4,'CData',D);
 
E=imread('指纹17.jpg');
set(handles.pushbutton5,'CData',E);
 
F=imread('指纹5.jpg');
set(handles.pushbutton8,'CData',F);
 
G=imread('指纹8.jpg');
set(handles.pushbutton9,'CData',G);
% ha=axes('units','normalized','position',[0 0 1 1]);
% uistack(ha,'down')
% II=imread('动态图片2.jpg');%里面的参数可以是你自己的图片,把名字连同格式写进去就可以了
% image(II)
% colormap gray
% set(ha,'handlevisibility','off','visible','off');
 
guidata(hObject, handles);
 
% UIWAIT makes gui1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
 
 
% --- Outputs from this function are returned to the command line.
function varargout = gui1_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 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)
hfigure2=Fingerprint_gui();
handles.hfigure2=hfigure2;
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)
function out = thinning2(in);
 
%thinning process obtain a one pixel wide image skeleton
% use function n_sum and t_sum
 
[w,h] = size(in);
 
out = in;
 
for i= 3:h-2
for j= 3:w-2
 
        if out(i,j) == 1
 
                if 1 < n_sum(i,j,out) &  n_sum(i,j,out) < 7 
                        if  t_sum(i,j,out) == 2
                                 if or ( and_157(i,j,out) == 0  , t_sum(i,j-1,out) ~= 2 )
                                         if or (and_357(i,j,out) == 0  , t_sum(i+1,j,out) ~=2 )   
                                     %        if and_157(i,j,out) == 0
                                     % if  and_357(i,j,out) == 0   
                                                out(i,j) = 0;
                                        else
                                                out(i,j) = 1;
                                        end;
                                else
                                        out(i,j) = 1;
                                end;
                        else
                               
 
                        end;
                end;

三、运行结果

在这里插入图片描述

四、参考文献

[1]王崇文, 李见为, 周宏文,等. 指纹识别系统的设计与实现[J]. 计算机应用, 2001(12):63-65.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

举报

相关推荐

0 条评论