myFunctions.py 文件源码

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

项目:Signal_Identification_Python 作者: camigomez35 项目源码 文件源码
def fill(th, im_th):
    # Copy the thresholded image.
    im_floodfill = im_th.copy() 
    # Mask used to flood filling.
    # Notice the size needs to be 2 pixels than the image.
    h, w = im_th.shape[:2]
    mask = np.zeros((h+2, w+2), np.uint8) 
    # Floodfill from point (0, 0)
    cv2.floodFill(im_floodfill, mask, (0,0), 255);
    # Invert floodfilled image
    im_floodfill_inv = cv2.bitwise_not(im_floodfill);
    # Combine the two images to get the foreground.
    im_out = im_th | im_floodfill_inv
    return im_out;
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号