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)
standard_analysis.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录