|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- ##### following are added for camera demo####
- cap = cv2.VideoCapture(r'E:\SSD-Tensorflow-master\Video\input\1.mp4')
- fps = cap.get(cv2.CAP_PROP_FPS)
- size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))
- fourcc = cap.get(cv2.CAP_PROP_FOURCC)
- #fourcc = cv2.CAP_PROP_FOURCC(*'CVID')
- print('fps=%d,size=%r,fourcc=%r'%(fps,size,fourcc))
- delay=30/int(fps)
- while(cap.isOpened()):
- ret,frame = cap.read()
- if ret==True:
- # image = Image.open(image_path)
- # gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
- image = frame
- # the array based representation of the image will be used later in order to prepare the
- # result image with boxes and labels on it.
- image_np = image
- # image_np = load_image_into_numpy_array(image)
- # Expand dimensions since the model expects images to have shape: [1, None, None, 3]
- image_np_expanded = np.expand_dims(image_np, axis=0)
- # Actual detection.
- rclasses, rscores, rbboxes = process_image(image_np)
- # Visualization of the results of a detection.
- visualization_camera.bboxes_draw_on_img(image_np, rclasses, rscores, rbboxes)
- # plt.figure(figsize=IMAGE_SIZE)
- # plt.imshow(image_np)
- cv2.imshow('frame',image_np)
- cv2.waitKey(np.uint(delay))
- print('Ongoing...')
- else:
- break
- cap.release()
- cv2.destroyAllWindows()
复制代码
我想将这段显示的视频保存下来,请问应该怎么做 |
|