pub struct SingleObjectTracker { /* private fields */ }Expand description
The single-object tracker. Holds at most one track at a time.
Implementations§
Source§impl SingleObjectTracker
impl SingleObjectTracker
Sourcepub fn new(cfg: TrackerConfig) -> Self
pub fn new(cfg: TrackerConfig) -> Self
A tracker with the model-free interim appearance backend
(HistogramAppearance).
Sourcepub fn with_appearance_model(
cfg: TrackerConfig,
appearance: Box<dyn AppearanceModel>,
) -> Self
pub fn with_appearance_model( cfg: TrackerConfig, appearance: Box<dyn AppearanceModel>, ) -> Self
A tracker with a chosen appearance backend. A learned re-id /
siamese embedding implementing AppearanceModel plugs in here with no
other change.
Sourcepub fn current_id(&self) -> Option<u64>
pub fn current_id(&self) -> Option<u64>
The id the lock currently holds, if confirmed or coasting.
Sourcepub fn state(&self) -> TrackState
pub fn state(&self) -> TrackState
The lifecycle state.
Sourcepub fn needs_redesignation(&self) -> bool
pub fn needs_redesignation(&self) -> bool
True while the tracker is asking the operator to re-designate the target
because the identity could not be resolved safely (two appearance-
ambiguous candidates). Composes with an operator re-acknowledge step:
the operator layer should require an explicit re-confirm before trusting
the lock again. The flag clears on a clean re-association or an explicit
Self::redesignate.
Sourcepub fn redesignate(&mut self)
pub fn redesignate(&mut self)
Operator re-designation hook: clear the ambiguity latch (the operator has re-confirmed the target out of band). Does not move the lock; the next frame re-associates from the held state.
Sourcepub fn designate(&mut self, detection: &Detection) -> Option<u64>
pub fn designate(&mut self, detection: &Detection) -> Option<u64>
Operator designation: drop any current lock and seed a fresh track onto a
specific detection (the box the operator clicked), instead of the
most-confident one, the operator’s pick overrides the confidence floor.
Returns the new track id. The next update associates from this seed.
Used by the click-to-follow path so the operator picks the target rather
than the tracker’s auto-lock.
Sourcepub fn update(&mut self, detections: &[Detection]) -> TrackUpdate
pub fn update(&mut self, detections: &[Detection]) -> TrackUpdate
Advance one frame on a list of wire detections, motion-only (no
appearance descriptors). Each detection is wrapped as a Candidate
with no appearance, so association falls back to the motion gate plus the
class-continuity guard. Kept for callers / tests that have no descriptor
source; the appearance defence is inactive on this path.
Sourcepub fn update_with_appearance(
&mut self,
candidates: &[Candidate],
) -> TrackUpdate
pub fn update_with_appearance( &mut self, candidates: &[Candidate], ) -> TrackUpdate
Advance one frame on a list of Candidates carrying appearance
descriptors. This is the real path: the caller extracts a descriptor per
candidate from the frame pixels, or a synthetic harness
supplies one. Association is appearance-first (the most appearance-similar
admissible candidate wins; motion + confidence only break an
appearance tie), the appearance gate rejects shadowing distractors, and
the ambiguity guard refuses to silently pick between two
appearance-indistinguishable objects.