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 <noreply@anthropic.com>
This commit is contained in:
ChenYouYuan
2026-03-23 22:24:04 +08:00
parent 02dfab469e
commit 084e035a58

View File

@@ -158,7 +158,9 @@ std::vector<fyt::auto_aim::Armor> 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);
}