카테고리 없음

이미지 영상으로 저장하기

행복을전해요 2021. 9. 23. 15:29
import cv2
import numpy as np
import glob
import statistics
import re


img_array = []
for filename in glob.glob('./img/*.jpg'):	
	img = cv2.imread(filename)	
	height, width, layers = img.shape		
	size = (width,height)
	img_array.append(img)


out = cv2.VideoWriter('./img/project.avi',cv2.VideoWriter_fourcc(*'DIVX'), 1, size)

print(out)
for i in range(len(img_array)):
	out.write(img_array[i])
out.release()


exit()