image.py 文件源码

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

项目:endless-lake-player 作者: joeydong 项目源码 文件源码
def highlight_regions(image, region_rects):
    # Darken image with mask
    composite_image = cv2.addWeighted(image, 0.50, numpy.zeros(image.shape, dtype="uint8"), 0.50, 0)

    # Highlight region_of_interest
    for rect in region_rects:
        (x1, x2, y1, y2) = (rect["x1"], rect["x2"], rect["y1"], rect["y2"])
        composite_image[y1:y2, x1:x2] = image[y1:y2, x1:x2]

    return composite_image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号