footprint_sightings

footprint_sightings#

rapidtools.processing.street_footprints.footprint_sightings(observations: Sequence[Observation], footprints: Sequence[Polygon], *, camera_height_m: float = 2.4, max_range_m: float = 40.0, box_height_m: float = 9.0, min_share: float = 0.5, min_cover: float = 0.2, min_visible: float = 0.2, max_views: int = 12, project: Callable[[float, float], tuple[float, float]] | None = None) → tuple[list[FootprintViews], list[int], dict[str, int]][source]#

Say which outlines show which known footprints.

See the module docstring for the method.

Parameters:
  • observations – Outlines of the class in panoramas with a computed_rotation in extra. Outlines of an image that all carry extra['instance'] are one outline per object; otherwise they are taken for a surface.

  • footprints – Footprint polygons in WGS84 longitude and latitude.

  • camera_height_m – Camera height above the ground.

  • max_range_m – Farthest footprint a frame is asked about.

  • box_height_m – Height the footprints are raised to. Generous on purpose: a box taller than the building only makes the match depend on where the building stands along the street.

  • min_share – Share of a per-object outline that must lie inside a footprint’s region to be its sighting.

  • min_cover – Share of a footprint’s region a surface outline must fill to be its sighting. The region is that of a tall box, so a one-story house fills only part of it: on a 1 km test area 0.2 found 323 of 324 houses facing the street and 0.3 only 298, with hardly more sightings that a per-object mask disputes.

  • min_visible – Share of a footprint’s box that must stay clear of nearer boxes for the frame to be asked about it.

  • max_views – Sightings kept per footprint, spread over the directions it was seen from; 0 keeps one per frame.

  • project – Projection to local meters; made from the sightings when omitted.

Returns:

tuple[list[FootprintViews], list[int], dict[str, int]] – For every footprint what was seen of it, the positions in observations of the per-object outlines that lie on no footprint (buildings the layer does not have, or objects too far to tell), and counters describing the run.

Example

>>> views, unclaimed, counts = footprint_sightings(
...     outlines, footprints, max_views=3)
>>> counts['footprints_seen'], counts['footprints']
(326, 428)