label_points

Contents

label_points#

rapidtools.processing.street_structures.label_points(observations: Sequence[Observation], clusters: Mapping[str, tuple[str, str]], project: Callable[[float, float], tuple[float, float]], *, cache_dir: str | Path | None = None, camera_height_m: float = 2.4, max_range_m: float = 40.0, min_vote_fraction: float = 0.7, min_votes: int = 3, max_workers: int = 8, loader: Callable[[str, str], PointCloud | None] | None = None, counts: dict[str, int] | None = None) → LabeledPoints[source]#

Vote: keep the reconstructed points most frames place on the class.

Every point of every cluster is projected into each of the cluster’s frames within max_range_m and counts a hit when it lands inside an outline. A point is kept with at least min_votes hits that make up min_vote_fraction of the frames in range.

Parameters:
  • observations – Sightings of the class.

  • clusters – (cluster_id, url) of the point cloud of every image.

  • project – Projection from longitude and latitude to local meters.

  • cache_dir – Folder where downloaded point clouds are cached.

  • camera_height_m – Camera height above the road.

  • max_range_m – Farthest a frame votes on a point.

  • min_vote_fraction – Share of frames in range that must agree.

  • min_votes – Frames that must agree.

  • max_workers – Threads for point-cloud downloads.

  • loader – loader(cluster_id, url) used instead of downloading.

  • counts – Counters to add to (clusters, frames, points, …).

Returns:

LabeledPoints – The kept points with the poses of the frames used.

Example

>>> labeled = label_points(sightings, clusters, project)
>>> labeled.rows.shape
(81531, 4)