指纹识别算法
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
function fpextractdemo(action, varargin)
% FPEXTRACTDEMO 指纹特征提取演示程序
% Modified by PRTsinghua@
%
% 输入图像必须是256×256的灰度图
% 8-bit灰度级的图像 @ 500 dpi.
% 如果这些条件不满足,一些函数中的参数必须做相应的改变
%
%
% 选项:
% - Centralize: 二值化图像,计算中心点
% - Crop: 图像修剪
% - Sectorize: 可视化扇形
% - Normalize: 归一化输入图像
% - Gabor filters: 可视化Gabor滤波器
% - Convolute: 计算输入图像和Gabor滤波器的convolution
% - Features: 特征可视化
% - FingerCode: 在数据库中加入该指纹
% - Check: 指纹匹配
%
%
% 指纹识别中一个至关重要的步骤就是中心点的确定。如果剪切指纹图像时出现了任何
% 错误,你可以使用辅助的m文件"vedicentro.m":它使得输入指纹可视化并计算指纹
% 中心,借助于m函数 "centralizing.m"。
%
% 在MATLAB的命令行提示中输入 "fpextractdemo" 运行程序
%--------------------------------------------------------------------------
if nargin<1,
action='InitializeFPEXTRACTDEMO';
end;
feval(action,varargin{:})
return;
%%%
%%% 子函数 - InitializeFPEXTRACTDEMO
%%%
function InitializeFPEXTRACTDEMO()
% 如果 fpextractdemo 已经在运行,将之转到前台
h = findobj(allchild(0), 'tag', 'Extracting FingerPrint Features Demo ( Modified by PRTsinghua@ v) ');
if ~isempty(h)
figure(h(1))
return
end
screenD = get(0, 'ScreenDepth');
if screenD>8
grayres=256;
else
grayres=128;
end
FpextractDemoFig = figure( ...
'Name','指纹特征提取演示程序 Modified by PRTsinghua@', ... 'NumberTitle','off', 'HandleVisibility', 'on', ...
'tag', '指纹特征提取演示程序', ...
'Visible','off', 'Resize', 'off',...
'BusyAction','Queue','Interruptible','off', ...
'Color', [.8 .8 .8], ...
'IntegerHandle', 'off', ...
'Colormap', gray(grayres));
figpos = get(FpextractDemoFig, 'position');
figpos(3:4) = [1024 525];
% Adjust the size of the figure window
horizDecorations = 10; % 调整大小.
vertDecorations = 45; % 标题栏.
screenSize = get(0,'ScreenSize');
dx = screenSize(3) - figpos(1) - figpos(3) - horizDecorations;
dy = screenSize(4) - figpos(2) - figpos(4) - vertDecorations;
if (dx < 0)
figpos(1) = max(5,figpos(1) + dx);
end
if (dy < 0)
figpos(2) = max(5,figpos(2) + dy);
end
set(FpextractDemoFig, 'position', figpos);
rows = figpos(4);
cols = figpos(3);
% Colors
bgcolor = [0.45 0.45 0.45]; % 背景颜色
wdcolor = [.8 .8 .8]; % Window 颜色
fgcolor = [1 1 1]; % 文本
hs = (cols-(6*175)) / 5; % 水平间隔
vs = (rows)/8; % 垂直间隔
%==================================== % 所有菜单和按钮的参数
Std.Interruptible = 'off';
Std.BusyAction = 'queue';
% Defaults for image axes
Ax = Std;
Ax.Units = 'Pixels';
Ax.Parent = FpextractDemoFig;
Ax.ydir = 'reverse';
Ax.XLim = [.5 128.5];
Ax.YLim = [.5 128.5];
Ax.CLim = [0 1];
Ax.XTick = [];