- // create new trackers for new detections
- for (auto i : unmatched_detection){
- TrackerPtr t (new Tracker(image));
- this->trackers.push_back(t);
+
+ // handle unmatched trackers
+ for (auto t : unmatched_trackers){
+ t->updateState(image);
+ }
+
+ // handle unmatched detections - Create new trackers
+ vector<Person> inPersons;
+ for (auto i : unmatch_bbs_indices){
+ TrackerPtr new_tracker (new Tracker(image, detections[i]));
+ new_tracker->addPatch(createPatch(image, detections[i]));
+ this->trackers.push_back(new_tracker);
+ Person test; // TODO
+ inPersons.push_back(test);
+ }
+
+ // callback and notify engine - persons in
+ if (inPersons.size() > 0){
+ if (auto e = engine.lock()){
+ e->onPersonsIn(inPersons);
+ }