optris::sdk::view::BlobTracker
Assigns stable IDs to blobs across frames using Kalman + Hungarian.
Public functions
BlobTracker
BlobTracker(const TrackerConfig &config={})
Build a tracker with no tracks and the next id at 1.
The default TrackerConfig assumes detections normalized 0..1 over a frame and an Update() per camera frame; a caller who runs detection every fourth frame is giving blobs four times as long to move, and wants a larger max_distance and a smaller max_age to match. One tracker follows one stream of detections -- ids are only unique within an instance, so do not interleave two cameras through one of these.
Update
std::vector< TrackedDetection > Update(const std::vector< Detection > &detections)
Match detections to existing tracks and return all active tracks.
GetTrackCount
size_t GetTrackCount() const
How many tracks are alive, in every state.
Counts Tentative and Lost tracks as well as Confirmed ones, so on a noisy frame it climbs with the noise: every unmatched detection opens a track, and it survives TrackerConfig::max_age frames before being pruned. It equals the length of the vector the last Update() returned. For "how many objects are there", which is almost always the question, use GetConfirmedCount().
GetConfirmedCount
size_t GetConfirmedCount() const
Number of tracks that reached Confirmed state.
Reset
void Reset()
Drop all tracks and reset the ID counter.
SetConfig
void SetConfig(const TrackerConfig &config)
Replace the tuning, keeping every existing track and id.
Takes effect on the next Update(), and applies only partly to what is already running: max_age, min_hits, max_distance and iou_threshold are read afresh each frame, but process_noise and measurement_noise were copied into each track's filter when it was created and are never re-read. So retuning the filter leaves current tracks behaving the old way until they die and are replaced. Call Reset() first when the new noise values need to apply immediately and renumbering is acceptable.