itasc.tracking_ultrack.swap_candidate¶
Functions
|
Next index when cycling an area-sorted candidate list. |
|
Return the matched node's nesting lineage around |
|
Index of the candidate whose area is closest to |
Classes
|
- class itasc.tracking_ultrack.swap_candidate.SwapCandidate(node_id, mask_2d, bbox, centroid, area)[source]¶
Bases:
object- Parameters:
- itasc.tracking_ultrack.swap_candidate.list_swap_candidates(*, db_path, frame, source_mask, frame_shape, protected_mask=None)[source]¶
Return the matched node’s nesting lineage around
source_mask.Matches
source_maskto the best-overlapping Ultrack node atframe, then walks the candidate containment lattice recorded inOverlapDB: every node that overlaps the matched node and is nested with it — a superset (larger merged segment that contains it) or a subset (smaller fragment it contains) — plus the matched node itself, returned sorted by area. Partially-overlapping neighbours (siblings/cousins) are excluded: they are different cells, so swapping onto them would relocate the cell rather than resize it.Z/Ccycle through this area-sorted lineage by index.OverlapDBis populated by both database builders (atom-union enumeration and canonical Ultrack segmentation), whereashier_parent_idis only set by the latter — so the overlap lattice is the portable source of structure.
- itasc.tracking_ultrack.swap_candidate.nearest_area_index(candidates, area)[source]¶
Index of the candidate whose area is closest to
area.Used to seed the cursor on the lineage member that best matches the currently displayed (matched) cell, so the first
Z/Cstep moves relative to it.- Return type:
- Parameters:
candidates (tuple[SwapCandidate, ...] | list[SwapCandidate])
area (int)