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