take into account all frames // bug inside main func on empty min values

This commit is contained in:
Loic Delattre 2023-02-06 10:56:34 +01:00
parent b81df3b86d
commit 7cd7e0f02d
1 changed files with 6 additions and 2 deletions

View File

@ -81,9 +81,13 @@ def average_and_export():
frames_num = rep_files_init()
while i < frames_num:
i += 1
image = "frames/frame1.jpg"
image = "frames/frame" + str(i) + ".jpg"
read_img = cv2.imread(image)
out_colors = RGB_dataframe(read_img, i)
#Bug here inside of func with min funcs of empty data
try:
out_colors = RGB_dataframe(read_img, i)
except:
out_colors = out_colors
Ravg = sum(out_colors[0])/len(out_colors[0])
Gavg = sum(out_colors[1])/len(out_colors[1])
Bavg = sum(out_colors[2])/len(out_colors[2])