@@ -231,7 +231,7 @@ cv::RotatedRect CTrack::CalcPredictionEllipse(cv::Size_<track_t> minRadius) cons
231231 else
232232 {
233233 rrect.center .y += d.y / 3 ;
234- rrect.angle = CV_PI / 2 .f ;
234+ rrect.angle = static_cast < float >( CV_PI / 2 .) ;
235235 }
236236 }
237237 return rrect;
@@ -419,8 +419,8 @@ void CTrack::RectUpdate(
419419 {
420420 int res = 0 ;
421421
422- if (size < 2 )
423- size = 2 ;
422+ if (size < 1 )
423+ size = 0 ;
424424
425425 if (v < 0 )
426426 {
@@ -650,11 +650,11 @@ void CTrack::RectUpdate(
650650 m_predictionRect.center.x += dx;
651651 m_predictionRect.center.y += dy;
652652#endif
653- m_outOfTheFrame = (dx != 0 ) || (dy != 0 );
653+ m_outOfTheFrame = (dx != 0 ) || (dy != 0 ) || (brect. width < 2 ) || (brect. height < 2 ) ;
654654
655655 m_predictionPoint = m_predictionRect.center ;
656656
657- // std::cout << "brect = " << brect << ", dx = " << dx << ", dy = " << dy << ", m_outOfTheFrame = " << m_outOfTheFrame << ", m_predictionPoint = " << m_predictionPoint << std::endl;
657+ // std::cout << "brect = " << brect << ", dx = " << dx << ", dy = " << dy << ", outOfTheFrame = " << m_outOfTheFrame << ", predictionPoint = " << m_predictionPoint << std::endl;
658658}
659659
660660// /
@@ -899,5 +899,7 @@ void CTrack::PointUpdate(
899899 return false ;
900900 };
901901 auto p = m_predictionPoint;
902- m_outOfTheFrame = Clamp (p.x , frameSize.width ) | Clamp (p.y , frameSize.height );
902+ m_outOfTheFrame = Clamp (p.x , frameSize.width ) || Clamp (p.y , frameSize.height ) || (m_predictionRect.size .width < 2 ) || (m_predictionRect.size .height < 2 );
903+
904+ // std::cout << "predictionRect = " << m_predictionRect.boundingRect() << ", outOfTheFrame = " << m_outOfTheFrame << ", predictionPoint = " << m_predictionPoint << std::endl;
903905}
0 commit comments