如何选择核心区域周围的指纹块?

How to choose a block of fingerprint around core region?

我必须设计一个使用指纹匹配的系统,我使用的算法要求首先select围绕核心点的区域,然后进行操作。现在我有了第 92from this link that selects the core point 页的算法,它在核心点检测方面工作得很好,但我的问题与围绕核心点裁剪图像有关。 假设如果我得到的核心点是错误的或者位于图像的边缘,那么当我尝试裁剪图像时,我得到的图像没有我需要的区域,例如让我尝试解释一下通过图片

假设我有这张图,我想取其核心点

我的算法给了我一个错误的核心点(以红色显示)

但这不是问题,因为我希望设计能够应对这种错误的核心点检测。正如我之前提到的,我需要在这个核心点周围有一个区域,我用来给我该区域的命令是:

[XofCenter,YofCenter]=get_core(x);
x = imcrop(x,[(XofCenter-128/2) (YofCenter-128/2) 128 128]);

其中 get_core 给出了核心点,imcrop 给出了围绕核心点的 128 交叉 128 图像块,这给了我 但这不是我想要的。 我希望我的图像包含更多的指纹区域,即使这意味着我的核心点不作为我的块图像的中心,像这样: 现在的问题是如何在不手动裁剪图像的情况下得到这样的东西,有人能帮我吗?

这是使用 imfilter:

解决问题的一种相当简单的方法
% read image and set wrong core point
im = im2double(imread('fingerprint.png'));
wrong_corepoint = [64 77];
cropsize = 128;
% filter image to get accumulated values in 128X128 rects
res = imfilter(im, ones(cropsize),'replicate');
% get possible cropping area
yxmin = max([1 1],wrong_corepoint([2 1]) - cropsize + 1);
yxmax = min(size(im),wrong_corepoint([2 1]) + cropsize - 1);
% crop filterd image
res_crop = res(yxmin(1):yxmax(1),yxmin(2):yxmax(2));
% get minimum value because fingerprint is black
[v,minidx] = min(res_crop(:)); 
[rMin,cMin] = ind2sub(size(res_crop),minidx);
% convert to original image coordinates
ymin = yxmin(1) + rMin - cropsize/2 - 1;
xmin = yxmin(2) + cMin - cropsize/2 - 1;
xmin = min([xmin,size(im,2) - cropsize,wrong_corepoint(1)]);
ymin = min([ymin,size(im,1) - cropsize,wrong_corepoint(2)]);
xmin = max([xmin,1,wrong_corepoint(1) - cropsize + 1]);
ymin = max([ymin,1,wrong_corepoint(2) - cropsize + 1]);
rect = [xmin ymin cropsize cropsize];
% plot
figure;
imshow(im);
hold on
plot(wrong_corepoint(1),wrong_corepoint(2),'xr','MarkerSize',20,'LineWidth',2);
rectangle('Position',rect,'LineWidth',2,'EdgeColor','g');

错误的核心点用红色 X 标记,裁剪矩形用绿色标记: