track_points

Contents

track_points#

rapidtools.processing.street_instances.track_points(held_by: csr_matrix, seen: ndarray, frame: ndarray, track: ndarray, min_vote_fraction: float = 0.7, min_votes: int = 3, min_frames: int = 3) → tuple[ndarray, ndarray][source]#

Assign every reconstructed point to the track it belongs to, if any.

A point is on a building when at least min_votes frames, and min_vote_fraction of the frames that see it, place it inside an outline. It belongs to the track that most of those frames outline it with. Tracks seen in fewer than min_frames frames get no points.

Returns:

tuple[np.ndarray, np.ndarray] – For every point, its track number (meaningless where the second array is False) and whether it was assigned.

Example

>>> owner, assigned = track_points(
...     held_by, seen, frame, track)
>>> int(assigned.sum())
183204