A list,
Fingerprint recognition technology is divided into three steps: fingerprint pretreatment, feature extraction, fingerprint classification and matching.
Both fingerprint classification and fingerprint matching need to extract effective features of fingerprint, and the performance of feature extraction largely depends on the quality of fingerprint image. In practical application, due to the factors of acquisition conditions and acquisition equipment, the quality of fingerprint image collected is poor, which is easy to cause many problems and affect the effect of subsequent processing. Therefore, fingerprint image preprocessing is a key to the performance of fingerprint recognition system.
Pretreatment is mainly divided into the following four steps:
Gray level normalization and equalization of fingerprint image
The purpose of normalization is to eliminate the gray difference caused by sensor noise and finger pressure in the process of fingerprint collection, adjust the contrast and gray of fingerprint image to a fixed level, and provide a relatively unified image specification for subsequent processing. Equalization is to expand the gray level with more pixels in the image and reduce the gray level with less pixels.
Fingerprint image segmentation
According to the need of feature extraction, the aim is to separate the poor quality of fingerprint image regions which are difficult to recover in the subsequent processing from the effective region, so that the subsequent processing can focus on the effective region; It can improve the accuracy of feature extraction. It can greatly reduce the time of fingerprint pretreatment.
Binarization of fingerprint image
The purpose of binarization is to transform gray fingerprint image into binary image with 0 and 1 values
Binarization post processing and refinement
Due to the incompleteness of gray filtering and the introduction of new noises in the process of binarization, it is necessary to filter the image. The weighted median filtering method is adopted, and different weight templates are selected according to the different directions of the foreground points, so as to eliminate the holes and gaps on the grain lines. After binarization, the grain line still has a certain width, which needs to be refined into a skeleton of a single pixel width. There are many thinning algorithms, and skeleton extraction technology is used here.
No more nonsense, paste code and effect.
Ii. Source code
clc; close all; Global immagine n_bands h_bands n_arcs h_radius h_lato n_sectors matrice num_disk % Immagine double - precision gray scale map n_bands=4;
h_bands=20;
n_arcs=16;
h_radius=12;
h_lato=h_radius+(n_bands*h_bands*2) +16;
if mod(h_lato,2)= =0
h_lato=h_lato- 1; end n_sectors=n_bands*n_arcs; % How many rows of data matrice=zeros(h_lato);for ii=1:(h_lato*h_lato)
matrice(ii)=whichsector(ii);
end
num_disk=8; %8Direction %1--> add database
% 0--> recognition
% ok=0;
chos=0;
possibility=6; % there6The menus are respectively'Select image and add to database'.'Fingerprint identification'.'Delete database'.'Visual fingerprint Image'.'Visual Gabor Filtering'.'exit'
messaggio='Insert the number of set: each set determins a class. This set should include a number of images for each person, with some variations in expression and in the lighting.';
while chos~=possibility,
chos=menu('Fingerprint Identification System'.'Select image and add to database'.'Fingerprint identification'.'Delete database'.'Visual fingerprint Image'.'Visual Gabor Filtering'.'exit'); % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % fingerprint coding and added to the databaseif chos==1
clc;
close all;
selezionato=0; % Select flagwhile selezionato==0
[namefile,pathname]=uigetfile({'*.bmp; *.tif; *.tiff; *.jpg; *.jpeg; *.gif'.'IMAGE Files (*.bmp,*.tif,*.tiff,*.jpg,*.jpeg,*.gif)'},'Grayscale'); Opens a grayscale imageif namefile~=0% file exists [img,map]=imread(strcat(pathname,namefile)); % Read file selezionato=1;
else
disp('Select grayscale');
end
if (any(namefile~=0) && (~isgray(img)))% file does not exist or is not greyscaledisp('Select grayscale');
selezionato=0;
end
end
immagine=double(img);
if isa(img,'uint8')% If img is uint8 graylevmax=2^8- 1; % Calculated sizeend
if isa(img,'uint16')
graylevmax=2^16- 1;
end
if isa(img,'uint32')
graylevmax=2^32- 1;
end
fingerprint = immagine;
N=h_lato;
[BinarizedPrint,XofCenter,YofCenter]=centralizing(fingerprint,0); % binarization image, computing center [CroppedPrint] = Cropping (XofCenter YofCenter, fingerprint); % Image trim [NormalizedPrint,vector]=sector_norm(CroppedPrint,0); % sector, normalized input imagefor (angle=0:1:num_disk- 1) gabor=gabor2d_sub(angle,num_disk); % Gabor filter ComponentPrint = conv2fft (NormalizedPrint, Gabor.'same');
[disk,vector]=sector_norm(ComponentPrint,1);
finger_code1{angle+1} =vector(1:n_sectors);
end
img=imrotate(img,180/(num_disk*2)); % Rotate the image at an Angle fingerprint=double(img);
[BinarizedPrint,XofCenter,YofCenter]=centralizing(fingerprint,0);
[CroppedPrint]=Cropping(XofCenter,YofCenter,fingerprint);
[NormalizedPrint,vector]=sector_norm(CroppedPrint,0);
for (angle=0:1:num_disk- 1)
gabor=gabor2d_sub(angle,num_disk);
ComponentPrint=conv2fft(NormalizedPrint,gabor,'same');
[disk,vector]=sector_norm(ComponentPrint,1);
finger_code2{angle+1} =vector(1:n_sectors); End % Adds the fingerprint number to the databaseif (exist('database.dat') = =2)
load('database.dat'.'-mat');
fingerprint_number=fingerprint_number+1;
data{fingerprint_number,1}=finger_code1;
data{fingerprint_number,2}=finger_code2;
save('database.dat'.'data'.'fingerprint_number'.'-append');
else
fingerprint_number=1;
data{fingerprint_number,1}=finger_code1;
data{fingerprint_number,2}=finger_code2;
save('database.dat'.'data'.'fingerprint_number');
end
message=strcat('Fingerprint added successfully. Number: ',num2str(fingerprint_number));
msgbox(message,'Fingerprint database'.'information');
end % chos 1% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % fingerprint identificationif chos==2
clc;
close all;
selezionato=0;
while selezionato==0
[namefile,pathname]=uigetfile({'*.bmp; *.tif; *.tiff; *.jpg; *.jpeg; *.gif'.'IMAGE Files (*.bmp,*.tif,*.tiff,*.jpg,*.jpeg,*.gif)'},'Select grayscale');
if namefile~=0
[img,map]=imread(strcat(pathname,namefile));
selezionato=1;
else
disp('Select grayscale');
end
if (any(namefile~=0) && (~isgray(img)))
disp('Select grayscale');
selezionato=0;
end
end
immagine=double(img);
if isa(img,'uint8')
graylevmax=2^8- 1;
end
if isa(img,'uint16')
graylevmax=2^16- 1;
end
if isa(img,'uint32')
graylevmax=2^32- 1;
end
fingerprint = immagine;
N=h_lato;
[BinarizedPrint,XofCenter,YofCenter]=centralizing(fingerprint,0); % binarization [CroppedPrint] = Cropping (XofCenter YofCenter, fingerprint); % cut [NormalizedPrint,vector]=sector_norm(CroppedPrint,0); Vettore_in =zeros(num_disk*n_sectors,1);
for (angle=0:1:num_disk- 1)
gabor=gabor2d_sub(angle,num_disk);
ComponentPrint=conv2fft(NormalizedPrint,gabor,'same');
[disk,vector]=sector_norm(ComponentPrint,1);
finger_code{angle+1} =vector(1:n_sectors);
vettore_in(angle*n_sectors+1:(angle+1)*n_sectors)=finger_code{angle+1}; End % Calculates the input value text number % checks the databaseif (exist('database.dat') = =2)
load('database.dat'.'-mat'); % allocate memory -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- %... vettore_a=zeros(num_disk*n_sectors,1);
vettore_b=zeros(num_disk*n_sectors,1);
best_matching=zeros(fingerprint_number,1);
valori_rotazione=zeros(n_arcs,1); % start check ---------------------------------------for scanning=1:fingerprint_number
fcode1=data{scanning,1};
fcode2=data{scanning,2};
for rotazione=0:(n_arcs- 1)
p1=fcode1;
p2=fcode2;
% ruoto i valori dentro disco
for conta_disco=1Disco1 =p1{conta_disco}; disco2=p2{conta_disco};for old_pos=1:n_arcs
new_pos=mod(old_pos+rotazione,n_arcs);
if new_pos==0
new_pos=n_arcs;
end
for conta_bande=0:1:(n_bands- 1(old_pos+conta_bande*n_arcs) =disco1(old_pos+conta_bande*n_arcs); disco2r(new_pos+conta_bande*n_arcs)=disco2(old_pos+conta_bande*n_arcs); end end p1{conta_disco}=disco1r; p2{conta_disco}=disco2r; end % ruoto i dischi circolarmentefor old_disk=1:num_disk
new_disk=mod(old_disk+rotazione,num_disk);
if new_disk==0
new_disk=num_disk;
end
pos=old_disk- 1;
vettore_a(pos*n_sectors+1:(pos+1)*n_sectors)=p1{new_disk};
vettore_b(pos*n_sectors+1:(pos+1)*n_sectors)=p2{new_disk};
end
d1=norm(vettore_a-vettore_in);
d2=norm(vettore_b-vettore_in);
if d1<d2
val_minimo=d1;
else
val_minimo=d2;
end
valori_rotazione(rotazione+1)=val_minimo;
end
[minimo,posizione_minimo]=min(valori_rotazione);
best_matching(scanning)=minimo;
end
[distanza_minima,posizione_minimo]=min(best_matching);
beep;
message=strcat('The fingerprint most similar to that in the database is:',num2str(posizione_minimo)'); % with ',num2str(distanza_minima),'instance');
msgbox(message,'Database information'.'information');
else
message='Database is empty. Cannot match.';
msgbox(message,'Fingerprint number database error'.'wrong');
end
end % chos 2% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % delete databaseif chos==3
clc;
close all;
if (exist('database.dat') = =2)
button = questdlg('Are you sure you want to delete the database? ');
if strcmp(button,'Yes')
delete('database.dat');
msgbox('Database deleted successfully. '.'Database Delete'.'information');
end
else
warndlg('Database is empty! '.'warning')end end % chos 3 %-------------------------------------------------------------------------- % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % visualization fingerprint imageif chos= =4
clc;
close all;
selezionato=0;
while selezionato==0
[namefile,pathname]=uigetfile({'*.bmp; *.tif; *.tiff; *.jpg; *.jpeg; *.gif'.'IMAGE Files (*.bmp,*.tif,*.tiff,*.jpg,*.jpeg,*.gif)'},'Chose GrayScale Image');
if namefile~=0
[img,map]=imread(strcat(pathname,namefile));
selezionato=1;
else
disp('Select grayscale');
end
if (any(namefile~=0) && (~isgray(img)))
disp('Select grayscale');
selezionato=0;
end
end
figure('name'.'Select Image');
imshow(img);
end % chos 4% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % visualization Gabor filterif chos==5
clc;
close all;
figure('name'.'the Gabor filter');
mesh(gabor2d_sub(0,num_disk));
end % chos 5
end % end while
Copy the code
Third, note
Version: 2014 a