lane_detection.py 文件源码

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

项目:CarLaneDetection 作者: leftthomas 项目源码 文件源码
def roi_mask(img, vertices):
    mask = np.zeros_like(img)

    # defining a 3 channel or 1 channel color to fill the mask with depending on the input image
    if len(img.shape) > 2:
        channel_count = img.shape[2]  # i.e. 3 or 4 depending on your image
        mask_color = (255,) * channel_count
    else:
        mask_color = 255

    cv2.fillPoly(mask, vertices, mask_color)
    masked_img = cv2.bitwise_and(img, mask)
    return masked_img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号