From 2586e793e52ac4d8ece81375190e75cc913848b8 Mon Sep 17 00:00:00 2001 From: cyy_mac Date: Thu, 26 Mar 2026 03:22:09 +0800 Subject: [PATCH] yolo roi binary box find light fix --- .../armor_yolo_detect/src/armor_yolo_detector.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 e3cbb11..49a88b0 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 @@ -246,8 +246,13 @@ std::vector Detector::findLightsInROI( light.center += cv::Point2f(roi.x, roi.y); light.top += cv::Point2f(roi.x, roi.y); light.bottom += cv::Point2f(roi.x, roi.y); - // Also update the RotatedRect center - light.center = light.center; // Already updated above + // Also update the RotatedRect center for correct points() calculation + cv::Point2f new_center = light.center; + cv::Size2f sz = light.size; + float ang = light.angle; + light = fyt::auto_aim::Light( + cv::RotatedRect(new_center, sz, ang), + light.top, light.bottom, light.length, light.width); if (isLight(light)) { // Color detection within ROI