pub trait Tracker<T: DetectionBox> {
// Required methods
fn update(&mut self, boxes: &[T], timestamp: u64) -> Vec<Option<TrackInfo>>;
fn get_active_tracks(&self) -> Vec<ActiveTrackInfo<T>>;
}Expand description
Multi-object tracker interface.
Implementations associate a stream of per-frame detection boxes into
persistent tracks. The tracker owns all internal state (tracklet filters,
timestamps, IDs) and is mutable — update takes &mut self.
§Contract
- The returned
Vecfromupdateis parallel to the inputboxesslice:result[i]isSome(info)when detectioniwas matched to a track or spawned a new one, andNonewhen it was too low-confidence to initiate or continue a track. get_active_tracksreturns every tracklet that has not yet expired, including those not matched in the most recent frame (they remain alive untilextra_lifespanelapses without a match).- Callers must not share a single
Trackeracross concurrent threads without external synchronization —updatetakes&mut self.
Required Methods§
Sourcefn update(&mut self, boxes: &[T], timestamp: u64) -> Vec<Option<TrackInfo>>
fn update(&mut self, boxes: &[T], timestamp: u64) -> Vec<Option<TrackInfo>>
Process one frame of detections and advance all internal tracklet states.
boxes is the set of detections for this frame. timestamp is a
monotonically increasing value (typically nanoseconds from a wall clock
or pipeline counter) used for tracklet expiry.
Returns a Vec<Option<TrackInfo>> of the same length as boxes.
Sourcefn get_active_tracks(&self) -> Vec<ActiveTrackInfo<T>>
fn get_active_tracks(&self) -> Vec<ActiveTrackInfo<T>>
Return all currently active tracklets, including those not matched in the most recent frame but not yet expired.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".