From 519e1078bbea80732a5f5ba5682ae96003f6027f Mon Sep 17 00:00:00 2001 From: wutong88yuyu <2179751939@qq.com> Date: Thu, 18 Dec 2025 16:21:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96carla=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Active-Lane-Keeping-Assistant/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 672f31f0a4262c436611f2d232d9e0dd6db73744 Mon Sep 17 00:00:00 2001 From: wutong88yuyu <2179751939@qq.com> Date: Thu, 18 Dec 2025 18:16:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96carla=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E8=BD=A6=E9=81=93=E7=BA=BF=E8=AF=86=E5=88=AB=E9=98=88?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Active-Lane-Keeping-Assistant/lane.py | 5 +++-- src/Active-Lane-Keeping-Assistant/recorder.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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/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)