misc.py 文件源码

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

项目:SMURFS-Superpixels 作者: imaluengo 项目源码 文件源码
def mark_boundaries(image, regions, color=(0,0,0), thin=False):
    """
    Mark region boundaries in a given image.

    Args:
        image: numpy (H, W) array
            RGB image
        regions: numpy (H, W) array
            Regions extracted from `image`
        color: RGB tuple from 0 to 1
            Color to mark boundaries. Default black.
        thin: bool
            Whether to skeletonize or not the boundaries.
    Return:
        result: numpy (H, W) array
            Image with region boundaries overlaid on it.
    """
    bounds = boundaries(regions, thin=thin)
    result = image.copy()
    result[bounds] = color
    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号