Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
autopep8 action fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NLmeng authored Mar 4, 2023
1 parent d1b4970 commit b79a6b0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion algorithms/CenterRowAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion algorithms/CheckRowEnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion algorithms/HoughAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion algorithms/MiniContoursAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion algorithms/MiniContoursDownwards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion algorithms/ScanningAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion algorithms/SeesawAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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
return app
2 changes: 1 addition & 1 deletion pre_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit b79a6b0

Please sign in to comment.