yolo roi binary box find light fix

This commit is contained in:
cyy_mac
2026-03-26 03:22:09 +08:00
parent 550414dd3b
commit 2586e793e5

View File

@@ -246,8 +246,13 @@ std::vector<fyt::auto_aim::Light> 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