morpological_operations.py 文件源码

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

项目:LabelsManager 作者: SebastianoF 项目源码 文件源码
def get_patch_values(point, target_image, radius=5, shape='circle', morfo_mask=None):
    """
    To obtain the list of the values below a maks.
    :param point:
    :param target_image:
    :param radius:
    :param shape:
    :param morfo_mask: To avoid computing the morphological mask at each iteration if this method is called in a loop, this can be provided as input.
    :return:
    """
    if morfo_mask is None:
        morfo_mask = get_morphological_mask(point, target_image.shape, radius=radius, shape=shape)
    coord = np.nonzero(morfo_mask.flatten())[0]
    return np.take(target_image.flatten(), coord)


# def midpoint_circle_algorithm(center=(0, 0, 0), radius=4):
#     x, y, z = center
#     # TODO generalise the midpoint circle algorithm and use it for get_shell_for_given_radius
#     pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号