Plotter Metric

class stonesoup.metricgenerator.plotter.TwoDPlotter(track_indices: Tuple[int, int], gtruth_indices: Tuple[int, int], detection_indices: Tuple[int, int], uncertainty: bool = False, particle: bool = False, tracks_key: str = 'tracks', truths_key: str = 'groundtruth_paths', detections_key: str = 'detections', generator_name: str = 'tracker_plot')[source]

Bases: PlotGenerator

MetricGenerator for the plotting data

Plots of Track, Detection and GroundTruthPath objects in two dimensions.

Parameters:
  • track_indices (Tuple[int, int]) – Elements of track state vector to plot as x and y

  • gtruth_indices (Tuple[int, int]) – Elements of ground truth path state vector to plot as x and y

  • detection_indices (Tuple[int, int]) – Elements of detection state vector to plot as x and y

  • uncertainty (bool, optional) – If True the plot includes uncertainty ellipses

  • particle (bool, optional) – If True the plot includes particles

  • tracks_key (str, optional) – Key to access set of tracks added to MetricManager

  • truths_key (str, optional) – Key to access set of ground truths added to MetricManager. Or key to access a second set of tracks for track-to-track metric generation

  • detections_key (str, optional) – Key to access desired set of detections added to MetricManager

  • generator_name (str, optional) – Unique identifier to use when accessing generated plots from MultiManager

track_indices: Tuple[int, int]

Elements of track state vector to plot as x and y

gtruth_indices: Tuple[int, int]

Elements of ground truth path state vector to plot as x and y

detection_indices: Tuple[int, int]

Elements of detection state vector to plot as x and y

uncertainty: bool

If True the plot includes uncertainty ellipses

particle: bool

If True the plot includes particles

tracks_key: str

Key to access set of tracks added to MetricManager

truths_key: str

Key to access set of ground truths added to MetricManager. Or key to access a second set of tracks for track-to-track metric generation

detections_key: str

Key to access desired set of detections added to MetricManager

generator_name: str

Unique identifier to use when accessing generated plots from MultiManager

compute_metric(manager, *args, **kwargs)[source]

Compute the metric using the data in the metric manager

Parameters:

manager (MetricManager) – Containing the data to be used to create the metric(s)

Returns:

Contains a matplotlib figure

Return type:

TimeRangePlottingMetric

plot_tracks_truth_detections(tracks, groundtruth_paths, detections, uncertainty=False, particle=False, convert_measurements=True)[source]

Plots tracks, truths and detections onto a 2d matplotlib figure

Parameters:
  • tracks (list of set of Track) – Objects to be plotted as tracks

  • groundtruth_paths (set of GroundTruthPath) – Objects to be plotted as truths

  • detections (set of Detection) – Objects to be plotted as detections

  • uncertainty (bool) – If True, function plots uncertainty ellipses.

  • particle (bool) – If True, function plots particles.

  • convert_measurements (bool) – Should the measurements be converted from measurement space to state space before being plotted. Default is True

Returns:

Contains the produced plot

Return type:

TimeRangePlottingMetric