📄 cubs_visualize_template.m
字号:
%--------------------------------------------------------------------------
% Version 1.0 March 2005
% Copyright (c) 2005-2010 by Center for Unified Biometrics and Sensors
% www.cubs.buffalo.edu
%
%cubs_visualize_template
%displays the minutiae on the fingerprint image
%syntax:
%cubs_visualize_template(fname)
%fname - file name (only .fp files accepted)
%Contact:
% ssc5@eng.buffalo.edu
% www.eng.buffalo.edu/~ssc5
%Reference:
%S. Chikkerur,C. Wu and Govindaraju, "A Systematic approach for
%feature extraction in fingerprint images",ICBA 2004
%T. Jea and V. Govindaraju, "A Minutia-Based Partial Fingerprint Recognition System",
%to appear in Pattern Recognition 2005
%--------------------------------------------------------------------------
function cubs_visualize_template(fname)
img = [];
img_loaded = 0;
x = [];
y = [];
t = [];
%-------------------------
%open file
%-------------------------
fid = fopen(fname,'r');
if(fid <0)
fprintf(2,'Unable to load file %s\n',fname);
return;
end;
%-------------------------
%parse file
%-------------------------
s = fscanf(fid,'%s',[1]);
while(~feof(fid))
%-------------------------
%parse file
%-------------------------
if(strcmp(s,'[image_file]'))
%read the number
fscanf(fid,'%d',[1 1]);
%read the file name
fname = fscanf(fid,'%s',[1 1]);
img = imread(fname);
if(~isempty(img))
img_loaded = 1;
end;
elseif(strcmp(s,'[minutiae]'))
%read the number
mcnt = fscanf(fid,'%d',[1 1]);
%read the minutiae
for i = 1:mcnt
x(i) = fscanf(fid,'%d',[1 1]);
y(i) = fscanf(fid,'%d',[1 1]);
t(i) = fscanf(fid,'%d',[1 1]);
s = fgets(fid); %read the rest of the line
end;
end;
s = fscanf(fid,'%s',[1 1]);
end;
fclose(fid);
%-------------------------
%display the image
%-------------------------
if(img_loaded)
imagesc(img),colormap('gray'),axis('image');axis('ij'),axis('off');
end;
hold on;
%-------------------------
%display the minutiae
%-------------------------
h = scatter(x,y,'o','r');
%set(h,'LineWidth',2);
t = t*pi/180;
for i = 1:mcnt
h = line([x(i),x(i)+15*cos(t(i))],[y(i),y(i)+15*sin(t(i))]);
%set(h,'LineWidth',2);
set(h,'Color','red');
end;
title(fname);
hold off;
%end cubs_visualize_template
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -