diff --git a/src/Active-Lane-Keeping-Assistant/lane.py b/src/Active-Lane-Keeping-Assistant/lane.py index 53f6211ac6..50b5909827 100644 --- a/src/Active-Lane-Keeping-Assistant/lane.py +++ b/src/Active-Lane-Keeping-Assistant/lane.py @@ -9,7 +9,8 @@ class Lane: """Detects Lanes in a given Image """ - + HLS_L_THRESHOLD_MIN = 150 + HLS_L_THRESHOLD_MAX = 255 def __init__(self, height:int, width:int, save:bool=False, save_folder:str=join('img', 'examples')) -> None: """Constructor @@ -56,7 +57,7 @@ def get_lines(self, img:np.ndarray) -> np.ndarray: # Create threshold matrix to differentiate black and white based on the # lightness (of HSL). - _, binary = cv2.threshold(hls[:, :, 1], 150, 255, cv2.THRESH_BINARY) + _, binary = cv2.threshold(hls[:, :, 1], self.HLS_L_THRESHOLD_MIN, self.HLS_L_THRESHOLD_MAX, cv2.THRESH_BINARY) binary_blured = cv2.GaussianBlur(binary, (3, 3), 0) if self.save: diff --git a/src/Active-Lane-Keeping-Assistant/main.py b/src/Active-Lane-Keeping-Assistant/main.py index 1b20920936..7ac65d4135 100644 --- a/src/Active-Lane-Keeping-Assistant/main.py +++ b/src/Active-Lane-Keeping-Assistant/main.py @@ -62,7 +62,7 @@ def run(id:str, path:str, world:World, agent:Agent, steps:int = 100, steer, throttle = agent.get_actions(detection_surface_area, error) error, detection_surface_area, img, collision_detected = world.step( steer=steer, throttle=throttle) - agent.show_error() + #agent.show_error() if save: recorder.add_image(img=img) diff --git a/src/Active-Lane-Keeping-Assistant/recorder.py b/src/Active-Lane-Keeping-Assistant/recorder.py index 043a714df5..826b34a5e1 100644 --- a/src/Active-Lane-Keeping-Assistant/recorder.py +++ b/src/Active-Lane-Keeping-Assistant/recorder.py @@ -21,7 +21,7 @@ def __init__(self, folder (str, optional): Storage location. Defaults to 'videos'. """ - self.cameraCapture = cv2.VideoCapture(0) + #self.cameraCapture = cv2.VideoCapture(0) self.height = height self.width = width self.fps = float(fps)