From 084e035a585364291d395f1e0947ca28a1ca9b69 Mon Sep 17 00:00:00 2001 From: ChenYouYuan Date: Mon, 23 Mar 2026 22:24:04 +0800 Subject: [PATCH] fix(armor_yolo_detect): pass full image to correctCorners for ROI detection In processROIs, armor coordinates are converted to global image coordinates before calling correctCorners. However, the function was incorrectly receiving roi_gray (ROI local image) instead of the full input image, causing coordinate system mismatch in findSymmetryAxis. This fixes corner refinement accuracy when using fitLine-based light detection in ROI-cached detection modes. Co-Authored-By: Claude Opus 4.6 --- src/rm_auto_aim/armor_yolo_detect/src/armor_yolo_detector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rm_auto_aim/armor_yolo_detect/src/armor_yolo_detector.cpp b/src/rm_auto_aim/armor_yolo_detect/src/armor_yolo_detector.cpp index 7cd8623..df75f34 100644 --- a/src/rm_auto_aim/armor_yolo_detect/src/armor_yolo_detector.cpp +++ b/src/rm_auto_aim/armor_yolo_detect/src/armor_yolo_detector.cpp @@ -158,7 +158,9 @@ std::vector Detector::processROIs( // Use armor type from traditional detection (more accurate) // Correct corners using traditional method - correctCorners(armor, gray_img); + // Note: armor coordinates are already in global image coordinates (after ROI offset was added), + // so we pass input (full image) instead of roi_gray (ROI local image) to ensure consistency + correctCorners(armor, input); result_armors.push_back(armor); }