Skip to content

Instantly share code, notes, and snippets.

@aravindpai

aravindpai/11_1.py

Created Mar 30, 2020
Embed
What would you like to do?
import matplotlib.pyplot as plt
import cv2
import numpy as np
import os
import re
#listing down all the file names
frames = os.listdir('frames/')
frames.sort(key=lambda f: int(re.sub('\D', '', f)))
#reading frames
images=[]
for i in frames:
img = cv2.imread('frames/'+i)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.GaussianBlur(img,(25,25),0)
images.append(img)
images=np.array(images)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.