import numpy as np import cv2 size = (1024,768) videowrite = cv2.VideoWriter(r'test.mp4',-1,30,size) img_array=[] for filename in [r'cam_3D\image{0}.jpg'.format(i) for i inrange(1,1000)]: img = cv2.imread(filename) if img isNone: print(filename + " is error!") continue img_array.append(img) for i inrange(1000): videowrite.write(img_array[i]) videowrite.release() print('finished')
The domain name of this website has been changed to triority.cc(Using CDN via cloudflare, recommended) / www.triority.cc(Connecting directly, works better in Chinese mainland). Please contact me if you have any questions.