diff --git a/utils/detect_track.py b/utils/detect_track.py index 360bb6b..8f788ec 100644 --- a/utils/detect_track.py +++ b/utils/detect_track.py @@ -310,6 +310,12 @@ def detect_horizontal_track_edge(image, observe=False, delay=1000, save_log=True timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f") log_dir = "logs/image" os.makedirs(log_dir, exist_ok=True) + + # 保存原图 + origin_image_path = os.path.join(log_dir, f"origin_horizontal_edge_{timestamp}.jpg") + cv2.imwrite(origin_image_path, img) + info(f"保存原始图像到: {origin_image_path}", "日志") + img_path = os.path.join(log_dir, f"horizontal_edge_{timestamp}.jpg") cv2.imwrite(img_path, result_img) info(f"保存横向边缘检测结果图像到: {img_path}", "日志") @@ -819,6 +825,12 @@ def detect_left_side_track(image, observe=False, delay=1000, save_log=True): timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f") log_dir = "logs/image" os.makedirs(log_dir, exist_ok=True) + + # 保存原图 + original_img_path = os.path.join(log_dir, f"original_{timestamp}.jpg") + cv2.imwrite(original_img_path, img) + info(f"保存原始图像到: {original_img_path}", "日志") + img_path = os.path.join(log_dir, f"left_track_{timestamp}.jpg") cv2.imwrite(img_path, result_img) info(f"保存左侧轨迹线检测结果图像到: {img_path}", "日志")