\brief CTrack::Update \param region \param dataCorrect \param maxTraceLength \param prevFrame \param currFrame \param trajLen
| 255 | /// \param trajLen |
| 256 | /// |
| 257 | void CTrack::Update(const CRegion& region, |
| 258 | bool dataCorrect, |
| 259 | double maxTraceLength, |
| 260 | cv::UMat prevFrame, |
| 261 | cv::UMat currFrame, |
| 262 | int trajLen, int maxSpeedForStatic, |
| 263 | time_point_t currTime) |
| 264 | { |
| 265 | //std::cout << "CTrack::Update: dataCorrect = " << dataCorrect << ", m_predictionRect: " << m_predictionRect.center << ", " << m_predictionRect.angle << ", " << m_predictionRect.size << std::endl; |
| 266 | |
| 267 | if (dataCorrect) |
| 268 | { |
| 269 | if (region.m_type == m_currType) |
| 270 | { |
| 271 | m_anotherTypeCounter = 0; |
| 272 | m_lastType = region.m_type; |
| 273 | } |
| 274 | else |
| 275 | { |
| 276 | if (region.m_type == m_lastType) |
| 277 | { |
| 278 | ++m_anotherTypeCounter; |
| 279 | if (m_anotherTypeCounter > m_changeTypeThreshold) |
| 280 | { |
| 281 | m_currType = region.m_type; |
| 282 | m_anotherTypeCounter = 0; |
| 283 | } |
| 284 | } |
| 285 | else |
| 286 | { |
| 287 | m_lastType = region.m_type; |
| 288 | m_anotherTypeCounter = 0; |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | switch (m_filterGoal) |
| 294 | { |
| 295 | case tracking::FilterGoal::FilterCenter: |
| 296 | PointUpdate(region.m_rrect.center, region.m_rrect.size, region.m_rrect.angle, dataCorrect, currFrame.size()); |
| 297 | break; |
| 298 | case tracking::FilterGoal::FilterRect: |
| 299 | RectUpdate(region, dataCorrect, prevFrame, currFrame); |
| 300 | break; |
| 301 | case tracking::FilterGoal::FilterRRect: |
| 302 | RectUpdate(region, dataCorrect, prevFrame, currFrame); |
| 303 | break; |
| 304 | }; |
| 305 | |
| 306 | if (dataCorrect) |
| 307 | { |
| 308 | //std::cout << m_lastRegion.m_brect << " - " << region.m_brect << std::endl; |
| 309 | |
| 310 | m_lastRegion = region; |
| 311 | m_trace.push_back(m_predictionPoint, region.m_rrect.center, currTime); |
| 312 | |
| 313 | CheckStatic(trajLen, currFrame, region, maxSpeedForStatic, currTime); |
| 314 | } |
no test coverage detected