Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import os
import cv2
import numpy as np
import glob
import shutil
import time
from datetime import datetime
img_array = []
for filename in glob.glob('./Stm_Video_Pictures/*.jpg'):
img = cv2.imread(filename)
height, width, layers = img.shape
size = (width,height)
img_array.append(img)
timestamp = time.strftime("%Y-%m-%d-%H:%M:%S")
out = cv2.VideoWriter('Stm_Videos/Stm_Video'+ timestamp + '.avi',cv2.VideoWriter_fourcc(*'DIVX'), 15, size)
for i in range(len(img_array)):
out.write(img_array[i])
out.release
#for filename in os.listdir('./Stm_Video'):
# if filename.endswith('.jpg'):
# os.remove(filename)
shutil.rmtree('Stm_Video_Pictures')