@@ -149,39 +149,28 @@ void AsyncDetector::Process()
149149// /
150150// / \brief AsyncDetector::DrawTrack
151151// / \param frame
152- // / \param resizeCoeff
153152// / \param track
154153// / \param drawTrajectory
155154// / \param isStatic
156155// /
157156void AsyncDetector::DrawTrack (cv::Mat frame,
158- int resizeCoeff,
159157 const TrackingObject& track,
160158 bool drawTrajectory)
161159{
162- auto ResizeRect = [&](const cv::Rect& r) -> cv::Rect
163- {
164- return cv::Rect (resizeCoeff * r.x , resizeCoeff * r.y , resizeCoeff * r.width , resizeCoeff * r.height );
165- };
166- auto ResizePoint = [&](const cv::Point& pt) -> cv::Point
167- {
168- return cv::Point (resizeCoeff * pt.x , resizeCoeff * pt.y );
169- };
170-
171160 if (track.m_isStatic )
172161 {
173162#if (CV_VERSION_MAJOR >= 4)
174- cv::rectangle (frame, ResizeRect ( track.m_rrect .boundingRect () ), cv::Scalar (255 , 0 , 255 ), 2 , cv::LINE_AA);
163+ cv::rectangle (frame, track.m_rrect .boundingRect (), cv::Scalar (255 , 0 , 255 ), 2 , cv::LINE_AA);
175164#else
176- cv::rectangle (frame, ResizeRect ( track.m_rrect .boundingRect () ), cv::Scalar (255 , 0 , 255 ), 2 , CV_AA);
165+ cv::rectangle (frame, track.m_rrect .boundingRect (), cv::Scalar (255 , 0 , 255 ), 2 , CV_AA);
177166#endif
178167 }
179168 else
180169 {
181170#if (CV_VERSION_MAJOR >= 4)
182- cv::rectangle (frame, ResizeRect ( track.m_rrect .boundingRect () ), cv::Scalar (0 , 255 , 0 ), 1 , cv::LINE_AA);
171+ cv::rectangle (frame, track.m_rrect .boundingRect (), cv::Scalar (0 , 255 , 0 ), 1 , cv::LINE_AA);
183172#else
184- cv::rectangle (frame, ResizeRect ( track.m_rrect .boundingRect () ), cv::Scalar (0 , 255 , 0 ), 1 , CV_AA);
173+ cv::rectangle (frame, track.m_rrect .boundingRect (), cv::Scalar (0 , 255 , 0 ), 1 , CV_AA);
185174#endif
186175 }
187176
@@ -194,16 +183,16 @@ void AsyncDetector::DrawTrack(cv::Mat frame,
194183 const TrajectoryPoint& pt1 = track.m_trace .at (j);
195184 const TrajectoryPoint& pt2 = track.m_trace .at (j + 1 );
196185#if (CV_VERSION_MAJOR >= 4)
197- cv::line (frame, ResizePoint ( pt1.m_prediction ), ResizePoint ( pt2.m_prediction ) , cl, 1 , cv::LINE_AA);
186+ cv::line (frame, pt1.m_prediction , pt2.m_prediction , cl, 1 , cv::LINE_AA);
198187#else
199- cv::line (frame, ResizePoint ( pt1.m_prediction ), ResizePoint ( pt2.m_prediction ) , cl, 1 , CV_AA);
188+ cv::line (frame, pt1.m_prediction , pt2.m_prediction , cl, 1 , CV_AA);
200189#endif
201190 if (pt2.m_hasRaw )
202191 {
203192#if (CV_VERSION_MAJOR >= 4)
204- cv::circle (frame, ResizePoint ( pt2.m_prediction ) , 4 , cl, 4 , cv::LINE_AA);
193+ cv::circle (frame, pt2.m_prediction , 4 , cl, 4 , cv::LINE_AA);
205194#else
206- cv::circle (frame, ResizePoint ( pt2.m_prediction ) , 4 , cl, 4 , CV_AA);
195+ cv::circle (frame, pt2.m_prediction , 4 , cl, 4 , CV_AA);
207196#endif
208197 }
209198 }
@@ -229,7 +218,7 @@ void AsyncDetector::DrawData(frame_ptr frameInfo, int framesCounter, int currTim
229218 {
230219 if (track.m_isStatic )
231220 {
232- DrawTrack (frameInfo->m_frame , 1 , track, true );
221+ DrawTrack (frameInfo->m_frame , track, true );
233222 }
234223 else
235224 {
@@ -239,7 +228,7 @@ void AsyncDetector::DrawData(frame_ptr frameInfo, int framesCounter, int currTim
239228 {
240229 // std::cout << TypeConverter::Type2Str(track.m_type) << " - " << track.m_rect << std::endl;
241230
242- DrawTrack (frameInfo->m_frame , 1 , track, true );
231+ DrawTrack (frameInfo->m_frame , track, true );
243232
244233 std::string label = TypeConverter::Type2Str (track.m_type );// +": " + std::to_string(track.m_confidence);
245234 int baseLine = 0 ;
0 commit comments