Skip to content

tracking must operate in time (seconds), not frame counts #13

@RBhupi

Description

@RBhupi

All cost thresholds and distance bounds implicitly assume a fixed, uniform scan interval. This breaks silently when scan intervals vary,or scans are missing.

Currently, timestamps are stored on every graph node as epoch seconds and ISO8601 strings
_to_epoch_seconds() and _normalize_time_scalar() exist and correctly handle all time representations

What is broken:

  1. Cost matrix ignores elapsed time (compute_cost_matrix)
    The 4-term cost function is:
    cost = 0.4 × D_pos + 0.3 × (1 − IoU) + 0.15 × area_diff + 0.1 × refl_diff
    D_pos is normalized by the projection diagonal — a fixed spatial scale. There is no dt term. A cell that moves 20 km in 1 minute looks identical in cost to one that moves 20 km in 10 minutes. The matcher cannot distinguish normal motion from an implausible jump.

  2. No velocity estimation
    No centroid velocity is computed or stored on nodes. Motion prediction relies entirely on projected masks supplied by the projection module. If the projection is stale or absent, there is no fallback estimate of where a cell should be.

  3. Missing scan handling re-initializes everything
    If cell projections are empty or absent, all cells are treated as new births. There is no concept of keeping a track alive across a missed scan. One missed scan destroys all track continuity.

  4. All thresholds are frame-equivalent
    The configuration defaults:

Parameter Default Implicit assumption
match_cost_threshold 0.15 Fixed interval
keep_cost_threshold 1.0 Fixed interval
unmatch_cost_threshold 2.0 Fixed interval
split_overlap_threshold 0.8 Fixed interval
These values were tuned for one scan cadence. At a different interval they are wrong — too tight for long gaps, too loose for short ones.

Required changes
dt (seconds elapsed since previous scan) must be computed at the start of every track() call and passed into the cost matrix
Maximum allowable displacement must scale with dt: max_displacement_m = expected_speed_ms × dt_s
D_pos must be normalized by max_displacement_m, not by a fixed projection diagonal
A track must survive at least one missed scan before being terminated — controlled by a max_gap_seconds config parameter

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions