Function mosaic::find_subject#

Function Documentation#

inline const PoseSubject *mosaic::find_subject(const PoseFrame &frame, SubjectId id)#

The subject carrying id in this frame, or nullptr if that person wasn’t detected here. A linear scan: a frame holds a handful of subjects, so a per-frame index would cost more to build than it saves.

Returning nullptr for “not in this frame” is the whole point of identity keying — the old positional lookup could not tell “this person is missing” apart from “this array is shorter”, and silently borrowed whoever occupied that index instead.

First match wins if a file somehow repeats an id within one frame. run_pose.py cannot produce that (tracker ids are unique per frame and the untracked fallback is -(i+1)), so it only arises in a hand-edited or third-party file, where deterministic beats clever.