basetrack

A base track class to extend.

source

TrackState

 TrackState (value, names=None, module=None, qualname=None, type=None,
             start=1)

Enum class to represent the possible states of a track.

Attributes:

  • New: The initial state of the track when it’s just detected.
  • Tracked: The state when the track is being actively tracked.
  • Lost: The state when the track is lost or not detected in the current frame.
  • Removed: The state when the track is removed from the tracking system.

source

BaseTrack

 BaseTrack ()

Base class for a track in a tracking system.

This class provides the basic functionalities and properties for a track, such as its unique ID, state, history, features, and related functions. Derived classes should implement the activate, predict, and update methods.

Attributes:

  • _count (int): Class-level counter to generate unique IDs for tracks.

source

BaseTrack.end_frame

 BaseTrack.end_frame ()

Returns the current frame number as the end frame of the track.


source

BaseTrack.next_id

 BaseTrack.next_id ()

Generates and returns the next unique track ID.


source

BaseTrack.activate

 BaseTrack.activate (*args)

Activates the track. This method should be implemented by derived classes.

Raises: NotImplementedError: If the method is not implemented by derived classes.


source

BaseTrack.predict

 BaseTrack.predict ()

Predicts the next state of the track. This method should be implemented by derived classes.

Raises: NotImplementedError: If the method is not implemented by derived classes.


source

BaseTrack.update

 BaseTrack.update (*args, **kwargs)

Updates the state of the track based on new observations. This method should be implemented by derived classes.

Raises: NotImplementedError: If the method is not implemented by derived classes.


source

BaseTrack.mark_lost

 BaseTrack.mark_lost ()

Marks the track as lost.


source

BaseTrack.mark_removed

 BaseTrack.mark_removed ()

Marks the track as removed.