FP difficult problem:Due to large variability in different impression of the same finger.
Three FP **matching approache**s:
1. Correlation based (ridge line flow pattern)
2. Minutae based (minute details)
3. Ridge feature based (intra-ridge details)
Singularities:
1.Loop;————The northmost loop called Core(Not all fingerprints have a core (Arch type fingerprints)
2.Delta;
3.whorl(two facing loop)
1.Compute the orientation field of a fingerprint image
Use Rao’s algorithm,based on local features gradient
(I)Estimation of Orientation Field
step 1. Smooth the input image use mean filter or Sobel operator
step 2. Compute the gradients Gx and Gy at each pixel in image(use gradient function)
step 3. Divide the fingerprint image into blocks of size W *W,so that it will be easy and more precise
step 4. Estimate the local orientation of each block using the
following formula:
ps:
where W is the size of the block, and Gx and Gy are!
the gradient magnitudes in x and y directions, respectively.
step 5. after computer each block ,use quiver function to draw the orientation of the current block,based on the theta and magnitude and then move to the next block till the end.
How to run:
Load the fp_files and fp.m to the matlab workspace in the same directory,then run the program.
besides if you want to change the fingerprint images,you need change the image’s name in line 3.
if you want to change the block size w,in line 36.(like w= 9,11,13,15)!
if you think the arrows is not proper,you can change the quiver function scale value MAG(i,j)/4,in line 74!
(like quiver(j,i,cos(Theta(i,j)),sin(Theta(i,j)),MAG(i,j)/2,’r’,’maxheadsize’,1.3);
2.Using the orientation image calculated in the first question, implement the singularity detection technique using the irregularity measure.
First: use the orientation theta to calculate the the consistency level of the orientation field in the local neighborhood of a block (i, j) with the following formula:
Second compute the Dij in each block use formula,the Rij is the consistency
Then compute the irregularity
Run and Result:
Code is in the below:
Matlab Code:
clear;clc;
close all;
A=imread('fp_images/5001.pgm');
[len,wid]=size(A);
%[,columns]=size(A);
imshow(A);
hold on
%sobelx=[-1 0 1;-2 0 2;-1 0 1];
%hx=[0 0 0,0 1 0,0 0 0];
%sobely=[-1 -2 -1;0 0 0;1 2 1];
%B=imfilter(A,sobelx,'REPLICATE');
%B=imfilter(A,sobelx);
%figure
%imshow(B,[]);
%hold on
%C1=imfilter(B,sobely,'REPLICATE');
%C=imfilter(B,sobely);
%hold on;
%[dx,dy]=gradient(double(A));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%filt the image
h=fspecial('average',3);
C=uint8(round(filter2(h,A)));
%figure
%imshow(C,[]);
%hold on
%figure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%computer the gradient x, y;
[dx,dy]=gradient(double(C));
Theta=zeros(len,wid);
MAG=zeros(len,wid);
DMATX=zeros(len,wid);
DMATY=zeros(len,wid);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%divide the image in to block each size w*w;
w=13;
a=round(w/2);
for i=a:w:(len-a+1)
for j=a:w:(wid-a+1)
MATX=zeros(w,w);
MATY=zeros(w,w);
sq=0;
for m=1:w
for n=1:w
MATX(m,n)=dx(i-a+m,j-a+n);
MATY(m,n)=dy(i-a+m,j-a+n);
mx=MATX(m,n);
my=MATY(m,n);
sq=(mx^2+my^2)^0.5+sq;
%t=2*MATX(m,n)*MATY(m,n)+t;
%s=MATX(m,n)^2-MATY(m,n)^2+s;
end
end
t1=MATX.*MATY;
t=2*sum(t1(:));
s1=MATX.^2-MATY.^2;
s=sum(s1(:));
MAG(i,j)=sq/w/w;
if s==0||t==0;
Theta(i,j)=pi/2;
%quiver(i,j,1,0);
else
Theta(i,j)=1/2*atan(t/s);
end
if ((Theta(i,j)<0&&t<0)||(Theta(i,j)>=0&&t>0))
Theta(i,j)=Theta(i,j)+pi/2;
elseif (Theta(i,j)<0&&t>=0)
Theta(i,j)=Theta(i,j)+pi;
elseif (Theta(i,j)>=0)&&(t<=0)
end
%%%draw the arrow of the current block
quiver(j,i,cos(Theta(i,j)),sin(Theta(i,j)),MAG(i,j)/2,'r','maxheadsize',1.3);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%compute Rij Dij
rw=w;%11
RD=3;
R=zeros(len,wid);
ra=round(rw/2);
N=RD^2;
for i=ra+(RD-1)/2*rw:rw:(len-ra+1-(RD-1)/2*rw)
for j=ra+(RD-1)/2*rw:rw:(wid-ra+1-(RD-1)/2*rw)
rc=0;
for m=1:RD
for n=1:RD
%rc=(Theta(i+(m-1-(RD-1)/2)*rw,j+(n-1-(RD-1)/2)*rw)-Theta(i,j))^2+rc;
temp=(Theta(i+(m-1-(RD-1)/2)*rw,j+(n-1-(RD-1)/2)*rw)-Theta(i,j));
if(mod((temp+2*pi),2*pi)>=pi)
temp=abs(temp)-pi;
else
temp=abs(temp);
end
rc=temp^2+rc;
end
end
%%%%%Rij
R(i,j)=double(((sqrt(rc))/N));
%%%%%%Dij
DMATX(i,j)=R(i,j)*cos(2*Theta(i,j));
DMATY(i,j)=R(i,j)*sin(2*Theta(i,j));
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%computer Irregularity IRRij
irrw=w;%11
irrD=3;
IRR=zeros(len,wid);
irra=round(irrw/2);
%N=RD^2;
for i=irra+irrw+(irrD-1)/2*irrw:irrw:(len-irra+1-irrw-(irrD-1)/2*irrw)
for j=irra+irrw+(irrD-1)/2*irrw:irrw:(wid-irra+1-irrw-(irrD-1)/2*irrw)
V=zeros(1,2);
sq=0;
tx=0;
ty=0;
for m=1:irrD
for n=1:irrD
%MAT=cell2mat(DMAT{i-ia+m,j-ia+n});
%=MAT(1,1)
tx=DMATX(i+(m-1-(irrD-1)/2)*irrw,j+(n-1-(irrD-1)/2)*irrw);
ty=DMATY(i+(m-1-(irrD-1)/2)*irrw,j+(n-1-(irrD-1)/2)*irrw);
V(1,1)=tx+V(1,1);
%V(1,2)=DMATY(i-ia+m,j-ia+n)+V(1,2);
V(1,2)=ty+V(1,2);
%sq=sqrt(DMATX(i-ia+m,j-ia+n)^2+DMATY(i-ia+m,j-ia+n)^2)+sq;
sq=sqrt(tx^2+ty^2)+sq;
end
end
IRR(i,j)=(double((sqrt(V(1,1)^2+V(1,2)^2))/sq));
end
end
%%%%%%%%%%%%%%%%%%%%%%%%refill the block which point is locate then imshow
ID=w;
iia=round(ID/2);
map=ones(len,wid);
for i=iia+2*ID:ID:(len-iia+1-2*ID)
for j=iia+2*ID:ID:(wid-iia+1-2*ID)
for m=1:ID
for n=1:ID
map((i+m-iia),(j+n-iia))=IRR(i,j);
end
end
end
end
figure
axis ij
%map = imrotate(map,pi);
map(find(isnan(map)==1))=1;
imshow(map,[]);
hold on
Reference:
http://www.academia.edu/2508972/A_review_on_fingerprint_orientation_estimation_methods
http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=587996&tag=1