pub struct Track {
pub id: TrackId,
pub state: TrackState,
pub class_id: Option<ClassId>,
pub kalman: KalmanState,
pub score: f32,
pub time_since_update: u32,
pub hits: u32,
pub start_frame: u64,
pub frame_id: u64,
}Expand description
One tracked object with Kalman state and metadata.
Fields§
§id: TrackIdStable track identifier.
state: TrackStateCurrent lifecycle state.
class_id: Option<ClassId>Optional class label carried from the activating detection.
kalman: KalmanStateKalman filter state.
score: f32Last associated detection score.
time_since_update: u32Frames since the last successful match.
hits: u32Total frames this track has been observed.
start_frame: u64Frame index when the track was created.
frame_id: u64Frame index of the latest update.
Implementations§
Source§impl Track
impl Track
Sourcepub fn new(
id: TrackId,
rect: Rect,
score: f32,
class_id: Option<ClassId>,
frame_id: u64,
) -> Self
pub fn new( id: TrackId, rect: Rect, score: f32, class_id: Option<ClassId>, frame_id: u64, ) -> Self
Creates a new track from a detection box.
Sourcepub fn predicted_bbox(self) -> Rect
pub fn predicted_bbox(self) -> Rect
Predicted bounding box.
Sourcepub fn update(
&mut self,
rect: Rect,
score: f32,
class_id: Option<ClassId>,
frame_id: u64,
)
pub fn update( &mut self, rect: Rect, score: f32, class_id: Option<ClassId>, frame_id: u64, )
Associates a detection and marks the track as tracked.
Sourcepub fn mark_removed(&mut self)
pub fn mark_removed(&mut self)
Marks the track as removed.
Trait Implementations§
impl Copy for Track
impl StructuralPartialEq for Track
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnsafeUnpin for Track
impl UnwindSafe for Track
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more