calc_util.py 文件源码

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

项目:cellstar 作者: Fafa87 项目源码 文件源码
def unstick_contour(edgepoints, unstick_coeff):
    """
    Removes edgepoints near previously discarded points.
    @type edgepoints: list[bool]
    @param edgepoints: current edgepoint list
    @type unstick_coeff: float
    @param unstick_coeff
    @return: filtered edgepoints
    """
    (n, init, end) = loop_connected_components(np.logical_not(edgepoints))
    filtered = np.copy(edgepoints)
    n_edgepoint = len(edgepoints)
    for size, s, e in zip(n, init, end):
        for j in range(1, int(size * unstick_coeff + 0.5) + 1):
            filtered[(e + j) % n_edgepoint] = 0
            filtered[(s - j) % n_edgepoint] = 0
    return filtered
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号