leon 2 månader sedan
förälder
incheckning
2aac46181f
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      src/nodes/analyze/function/cross.cpp

+ 1 - 1
src/nodes/analyze/function/cross.cpp

@@ -10,7 +10,7 @@ data::BoxArray person_cross_line(const data::BoxArray& boxes, const cv::Point& l
     {
         cv::Point bottom_center((box.left + box.right) / 2, box.bottom);
         // > 0 代表在线段的左侧
-        if ((center.x - line_start.x) * (line_end.y - line_start.y) - (center.y - line_start.y) * (line_end.x - line_start.x) > 0)
+        if ((bottom_center.x - line_start.x) * (line_end.y - line_start.y) - (bottom_center.y - line_start.y) * (line_end.x - line_start.x) > 0)
         {
             if (person_side.find(box.class_id) == person_side.end())
             {