sort
sort copied to clipboard
Logic Error? trk.hit_streak >=self.min_hits, ret.append(...)
https://github.com/abewley/sort/blob/da0fe4d20ff3ca1c7bad3f746fa79e3c97421bf2/sort.py#L245
Shouldn't the ret.append(...) function only be called when trk.hit_streak is greater than or equal to self.min_hits?
Because the self.frame_counter value starts at 1 and is always less than or equal to self.min_hits, therefore the ret.append(...) function will always be called because trk.time_since_update < 1 is also true.
I now use only:
if (trk.hit_streak >= self.min_hits):
This gives me the possibility that the trk is only returned if it has really succeeded in achieving the required min_hits.