add save ori
This commit is contained in:
parent
c3fe5e69d1
commit
234e11eadc
@ -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")
|
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f")
|
||||||
log_dir = "logs/image"
|
log_dir = "logs/image"
|
||||||
os.makedirs(log_dir, exist_ok=True)
|
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")
|
img_path = os.path.join(log_dir, f"horizontal_edge_{timestamp}.jpg")
|
||||||
cv2.imwrite(img_path, result_img)
|
cv2.imwrite(img_path, result_img)
|
||||||
info(f"保存横向边缘检测结果图像到: {img_path}", "日志")
|
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")
|
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f")
|
||||||
log_dir = "logs/image"
|
log_dir = "logs/image"
|
||||||
os.makedirs(log_dir, exist_ok=True)
|
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")
|
img_path = os.path.join(log_dir, f"left_track_{timestamp}.jpg")
|
||||||
cv2.imwrite(img_path, result_img)
|
cv2.imwrite(img_path, result_img)
|
||||||
info(f"保存左侧轨迹线检测结果图像到: {img_path}", "日志")
|
info(f"保存左侧轨迹线检测结果图像到: {img_path}", "日志")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user