Gater

class stonesoup.gater.base.Gater(hypothesiser)[source]

Bases: stonesoup.hypothesiser.base.Hypothesiser

Gater base class

Gaters wrap Hypothesiser objects and can be used to modify (typically reduce) the returned hypotheses.

Parameters

hypothesiser (Union[Hypothesiser, ForwardRef('Gater')]) – Hypothesiser or Gater that is being wrapped.

hypothesiser: Union[stonesoup.hypothesiser.base.Hypothesiser, stonesoup.gater.base.Gater]

Hypothesiser or Gater that is being wrapped.

Distance

class stonesoup.gater.distance.DistanceGater(hypothesiser, measure, gate_threshold)[source]

Bases: stonesoup.gater.base.Gater

Distance based gater

Uses a measure to calculate the distance between a hypothesis’ measurement prediction and the hypothised measurement, then removes any hypotheses whose calculated distance exceeds the specified gate threshold.

Parameters
  • hypothesiser (Union[Hypothesiser, ForwardRef('Gater')]) – Hypothesiser or Gater that is being wrapped.

  • measure (Measure) – Measure class used to calculate the distance between the measurement prediction and the hypothesised measurement.

  • gate_threshold (float) – The gate threshold. Hypotheses whose calculated distance exceeds this threshold will be filtered out.

measure: stonesoup.measures.Measure

Measure class used to calculate the distance between the measurement prediction and the hypothesised measurement.

gate_threshold: float

The gate threshold. Hypotheses whose calculated distance exceeds this threshold will be filtered out.

hypothesise(track, detections, *args, **kwargs)[source]

Hypothesise track and detection association

Parameters
  • track (Track) – Track which hypotheses will be generated for.

  • detections – Detections used to generate hypotheses.

Returns

Ordered sequence of “best” to “worse” hypothesis.

Return type

sequence of Hypothesis

Filtered

class stonesoup.gater.filtered.FilteredDetectionsGater(hypothesiser, metadata_filter, match_missing=True)[source]

Bases: stonesoup.gater.base.Gater

Wrapper for Hypothesisers - filters input data

Wrapper for any type of hypothesiser - filters the ‘detections’ before they are fed into the hypothesiser.

Parameters
  • hypothesiser (Union[Hypothesiser, ForwardRef('Gater')]) – Hypothesiser or Gater that is being wrapped.

  • metadata_filter (str) – Metadata attribute used to filter which detections tracks are valid for association.

  • match_missing (bool, optional) – Match detections with missing metadata. Default ‘True’.

metadata_filter: str

Metadata attribute used to filter which detections tracks are valid for association.

match_missing: bool

Match detections with missing metadata. Default ‘True’.

hypothesise(track, detections, *args, **kwargs)[source]
Parameters
  • track (Track) – A track that contains the target’s state

  • detections (list of Detection) – Retrieved measurements

Returns

  • MultipleHypothesis – A list containing the hypotheses between each prediction-detections pair.

  • Note (The specific subclass of SingleHypothesis returned) – depends on the Hypothesiser used.