drawn_as_one

Contents

drawn_as_one#

rapidtools.processing.street_structures.drawn_as_one(first: ndarray, second: ndarray, shots: Mapping[str, tuple[ndarray, ndarray]], outlines: Mapping[str, Sequence[ndarray]], image_ids: Sequence[str], camera_tree: cKDTree, n_frames: int = 6, max_range_m: float = 40.0) → bool | None[source]#

Whether the frames in front of two wall pieces outline them as one building.

A detection outline follows a building as far as it is unbroken in the image. The garage and the entrance of one house are inside one outline in every frame that faces them; two neighbors are inside one outline only from far up the street, where one hides the yard between them, and in two outlines from in front of that yard. So the frames nearest the place where the pieces meet are asked, and one that shows each piece in an outline of its own settles it.

Parameters:
  • first – (n, 3) points of one piece (local east, north, altitude).

  • second – (m, 3) points of the other.

  • shots – Rotation matrix and camera center of every image.

  • outlines – Outlines of the class in every image.

  • image_ids – Image of every camera in camera_tree.

  • camera_tree – Tree over the camera positions (east, north).

  • n_frames – Frames asked, nearest first.

  • max_range_m – Farthest camera asked.

Returns:

bool | None – True when every frame that shows both pieces inside outlines shows them in the same one, False when a frame shows them in two, None when no frame shows both.

Example

>>> verdict = drawn_as_one(garage, entrance, labeled.shots,
...                        labeled.outlines, image_ids, camera_tree)
>>> verdict
True