请问python如何将多张图片生成视频?
网友回复
#!/usr/local/python3/bin/python3 # -*- coding: utf-8 -* import cv2 fps = 10 #帧数 size = (300, 200) #f分辨率 fourcc = cv2.VideoWriter_fourcc(*"mp4v") #编码格式 videoWrite = cv2.VideoWriter('/data/wwwroot/...
点击查看剩余70%
import cv2 import glob def resize(img_array, align_mode): _height = len(img_array[0]) _width = len(img_array[0][0]) for i in range(1, len(img_array)): img = img_array[i] height = len(img) width = len(img[0]) if align_mode == 'smallest': if height < _height: _height = height if width < _width: _width = width else: if height > _height: _height ...
点击查看剩余70%