鱼C论坛

 找回密码
 立即注册
查看: 690|回复: 1

视频保存问题

[复制链接]
发表于 2019-3-6 20:28:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x

  1. ##### following are added for camera demo####
  2. cap = cv2.VideoCapture(r'E:\SSD-Tensorflow-master\Video\input\1.mp4')
  3. fps = cap.get(cv2.CAP_PROP_FPS)
  4. size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))
  5. fourcc = cap.get(cv2.CAP_PROP_FOURCC)
  6. #fourcc = cv2.CAP_PROP_FOURCC(*'CVID')
  7. print('fps=%d,size=%r,fourcc=%r'%(fps,size,fourcc))
  8. delay=30/int(fps)


  9. while(cap.isOpened()):
  10.       ret,frame = cap.read()
  11.       if ret==True:
  12. #          image = Image.open(image_path)
  13. #          gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  14.           image = frame
  15.           # the array based representation of the image will be used later in order to prepare the
  16.           # result image with boxes and labels on it.
  17.           image_np = image
  18. #          image_np = load_image_into_numpy_array(image)
  19.           # Expand dimensions since the model expects images to have shape: [1, None, None, 3]
  20.           image_np_expanded = np.expand_dims(image_np, axis=0)
  21.           # Actual detection.
  22.           rclasses, rscores, rbboxes =  process_image(image_np)
  23.           # Visualization of the results of a detection.
  24.           visualization_camera.bboxes_draw_on_img(image_np, rclasses, rscores, rbboxes)
  25. #          plt.figure(figsize=IMAGE_SIZE)
  26. #          plt.imshow(image_np)
  27.           cv2.imshow('frame',image_np)
  28.           cv2.waitKey(np.uint(delay))
  29.           print('Ongoing...')
  30.       else:
  31.           break
  32. cap.release()
  33. cv2.destroyAllWindows()
复制代码

我想将这段显示的视频保存下来,请问应该怎么做
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2019-3-6 20:38:10 | 显示全部楼层
我好像知道了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2026-1-14 08:15

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表