Update Barcode_Generator.py
This commit is contained in:
parent
8d7882ad1c
commit
5b2b4e7bcc
|
|
@ -14,8 +14,9 @@ def frame_avg(img):
|
|||
avgsq = np.average(squared, axis=1)
|
||||
return np.sqrt(avgsq).astype('uint8')
|
||||
|
||||
|
||||
def movie_iter(movie_name, frames_to_skip):
|
||||
movie=cv2.VideoCapture(f"{movie_name}.mp4") #
|
||||
movie = cv2.VideoCapture(f"{movie_name}.mp4")
|
||||
s, f = movie.read()
|
||||
while s:
|
||||
yield f
|
||||
|
|
@ -30,12 +31,11 @@ def elab(movie_it):
|
|||
|
||||
return res
|
||||
|
||||
complete = collect_frames(movie)
|
||||
|
||||
c = np.array(complete)
|
||||
it = movie_iter("movies/SampleVideo_1280x720_1mb.mp4", 4)
|
||||
|
||||
res = elab(it)
|
||||
c = np.array(res)
|
||||
cc = c.swapaxes(0, 1)
|
||||
|
||||
i = Image.fromarray(cc, mode='RGB')
|
||||
|
||||
i.save('multip_test_steven.jpg')
|
||||
i.save("prova_parall.jpg")
|
||||
|
|
|
|||
Loading…
Reference in New Issue