diff --git a/algorithms/CenterRowAlgorithm.py b/algorithms/CenterRowAlgorithm.py index fe50ec6..b088ce8 100644 --- a/algorithms/CenterRowAlgorithm.py +++ b/algorithms/CenterRowAlgorithm.py @@ -54,7 +54,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + def process_frame(self, frame, show): """Uses contouring to create contours around each crop row and uses these contours to find centroid lines, row vanishing point, a center contour and the angle between the center contour and vanishing point\n diff --git a/algorithms/CheckRowEnd.py b/algorithms/CheckRowEnd.py index 58b24c8..4572752 100644 --- a/algorithms/CheckRowEnd.py +++ b/algorithms/CheckRowEnd.py @@ -26,7 +26,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + def process_frame(self, frame, show): """Averages values in each row in a mask of the frame. If the number of rows with an average value of zero is greater than req_rows_empty, then frame is row end\n diff --git a/algorithms/HoughAlgorithm.py b/algorithms/HoughAlgorithm.py index ae2723d..fec925e 100644 --- a/algorithms/HoughAlgorithm.py +++ b/algorithms/HoughAlgorithm.py @@ -41,7 +41,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + # processFrame function that is called to process a frame of a video # takes in frame mat object obtained from cv2 video.read() def process_frame(self, frame, show=True): diff --git a/algorithms/MiniContoursAlgorithm.py b/algorithms/MiniContoursAlgorithm.py index ed7d5c4..11963ce 100644 --- a/algorithms/MiniContoursAlgorithm.py +++ b/algorithms/MiniContoursAlgorithm.py @@ -210,7 +210,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + def process_frame(self, original_frame, num_strips=60, show=False): # original_frame: BGR frame diff --git a/algorithms/MiniContoursDownwards.py b/algorithms/MiniContoursDownwards.py index c67cf59..356f340 100644 --- a/algorithms/MiniContoursDownwards.py +++ b/algorithms/MiniContoursDownwards.py @@ -161,7 +161,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + def process_frame(self, original_frame, num_strips=60, show=False): """"" parameters: diff --git a/algorithms/ScanningAlgorithm.py b/algorithms/ScanningAlgorithm.py index 1a02dbf..8fd1eba 100644 --- a/algorithms/ScanningAlgorithm.py +++ b/algorithms/ScanningAlgorithm.py @@ -83,7 +83,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + def process_frame(self, frame, show): hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) diff --git a/algorithms/SeesawAlgorithm.py b/algorithms/SeesawAlgorithm.py index f729645..22f2aa0 100644 --- a/algorithms/SeesawAlgorithm.py +++ b/algorithms/SeesawAlgorithm.py @@ -32,7 +32,7 @@ def update_lower_hsv(self, next): def update_upper_hsv(self, next): self.HIGH_GREEN = np.array(next) - + def process_frame(self, frame, show): black_frame, points, both_points = self.plot_points(frame) diff --git a/gui.py b/gui.py index 9eb7417..347e5e3 100644 --- a/gui.py +++ b/gui.py @@ -58,7 +58,11 @@ def __init__(self, master, img_dict, window_name): for i, (img_name, img_array) in enumerate(img_dict.items(), 1): radiobutton = tk.Radiobutton( - self.scrollable_frame, text=img_name, variable=self.var, value=i, command=lambda i=i: self.update_frameType(i)) + self.scrollable_frame, + text=img_name, + variable=self.var, + value=i, + command=lambda i=i: self.update_frameType(i)) radiobutton.pack(pady=5, side="bottom") self.brightness_scale = tk.Scale(self.scrollable_frame, from_=0, to=255, orient="horizontal", @@ -298,7 +302,7 @@ def startGUI(window_name, **kwargs): raise KeyError("kwargs is empty in startGUI(), start with name1= ... ") for key, value in kwargs.items(): - if key == curr_name+str(curr_index): + if key == curr_name + str(curr_index): frame_type = value img_dict[frame_type] = np.zeros((100, 100)) curr_index += 1 @@ -310,4 +314,4 @@ def startGUI(window_name, **kwargs): root.protocol("WM_DELETE_WINDOW", onClose) app = GUI(root, img_dict, window_name) isActive = True - return app \ No newline at end of file + return app diff --git a/pre_process.py b/pre_process.py index 3cc92d7..f8b4f8f 100644 --- a/pre_process.py +++ b/pre_process.py @@ -152,7 +152,7 @@ def standardize_frame(img): try: hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) - except: + except BaseException: img_float32 = np.float32(img) hsv = cv2.cvtColor(img_float32, cv2.COLOR_BGR2HSV)