-->

Matlab FingerPrint Minutia Extraction

2019-03-05 06:23发布

问题:

I am very interested in fingerprint verification and studying minutia extraction at present. I have found the following code online and wonder if someone would be kind enough to explain it? I have looked up centroid, regionprops etc, I understand these a little but the code below has me puzzled!

fun=@minutie;
L = nlfilter(K,[3 3],fun);

%% Termination
LTerm=(L==1);
imshow(LTerm)
LTermLab=bwlabel(LTerm);
propTerm=regionprops(LTermLab,'Centroid');

CentroidTerm=round(cat(1,propTerm(:).Centroid));
imshow(~K)
set(gcf,'position',[1 1 600 600]);
hold on
plot(CentroidTerm(:,1),CentroidTerm(:,2),'ro')

%% Bifurcation
LBif=(L==3);
LBifLab=bwlabel(LBif);
propBif=regionprops(LBifLab,'Centroid','Image');
CentroidBif=round(cat(1,propBif(:).Centroid));
plot(CentroidBif(:,1),CentroidBif(:,2),'go')

回答1:

The code first filters the binary image with a neighborhood of 3x3 pixels. nfilter is a moving filter function. It will go through all the pixels in the image given as argument and apply an operation based on the values of the neighboring pixels.

I don't know the exact content of the minutie filter, but judging by the rest of the code, it probably counts the pixels with a value of 1 in the neighborhood of all 1s. In other words it will be equal to one at the end of a segment, and equal to 3 when there are 3 branches (a bifurcation).

Example:

Let a filter sum up the ones in the neighborhood, like this:

sum(block(1,1:3), block(3,1:3), block(2,1), block(2,3))*block(2, 2);

where block denotes a neighborhood around each pixel of the binary image.

In the left matrix below (if you ignore the boundary exceptions) there is one position with a one that has exactly one 1 in its 3x3 neighborhood, in the right matrix, there is one position with a one that has exactly three 1s in its 3x3 neighborhood.

[0 0 0 0 0        [0 0 1 0 0
 0 0 0 0 0         0 0 1 0 0
 0 0 1 0 0         1 1 1 0 0
 0 0 1 0 0         0 0 1 0 0
 0 0 1 0 0]        0 0 1 0 0]

The filtered output would be:

[0 0 0 0 0        [0 0 0 0 0
 0 0 0 0 0         0 0 0 0 0
 0 0 1 0 0         0 0 3 0 0
 0 0 0 0 0         0 0 0 0 0
 0 0 0 0 0]        0 0 0 0 0]

It found a termination in the left matrix, and a bifurcation in the right matrix.

The filtered image are then thresholded at the value 1 and 3, then the use of bwlabel and regionprops is somewhat mysterious to me† since bifurcations and terminations are single points, their position is simply their index. I think you could simply achieve the detection of the coordinates of the terminations and bifurcation using something like:

[It Jt]= find(L==1);
[Ib Jb]= find(L==3);

† one reason I can think of is that coordinates in images and arrays are different in matlab, and these two function output coordinates in the image format, which is easier to plot on top of the original image.