视频转成图片

import cv2
import scipy.misc
video = cv2.VideoCapture('./film_frame_out.mp4')
success = True
count = 0
path = './film_frame_out'
while success:
    count += 1
    success, img = video.read()
    scipy.misc.imsave(path+'/'+str(count)+'.png', cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
    print(count)

你可能感兴趣的:(技术,深度学习,python)