1 Star 0 Fork 0

王传桐/DeepCalib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
extract_images.py 575 Bytes
一键复制 编辑 原始数据 按行查看 历史
alexvbogdan 提交于 2020-08-21 16:40 . files upload
import cv2, sys
import numpy as np
import glob
import pdb
# path to where you want to save extracted frames
SAVE_PATH = ""
# Path to your video file
filename = ""
def video_to_frames(video_filename):
source_video = cv2.VideoCapture(video_filename)
n_frames = source_video.get(cv2.CAP_PROP_FRAME_COUNT)
i = 0
while i <= n_frames:
ret, frame = source_video.read()
if ret:
cv2.imwrite(SAVE_PATH + "frame_" + str(i) + ".jpg", frame)
else:
i += 1
continue
i += 1
video_to_frames(filename)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wang_chuantong/DeepCalib.git
git@gitee.com:wang_chuantong/DeepCalib.git
wang_chuantong
DeepCalib
DeepCalib
master

搜索帮助