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

Method updateDetectedTracks

tracking/src/skeleton_tracker.cpp:248–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void
249SkeletonTracker::updateDetectedTracks()
250{
251 // Iterate over every track:
252 int track = 0;
253 for(std::list<open_ptrack::tracking::SkeletonTrack*>::iterator
254 it = tracks_.begin(), end = tracks_.end(); it != end; it++)
255 {
256 bool updated = false;
257 open_ptrack::tracking::SkeletonTrack* t = *it;
258
259 for(int measure = 0; measure < cost_matrix_.cols; measure++)
260 {
261 // If a detection<->track association has been found:
262 if(cost_matrix_(track, measure) == 0.0 &&
263 distance_matrix_(track, measure) <= gate_distance_)
264 {
265 open_ptrack::detection::SkeletonDetection& d = detections_[measure];
266
267 // If the detection has enough confidence in the current
268 // frame or in a recent past:
269 if ((t->getLowConfidenceConsecutiveFrames() < 10)
270 or (d.getConfidence() >
271 ((min_confidence_ + min_confidence_detections_)/2)))
272 {
273 // Update track with the associated detection:
274 bool first_update = false;
275 t->update(d.getWorldCentroid()(0),
276 d.getWorldCentroid()(1),
277 d.getWorldCentroid()(2),
278 d.getHeight(),
279 d.getDistance(), distance_matrix_(track, measure),
280 d.getConfidence(), min_confidence_,
281 min_confidence_detections_,
282 d.getSource(), d.getSkeletonMsg().joints,
283 first_update
284 );
285
286 t->setVisibility(d.isOccluded() ? SkeletonTrack::OCCLUDED :
287 SkeletonTrack::VISIBLE);
288 updated = true;
289 break;
290 }
291 }
292 }
293 if(!updated)
294 {
295 if(t->getVisibility() != SkeletonTrack::NOT_VISIBLE)
296 {
297 t->setVisibility(SkeletonTrack::NOT_VISIBLE);
298 }
299 }
300 track++;
301 }
302}
303
304void
305SkeletonTracker::createNewTracks()

Callers

nothing calls this directly

Calls 13

getWorldCentroidMethod · 0.80
getHeightMethod · 0.80
getSourceMethod · 0.80
getSkeletonMsgMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getConfidenceMethod · 0.45
updateMethod · 0.45
getDistanceMethod · 0.45
setVisibilityMethod · 0.45
isOccludedMethod · 0.45

Tested by

no test coverage detected