Cleaner
- class byotrack.implementation.refiner.cleaner.Cleaner(min_length: int, max_dist: float)
Bases:
RefinerCleaner refiner
Split tracklet when the distance between two consecutive points is greater than max_dist. And delete tracks that are shorter than min_length.
Warning
It will not split when the position of the track is NaN.
Warning
merge_id is only set on the last splitted track, which may be deleted (if too short).
- run(video, tracks: Collection[Track]) List[Track]
Run the refiner on a whole video
- Parameters:
video (Sequence[np.ndarray] | np.ndarray) – Sequence of T frames (array). Each array is expected to have a shape ([D, ]H, W, C)
tracks (Collection[byotrack.Track]) – Tracks of particles
- Returns:
Refined tracks of particles
- Return type:
Collection[byotrack.Track]
- static clean_tracks(tracks: Collection[Track], min_length: int, max_dist: float) List[Track]
Clean tracks
Split tracklet when the distance between two consecutive points is greater than max_dist. And delete tracks that are shorter than min_length.
Warning
It will not split when the position of the track is NaN.
Warning
parent_id is only set on the first splitted track, which may be deleted (if too short). merge_id is only set on the last splitted track, which may be deleted (if too short).