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 #########################
###########################################
main.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录