Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import skvideo.io
- import math
- import matplotlib
- import matplotlib.pyplot as plt
- def sup(img1, img2):
- img1 = img1.astype('int32')
- img2 = img2.astype('int32')
- return np.max(img1 - img2)
- path1 = "/home/ivan/Downloads/IMG_1468_16.avi"
- video1 = skvideo.io.vread(path1)
- path2 = "/home/ivan/Downloads/IMG_1468_16.ogv"
- video2 = skvideo.io.vread(path2)
- # 973 frames
- # cnt = 1
- # for i in video2:
- # print(cnt)
- # cnt += 1
- frames1 = []
- frames2 = []
- for i in video1:
- frames1.append(i)
- for i in video2:
- frames2.append(i)
- print("Frames count from video {}".format(path1),len(frames1))
- print("Frames count from video {}".format(path2), len(frames2))
- res = {
- "step": [],
- "sup": []
- }
- print(frames2[1])
- for i in range(0, len(video1)):
- sp = sup(frames1[i], frames2[i])
- print(i, " sup= ", sp)
- res["step"].append(i)
- res["sup"].append(sp)
- plt.plot(res["step"], res["sup"])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement