main.py 文件源码

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

项目:Automatic-Plate-Number-Recognition-APNR 作者: kagan94 项目源码 文件源码
def process_video(path_to_video):
    cap = cv2.VideoCapture(path_to_video)  # Load video

    while True:
        ret, frame = cap.read()
        print frame
        if ret is False or (cv2.waitKey(30) & 0xff) == 27: break  # Exit if the video ended

        mask = np.zeros_like(frame)  # init mask
        contours = find_contours(frame)
        plates, plates_images, mask = find_plate_numbers(frame, contours, mask)

        print "Plate Numbers: %s" % ", ".join(plates)

        processed_frame = cv2.add(frame, mask)  # Apply the mask to image
        cv2.imshow('frame', processed_frame)
    cv2.destroyAllWindows()
    cap.release()


###########################################
# Run The Program #########################
###########################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号