merge_by_rays#
- rapidtools.processing.street_tracking.merge_by_rays(estimates: Sequence[ObjectEstimate], bearing_sigma_deg: float = 0.75, search_radius_m: float = 40.0, object_length_m: float = 5.0, weak_range_m: float = 25.0, weak_along_fraction: float = 0.3) list[ObjectEstimate][source]#
Merge estimates whose lines of sight point at the same object.
Positions of single-view fragments can be metres off along the ray, so they are not compared by position at all: a fragment joins a triangulated object when its bearings all pass within tolerance of that object’s position and in front of its cameras. The same back-check is applied to weak triangulations (see
is_weak_estimate(): never seen closer thanweak_range_m, large uncertainty or little parallax): a car triangulated from 40 m down the street, with a tree hiding half of it, lands metres along its line of sight from where the close pass put it, so instead of comparing positions its rays are checked against the well-located objects they point at, and it joins the nearest such object withinweak_along_fractionof its range along the ray. The strong object’s position is kept. Two solid triangulated estimates merge when each one’s rays pass through the other’s position and they lie within half an object length, which reunites one car seen from two sides while keeping cars parked alongside each other apart. Estimates that share a frame are never merged (two detections in one image are two objects).- Parameters:
estimates – Candidates with
raysset.bearing_sigma_deg – One-sigma bearing error.
search_radius_m – Only pairs this close are examined.
object_length_m – Typical length of the class; the tolerance uses the larger of this and the measured size.
weak_range_m – Nearest sighting beyond which a triangulation is treated like a fragment.
weak_along_fraction – How far along its line of sight, as a fraction of its nearest range (at least 4 m), a weak estimate may be from the object it joins.
- Returns:
list[ObjectEstimate] – The merged candidates.