指纹增强程序Hong_enhancement

LinJM  @HQU

本算法是基于Lin Hong et al 的论文“Fingerprint ImageEnhancement: Algorithm and Performance Evaluation”编写而成。其中一个重要的假设就是:沿脊线垂直方向的灰度变化呈正弦波形

程序的流程如下所示:


0 Notation


O 是方向场F 是频率场 R 是区域标记


1 Normalization 

将原始图像的灰度值的均值和方差调整到所期望的均值和方差,减少沿脊和谷方向上的灰度级的变化。


img=imread('25_2.tif');
img=double(img);
figure,imshow(img./255)
[ht,wt] =   size(img);
m       =   mean(img(:));
v       =   var(img(:));
gmidx   =   find(img > m); 
lmidx   =   find(img <=m); m0=100;v0=100;
nimg(gmidx) = m0 + sqrt((v0*(img(gmidx)-m).^2)/v);
nimg(lmidx) = m0 - sqrt((v0*(img(lmidx)-m).^2)/v);
nimg        = reshape(nimg,[ht,wt]); 
figure,imshow(nimg./255)  


2 Orientation Image

方向场反映了指纹图像上纹线的方向,其准确性直接影响图像增强的效果。

(1):将图像划分为不重叠的子块(16×16)

(2):利用Sobel算子计算每个子块的像素点的梯度值。

(3):利用以下公式计算中心点在(i,j)的子块的脊线的方向值



其中是以像素θ(i,j)为中心的子块的局部脊线方向。由于指纹脊线方向变化缓慢,并在一个小范围内具有相对稳定的变化趋势。因此可采用高斯低通滤波器进行平滑处理。

dbg_show_orientation=1;
img=imread('6_2.tif');
img=double(img);
% figure,imshow(img./255)
hy  = fspecial('sobel');
hx  = hy';
gx = imfilter(img,hx,'same','symmetric');
gy = imfilter(img,hy,'same','symmetric');
g   = gx+i*gy;  
gblk=blkproc(g.^2,[10 10],inline('sum(sum(x))'));
oimg    = 0.5*angle(gblk)+pi/2;
[blkht,blkwt]   =   size(oimg)
%smoothen_orientation_field
g =   cos(2*oimg)+i*sin(2*oimg);
g =   imfilter(g,fspecial('gaussian',5));
oimg=   0.5*angle(g);
if(dbg_show_orientation) 
quiver(cos(oimg),sin(oimg)); 
axis ij;axis image; 
axis([0 blkwt 0 blkht]); 
title('Orientation Image'); pause; 
end; 

3 Ridge Frequency Image

  在指纹图像的局部非奇异区域里,沿着垂直于脊线的方向看,指纹脊线和谷线像素点灰度值大致形成一个二维的正弦波,定义纹线频率为相邻的两个波峰或波谷之间的像素点数的倒数。

(1):将图像划分为不重叠的子块(16×16)

(2):以图像子块中心点(i,j)为中心,子块脊线方向为短轴,作一个尺寸为的长方形窗口,如图所示:在窗口中按如下公式计算幅值X[K]






更多相关资源请关注 博客:LinJM-机器视觉  微博:林建民-机器视觉


  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
指纹增强-指纹增强.rar 有一位论坛朋友寻找的关于一篇经典指纹增强文章的源代码: 帖子如下(含文章): https://www.ilovematlab.cn/thread-74316-1-1.html 这个源程序的一个实例:介绍一下怎么应用 clear clc im = imread; if length)>2     im=rgb2gray; end         % Identify ridge-like regions and normalise image     blksze = 16; thresh = 0.1;     [normim, mask] = ridgesegment;     show;     % Determine ridge orientations     [orientim, reliability] = ridgeorient;     plotridgeorient     show 1.jpg 2.jpg 3.jpg                            原图                                                                    Orientations overlaid                                        'Reliability' of orientations                                   % Determine ridge frequency values across the image     blksze = 36;     [freq, medfreq] = ridgefreq;     show                                 Frequency data          % Actually I find the median frequency value used across the whole    % fingerprint gives a more satisfactory result...       freq = medfreq.*mask;         % Now apply filters to enhance the ridge pattern    newim = ridgefilter;    show;                                 Filtered image             % Binarise, ridge/valley threshold is 0    binim = newim > 0;    show;                                 Binary image         % Display binary image for where the mask values are one and where    % the orientation reliability is greater than 0.5    show, 7)                                 Masked binary image                                 Original image 程序包如下: 指纹增强.rar 程序包含: QQ截图未命名.jpg

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值