Update Barcode_Generator.py

This commit is contained in:
Carmelo Sarta 2019-09-26 17:30:46 +02:00 committed by GitHub
parent 8d7882ad1c
commit 5b2b4e7bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -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")