register_to_image#
- rapidtools.processing.aerial_evidence.register_to_image(assets: Any, detections: Sequence[BaseGeometry], *, tie_class: str | None = None, max_distance_m: float = 3.0, radius_m: float = 40.0, min_ties: int = 3) Registration[source]#
Move objects placed from the street onto an overhead image’s positions.
The assets of
tie_class(all of them whenNone) are paired withdetectionsof the same class in the image; what the pairs around a place agree on is the survey’s shift there (seeRegistration), and every asset is moved by the shift at its own place. Each moved asset records the shift inregistration_shift_m(east and north, street minus image) and the number of tie points inregistration_ties.This is a step of its own, after detection: the street survey needs no image to place its objects, and an image taken later can still be used to line them up with it.
- Parameters:
assets – A
PhysicalAssetCollection(or any iterable of assets with ageometryandattributes) from the street survey; modified in place.detections – Overhead outlines of
tie_classin longitude and latitude.tie_class –
asset_typeof the assets to pair with the detections, such as'vehicles'.max_distance_m – Farthest pairing while the overall shift is sought.
radius_m – Tie points this close to an asset tell its shift.
min_ties – Fewest of them for a local shift.
- Returns:
Registration – The registration that was applied; it has no ties, and nothing was moved, when the two sources do not pair up.
Example
>>> registration = register_to_image( ... street_assets, car_outlines, tie_class='vehicles') >>> len(registration.ties) 212