实施当地山脊方向

时间:2013-07-22 13:40:57

标签: python fingerprint image-segmentation

我一直在尝试在python中实现指纹的局部脊线方向。我使用了Gradient方法,并使用sobel算子来获得我需要的渐变。然而事实证明,这种方法存在很多缺陷,特别是在90度左右。我可以包含我到目前为止所做的代码,但由于它不能按我的意愿工作,我不知道是否需要它。我也看过线段方法,但是,我正在使用潜在的指纹,因此很难知道是否应该在线段中寻找最大的黑色或白色。我还尝试实现一种算法来检测连续线的最大浓度区域,但我无法使其工作。有关其他算法的建议吗?

编辑:

我正在使用一个函数将我的函数应用于块,但这几乎不相关

def lro(im_np):

    orientsmoothsigma = 3

    Gxx = cv2.Sobel(im_np,-1,2,0)
    Gxy = cv2.Sobel(im_np,-1,1,1)
    Gyy = cv2.Sobel(im_np,-1,0,2)


    Gxx = scipy.ndimage.filters.gaussian_filter(Gxx, orientsmoothsigma)
    Gxy = numpy.multiply(scipy.ndimage.filters.gaussian_filter(Gxy, orientsmoothsigma), 2.0)
    Gyy = scipy.ndimage.filters.gaussian_filter(Gyy, orientsmoothsigma)

    denom = numpy.sqrt(numpy.add(numpy.power(Gxy,2), (numpy.power(numpy.subtract(Gxx,Gyy),2))))# + eps;
    sin2theta = numpy.divide(Gxy,denom)            # Sine and cosine of doubled angles
    cos2theta = numpy.divide(numpy.subtract(Gxx,Gyy),denom)

    sze = math.floor(6*orientsmoothsigma);
    if not sze%2: sze = sze+1       
    cos2theta = scipy.ndimage.filters.gaussian_filter(cos2theta, orientsmoothsigma)  # Smoothed sine and cosine of
    sin2theta = scipy.ndimage.filters.gaussian_filter(sin2theta, orientsmoothsigma)#filter2(f, sin2theta); # doubled angles



    orientim = math.pi/2. + numpy.divide(numpy.arctan2(sin2theta,cos2theta),2.)

    return orientim

2 个答案:

答案 0 :(得分:1)

我很久以前就研究过它,并写了一篇论文。我记得,寻找黑色和白色的脊(反转图像,重复分析),以提供更多的结果。我确实记得某些角度的敏感度。你可能需要的东西比纯粹的索贝尔更大。尝试尽可能多的像素。

答案 1 :(得分:0)

你可能想看一下Raymond Thai的工作(指纹图像 增强和细节提取),如果你还没有。