【问题标题】:SaveVideo annotated labelized with Tensorflow Object detection使用 Tensorflow 对象检测标记的 SaveVideo
【发布时间】:2018-11-27 03:21:34
【问题描述】:
我有一个 tensorflow 对象检测视频注释脚本。当我启动 python 代码时,它会启动一个屏幕,我们在视频中看到检测到的对象上的注释标签。我想将这个带注释的视频保存到一个新视频中(因为我想稍后再看这个视频)。
有什么想法吗?我是 python 和 tensorflow 的新手,我使用这个 tuto EdjeElectronics 多个带注释的视频窗口 10。
【问题讨论】:
标签:
tensorflow
video
object-detection
【解决方案1】:
我已经这样做了
# Open video file
video = cv2.VideoCapture(PATH_TO_VIDEO)
#float
width = int(video.get(cv2.CAP_PROP_FRAME_WIDTH))
print(width)
height = int(video.get(cv2.CAP_PROP_FRAME_HEIGHT))
print(height)
fps = int(video.get(cv2.CAP_PROP_FPS))
print(fps)
#size = Size(width, height)
fourcc = video.get(cv2.CAP_PROP_FOURCC)
print(fourcc)
#create video file
videoFile=cv2.VideoWriter('savedVideo.mp4',cv2.VideoWriter_fourcc('M','P','4','V'),fps,
(宽度,高度))
...
cv2.imwrite("newVideo/frame%d.jpg" % count, frame)
videoFile.write(frame)