import cv2
import os
import glob
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
img_dir="Results/processed/soapbox-results/"
fps=15
fourcc = cv2.VideoWriter_fourcc(*'MJPG')
video_writer = cv2.VideoWriter("Results/video/soapbox.avi", fourcc, fps, (854,480 ))
images=os.listdir(img_dir)
images=np.unique(images)
for i in images:
img_path=img_dir+i
print(img_path)
image=cv2.imread(img_path)
cv2.imshow("image", image)
video_writer.write(image)
video_writer.release()