Gabor filter fingerprint image enhancement

Status
Not open for further replies.

apdd

Newbie level 6
Joined
Jun 19, 2013
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,363
Hi,
Please help me to download following file for fingerprint image enhancement using gabor filter.

en*pudn*com/downloads115/doc/fileformat/detail486871_en*html

Or any other resource for matlab code if available.



I have written following code but not getting desired result.



clc; clear all; %close all;
[filename,pathname] = uigetfile('*.*','Pick an input image');
im=imread(strcat(pathname,filename));
[a,b]=ridgefreq_g(im,32,5,5,15);% compute frequency image
% [fb,ang1]=gabor_bank(8,4,4,b);
orient=thetaij(im); % orientation image 0 to pi.
mask=seg_fp_image_fun(im);
% [rows,cols]=size(im);
blksze=25;
orient1=padarray(orient,[12 12],0,'both');
im1=double(padarray(im,[12 12],0,'both'));
[rows,cols]=size(orient1);
out=zeros(rows,cols);

for r=13:rows-blksze
for c=13:cols-blksze
total=0;
gb=gabor_fn(4,4,orient1(r,c),b);% b is the median frequency of image
for i=-12:12
for j=-12:12

total=total+gb(i+13,j+13).*im1(r-i,c-j);

end
end

out(r,c)=total;%total
[r ,c]
end
end
***************************
function gb=gabor_fn(sigma_x,sigma_y,theta,freq)
% Sigma_x and Sigma_y must be integers
% For fingerprint enhancement, sigma_x and sigma_y should be the half of the wave length
% (1/(2*Freq)
sz_x=6*sigma_x+1;
sz_y=6*sigma_y+1;

[x y]=meshgrid(-fix(sz_x/2):fix(sz_x/2),fix(-sz_y/2):fix(sz_y/2));

% Rotation
x_theta=x*cos(theta)+y*sin(theta);
y_theta=-x*sin(theta)+y*cos(theta);

gb=exp(-.5*(x_theta.^2/sigma_x^2+y_theta.^2/sigma_y^2)).*cos(2*pi*freq*x_theta);
end
 

hi, issue resolved by replacing gb=gabor_fn(4,4,orient1(r,c),b); with
gb=gabor_fn(4,4,orient1(r,c)-pi/2,b);

but problem is to enhance single image it takes 3 minutes

please if anyone have matlab code for fingerprint enhancement using gabor filter do share with me.

Thanks
 

preinitialize ur matrix with zeros with the row and col size dimensions...this would reduce the time taken by ur code while allocating memory....
 
Reactions: apdd

    apdd

    Points: 2
    Helpful Answer Positive Rating
I think I have done this with command out=zeros(rows,cols); on 13th row..
Or u r suggesting something else????


preinitialize ur matrix with zeros with the row and col size dimensions...this would reduce the time taken by ur code while allocating memory....
 

I think I have done this with command out=zeros(rows,cols); on 13th row..
Or u r suggesting something else????

i am saying you need to iniatialize memory allocation..if your final image or input image is 512x512 then do as img=zeros[512,512]..so this means you are initializing memory to the image and the output can be stored into this memory easily instead of matlab taking time to initialize memory..if you see in C,C++ or opencv people need to initialize memory first inorder to store the image.

i do not know if your doing memory allocation.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…