MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / updateDetectedTracks

Method updateDetectedTracks

tracking/src/tracker_object.cpp:390–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void
391TrackerObject::updateDetectedTracks()
392{
393 // std::cout << "Munkres output matrix:" << std::endl;
394 // for(int row = 0; row < cost_matrix_.rows; row++) {
395 // for(int col = 0; col < cost_matrix_.cols; col++) {
396 // std::cout.width(1);
397 // std::cout << cost_matrix_(row,col) << ",";
398 // }
399 // std::cout << std::endl;
400 // }
401 // std::cout << std::endl;
402
403 // Iterate over every track:
404 int track = 0;
405 for(std::list<open_ptrack::tracking::TrackObject*>::iterator it = tracks_.begin(); it != tracks_.end(); it++)
406 {
407 bool updated = false;
408 open_ptrack::tracking::TrackObject* t = *it;
409
410 for(int measure = 0; measure < cost_matrix_.cols; measure++)
411 {
412 // If a detection<->track association has been found:
413 if(cost_matrix_(track, measure) == 0.0 && distance_matrix_(track, measure) <= gate_distance_)
414 {
415
416
417 open_ptrack::detection::Detection& d = detections_[measure];
418
419 // If the detection has enough confidence in the current frame or in a recent past:
420 // if ((t->getLowConfidenceConsecutiveFrames() < 10) || ((d.getConfidence() - 0.5) > min_confidence_detections_))
421 if ((t->getLowConfidenceConsecutiveFrames() < 10) || (d.getConfidence() > ((min_confidence_ + min_confidence_detections_)/2)))
422 {
423 //for object tracking
424 association_for_initialize_objectnames_.push_back(measure);
425
426
427 // Update track with the associated detection:
428 bool first_update = false;
429
430 t->update(d.getWorldCentroid()(0), d.getWorldCentroid()(1), d.getWorldCentroid()(2),d.getWorldCentroid()(2),
431 d.getDistance(),d.getObjectName(), distance_matrix_(track, measure),
432 d.getConfidence(), min_confidence_, min_confidence_detections_,
433 d.getSource(), first_update);
434
435 t->setVisibility(d.isOccluded() ? TrackObject::OCCLUDED : TrackObject::VISIBLE);
436 updated = true;
437 break;
438 }
439 else
440 {
441 //std::cout << "Id: " << t->getId() << ", lowConfConsFrames: " << t->getLowConfidenceConsecutiveFrames() << ", newConf: " << d.getConfidence()<< std::endl;
442 }
443 }
444 }
445 if(!updated)
446 {
447 if(t->getVisibility() != TrackObject::NOT_VISIBLE)

Callers

nothing calls this directly

Calls 12

getWorldCentroidMethod · 0.80
getSourceMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getConfidenceMethod · 0.45
updateMethod · 0.45
getDistanceMethod · 0.45
getObjectNameMethod · 0.45
setVisibilityMethod · 0.45
isOccludedMethod · 0.45
getVisibilityMethod · 0.45

Tested by

no test coverage detected