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

Method newFrame

tracking/src/skeleton_tracker.cpp:56–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void
57SkeletonTracker::newFrame(const SkeletonDetectionVector& detections)
58{
59 detections_.clear();
60 unassociated_detections_.clear();
61 lost_tracks_.clear();
62 new_tracks_.clear();
63 detections_ = detections;
64
65 ros::Time current_detections_time = detections_[0].getSource()->getTime();
66
67 for(std::list<open_ptrack::tracking::SkeletonTrack*>::iterator
68 it = tracks_.begin(), end = tracks_.end();
69 it != end;)
70 {
71 open_ptrack::tracking::SkeletonTrack* t = *it;
72 bool deleted = false;
73
74 if(((t->getVisibility() == SkeletonTrack::NOT_VISIBLE && (t->getSecFromLastHighConfidenceDetection(current_detections_time)) >= sec_before_old_)
75 || (!t->isValidated() && t->getSecFromFirstDetection(current_detections_time) >= sec_before_fake_)))
76 {
77 ROS_INFO_STREAM("first test: " << (t->getVisibility() == SkeletonTrack::NOT_VISIBLE && (t->getSecFromLastHighConfidenceDetection(current_detections_time)) >= sec_before_old_));
78 ROS_INFO_STREAM("is not validated and > sec_fake " << (!t->isValidated() && t->getSecFromFirstDetection(current_detections_time) >= sec_before_fake_));
79 if (debug_mode_)
80 {
81 std::cout << "Track " << t->getId() << " DELETED" << std::endl;
82 }
83 delete t;
84 it = tracks_.erase(it);
85 deleted = true;
86 }
87 else if(!t->isValidated() && t->getUpdatesWithEnoughConfidence() == detections_to_validate_)
88 {
89 t->validate();
90 if (debug_mode_)
91 {
92 std::cout << "Track " << t->getId() << " VALIDATED" << std::endl;
93 }
94 }
95 else if(t->getStatus() == SkeletonTrack::NEW && t->getSecFromFirstDetection(current_detections_time) >= sec_remain_new_)
96 {
97 t->setStatus(SkeletonTrack::NORMAL);
98 if (debug_mode_)
99 {
100 std::cout << "Track " << t->getId() << " set to NORMAL" << std::endl;
101 }
102 }
103
104 if(!deleted)
105 {
106 if(t->getStatus() == SkeletonTrack::NEW
107 && t->getVisibility() == SkeletonTrack::VISIBLE)
108 {
109 new_tracks_.push_back(t);
110 }
111 if(t->getVisibility() == SkeletonTrack::NOT_VISIBLE)
112 {
113 lost_tracks_.push_back(t);

Callers

nothing calls this directly

Calls 14

clearMethod · 0.80
getTimeMethod · 0.80
getSourceMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getVisibilityMethod · 0.45
isValidatedMethod · 0.45
getIdMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected