From 7cd7e0f02d4fdc70924af1c75f9c9ccd2a81176c Mon Sep 17 00:00:00 2001 From: Loic Delattre Date: Mon, 6 Feb 2023 10:56:34 +0100 Subject: [PATCH] take into account all frames // bug inside main func on empty min values --- RGB_channels.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RGB_channels.py b/RGB_channels.py index a1bda0d..efdfbc9 100644 --- a/RGB_channels.py +++ b/RGB_channels.py @@ -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])