itasc.tracking_ultrack.retracker¶
Constrained greedy retracker using the shared linker similarity score.
Each unlocked target cell is matched to a reference cell by the same
scoring.similarity_score (area ratio + centroid-corrected IoU - distance)
used by the linker and the Extend tool, gated only by centroid distance.
Matching is greedy best-first rather than a global minimum-cost assignment: a
target always takes its highest-scoring still-free reference. A global
linear_sum_assignment minimises the total cost and will trade a cell’s
obvious best match away to lower another cell’s cost, which in practice handed
cells a far, worse reference; best-first never does that.
Functions
|
Remap target IDs by linker similarity without changing locked targets. |
- itasc.tracking_ultrack.retracker.retrack_frame_constrained(ref_labels, target_labels, locked_target_ids, max_dist_px=50.0, reserved_ids=None, *, area_weight=1.0, iou_weight=1.0, distance_weight=0.05)[source]¶
Remap target IDs by linker similarity without changing locked targets.
Target cells whose ID is in
locked_target_idskeep their existing IDs. Those IDs, plus anyreserved_ids, are protected from assignment to unlocked target cells even if a matching reference cell exists.Unlocked target cells are matched to available reference cells greedily in descending
similarity_scoreorder: each target takes its best still-free reference. A pair is only eligible when its centroid distance is<= max_dist_px; area ratio and centroid-corrected IoU contribute as soft score terms (no hard gate), matching the Extend tool’s behaviour.