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 dataPlots of
Track
,Detection
andGroundTruthPath
objects in two dimensions.- Parameters:
track_indices (
Tuple[int, int]
) – Elements of track state vector to plot as x and ygtruth_indices (
Tuple[int, int]
) – Elements of ground truth path state vector to plot as x and ydetection_indices (
Tuple[int, int]
) – Elements of detection state vector to plot as x and yuncertainty (
bool
, optional) – If True the plot includes uncertainty ellipsesparticle (
bool
, optional) – If True the plot includes particlestracks_key (
str
, optional) – Key to access set of tracks added to MetricManagertruths_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 generationdetections_key (
str
, optional) – Key to access desired set of detections added to MetricManagergenerator_name (
str
, optional) – Unique identifier to use when accessing generated plots from MultiManager
- 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
- 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:
- 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 tracksgroundtruth_paths (set of
GroundTruthPath
) – Objects to be plotted as truthsdetections (set of
Detection
) – Objects to be plotted as detectionsuncertainty (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: