utils_pro.py 文件源码

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

项目:cav_gcnn 作者: myinxd 项目源码 文件源码
def cav_edge(img, sigma):
    """
    Detect edges in the recovered image.

    Reference
    =========
    [1] Edge detection with canny by python
        http://blog.csdn.net/matrix_space/article/details/49786427

    Inputs
    ======
    img: np.ndarray
        the recovered image
    sigma: float
        the sigma in canny methods

    Output
    ======
    img_edge: np.ndarray
        teh edge detected image
    """
    # Reprocess of the image
    # idx = np.where(img >= 1)
    img_re = img
    # img_re[idx] = 1
    # Edge detect
    edge = feature.canny(img_re, sigma=sigma)
    # bool to integer
    img_edge = edge.astype('int32')

    return img_edge
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号