⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cubs_visualize_template.m

📁 finger print toolboox based on matlab
💻 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@cubs.buffalo.edu, sharat@mit.edu
%   http://www.sharat.org
%Reference:
%1. S. Chikkerur, C.Wu and V. Govindaraju, "Systematic approach for feature
%extraction in Fingerprint Images", ICBA 2004
%2. S. Chikkerur and V. Govindaraju, "Fingerprint Image Enhancement using 
%STFT Analysis", International Workshop on Pattern Recognition for Crime 
%Prevention, Security and Surveillance, ICAPR 2005
%3. S. Chikkeur, "Online Fingerprint Verification", M. S. Thesis,
%University at Buffalo, 2005
%4. T. Jea and V. Govindaraju, "A Minutia-Based Partial Fingerprint Recognition System", 
%to appear in Pattern Recognition 2005
%5. S. Chikkerur, "K-plet and CBFS: A Graph based Fingerprint
%   Representation and Matching Algorithm", submitted, ICB 2006
%6. 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 + -