peg_filter.py 文件源码

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

项目:CompetitionBot2017 作者: Seamonsters-2605 项目源码 文件源码
def __distance_transform(input, type, mask_size):
        """Sets the values of pixels in a binary image to their distance to the nearest black pixel.
        Args:
            input: A numpy.array.
            type: Opencv enum.
            mask_size: The size of the mask. Either 0, 3, or 5.
        Returns:
            A black and white numpy.ndarray.
        """
        h, w = input.shape[:2]
        dst = numpy.zeros((h, w), numpy.float32)
        cv2.distanceTransform(input, type, mask_size, dst = dst)
        return numpy.uint8(dst)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号