Matlab FingerPrint Minutia Extraction

时间:2014-09-22 19:49:41

标签: matlab verification fingerprint

我对目前的指纹验证和研究细节提取非常感兴趣。我在网上找到了以下代码,想知道是否有人能够解释它?我查了质心,regionprops等,我理解这些,但下面的代码让我感到困惑!

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 个答案:

答案 0 :(得分:2)

代码首先使用3x3像素的邻域过滤二进制图像。 nfilter是一个移动过滤器功能。它将遍历作为参数给出的图像中的所有像素,并根据相邻像素的值应用操作。

我不知道minutie过滤器的确切内容,但是根据其余代码判断,它可能会计算所有1的邻域中值为1的像素。换句话说,它将等于段末尾的一个,当有3个分支(分叉)时等于3。

示例:

让过滤器对邻域中的过滤器进行总结,如下所示:

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

其中block表示二进制图像的每个像素周围的邻域。

在下面的左边矩阵中(如果忽略边界异常),有一个位置,其中一个在3x3邻域中只有一个1,在右边的矩阵中,有一个位置,其中一个位置恰好有三个1s在其3x3附近。

[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]

过滤后的输出为:

[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]

它在左矩阵中找到了终止,在右矩阵中找到了分叉。

然后将过滤后的图像设置为值1和3的阈值,然后使用bwlabelregionprops对我来说有点神秘†因为分叉和终止是单点,它们的位置只是它们的位置指数。我想你可以简单地使用类似的东西来检测终点和分叉的坐标:

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

†我能想到的一个原因是图像和数组中的坐标在matlab中是不同的,这两个函数以图像格式输出坐标,这更容易在原始图像上绘制。