# This code creates an animation from a collection of images
import cv2
video_name = 'Image/video.avi'
video = cv2.VideoWriter(video_name, 0, 100, (640, 480)) # the 100 controls how fast the video runs (low => slow)
for k in range(2002):
# Updating name for each frame - depends on the naming scheme you chose for saving
filename = ['Image/image_', str(k), '.png']
# writing to file
img = cv2.imread("".join(filename))
video.write(img)
print(k)
cv2.destroyAllWindows()
video.release()