standard_analysis.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:tda-image-analysis 作者: rachellevanger 项目源码 文件源码
def orientation_field(bmp, sigma=3):
    # Author: Shaun Harker, 2016
    # Based on algorithm by Bazen and Gerez from "Systematic methods for the 
    # computation of the directional fields and singular points of fingerprints," 2002.
    """
    Computes orientation field (result everywhere between -pi/2 and pi/2)
    from the given vector field.
    """
    u = bmp.astype(float)
    du = np.gradient(u)
    [ux, uy] = du
    Y = scipy.ndimage.filters.gaussian_filter(2.0*ux*uy, sigma=sigma)
    X = scipy.ndimage.filters.gaussian_filter(ux**2.0 - uy**2.0, sigma=sigma)
    return .5 * np.arctan2(Y, X)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号