misc.py 文件源码

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

项目:SMURFS-Superpixels 作者: imaluengo 项目源码 文件源码
def boundaries(regions, thin=False):
    """
    Extracts region boundaries from a labelled image.

    Args:
        regions: numpy (H, W) array
            Regions extracted from `image`
        thin: bool
            Whether to skeletonize or not the boundaries.
    Return:
        result: numpy (H, W) array
            Region boundaries as a binary mask.
    """
    # +1 to ignore superpixel 0 treated as background
    result = find_boundaries(regions+1)
    if thin:
        result = skeletonize(result)
    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号