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)
|
avgsq = np.average(squared, axis=1)
|
||||||
return np.sqrt(avgsq).astype('uint8')
|
return np.sqrt(avgsq).astype('uint8')
|
||||||
|
|
||||||
|
|
||||||
def movie_iter(movie_name, frames_to_skip):
|
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()
|
s, f = movie.read()
|
||||||
while s:
|
while s:
|
||||||
yield f
|
yield f
|
||||||
|
|
@ -30,12 +31,11 @@ def elab(movie_it):
|
||||||
|
|
||||||
return res
|
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)
|
cc = c.swapaxes(0, 1)
|
||||||
|
|
||||||
i = Image.fromarray(cc, mode='RGB')
|
i = Image.fromarray(cc, mode='RGB')
|
||||||
|
i.save("prova_parall.jpg")
|
||||||
i.save('multip_test_steven.jpg')
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue