standard_analysis.py 文件源码

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

项目:tda-image-analysis 作者: rachellevanger 项目源码 文件源码
def topological_defect_array(orientation_field):
    """
    Returns a matrix of topological defects for the given orientation field. 
    Each entry in the matrix is the charge of the defect.
    """
    JX = np.diff(orientation_field, axis=0)
    JY = np.diff(orientation_field, axis=1)
    JX += math.pi * (JX < -math.pi/2.0 ) - math.pi * (JX > math.pi/2.0)
    JY += math.pi * (JY < -math.pi/2.0 ) - math.pi * (JY > math.pi/2.0)
    return np.rint((np.diff(JY, axis=0) - np.diff(JX, axis=1))/math.pi)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号