Main Content

plotDetection

Plot detections in trackingGlobeViewer

Since R2021b

Description

plotDetection(viewer,detections) plots detections on the tracking globe viewer.

example

plotDetection(___,frame) specifies the reference frame used to interpret the coordinates of the detections.

plotDetection(___,Name=Value) specifies options using one or more name-value arguments. For example, plotDetection(viewer,detect,Color=[1 0 0]) specifies the color of the plotted detections as the RGB triplet [1 0 0].

Examples

collapse all

Create a tracking globe viewer and specify its reference location. Specify the camera position and orientation.

refloc = [42.366978 -71.022362 50];
viewer = trackingGlobeViewer(ReferenceLocation=refloc);
campos(viewer,42.3374,-71.0605,872.7615);
camorient(viewer,[39 0 -2.7]);

Plot a Cartesian measurement of [0 100 –300] expressed in the sensor frame, which is an NED frame whose origin position is [1000 0 0] with respect to the local NED frame of the viewer. The origin of this local NED frame is the same as the reference location of the viewer.

det1 = objectDetection(0,[0 100 -300],MeasurementParameters=struct("Frame","rectangular",...
    "OriginPosition",[1000 0 0]));
plotDetection(viewer,det1,"NED");

Plot a Cartesian measurement of [0 100 350] expressed in the sensor frame, which a ENU frame whose origin position is [1000 0 0] with respect to the local ENU frame of the viewer. The origin of this local ENU frame is the same as the reference location of the viewer.

det2 = objectDetection(0,[0 100 350],MeasurementParameters= ...
    struct("Frame","rectangular", ...
    "OriginPosition",[1000 0 0], ... 
    "Orientation",eye(3)), ...
    SensorIndex=2); 
plotDetection(viewer,det2,"ENU",Color=[0.5 0.5 0]); 

Plot a Cartesian measurement expressed in the sensor frame, which overlaps the ECEF frame.

det3 = objectDetection(0,[1.5349; -4.4634; 4.2761]*1e6,MeasurementParameters= ...
    struct("Frame","rectangular", ... 
    "OriginPosition",[0 0 0], ... 
    "Orientation",eye(3)), ...
    SensorIndex=3);
plotDetection(viewer,det3,"ECEF",Color=[0 0.5 0]); 

Take a snapshot and show the results.

drawnow
snapshot(viewer)

Input Arguments

collapse all

Tracking globe viewer, specified as a trackingGlobeViewer object.1

Object detections, specified as an objectDetection object, an array of objectDetection objects, or a cell array of objectDetection objects. Alternately, you can specify detections as a structure, an array of structures, or a cell array of structures. The fields of each structure should be equivalent to the properties of the objectDetection object. Each structure must at least have the Measurement, MeasurementNoise, and SensorIndex fields.

Reference frame, specified as "NED" for north-east down, "ENU" for east-north-up, or "ECEF" for Earth-centered-Earth-fixed. When specified as "NED" or "ENU", the origin of the reference frame is at the location specified by the ReferenceLocation property of the viewer object.

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: plotDetection(viewer,detect,Color=[1 0 0])

Color of detections, specified as:

  • A 1-by-3 RGB triplet — Plot all the detections with the same color.

  • An N-by-3 matrix of RGB triplets — Plot each trajectory line with a different color. N is the number of unique SensorIndex in the detections input. In this way, you can specify different colors for detections generated from different sensors.

Version History

Introduced in R2021b

expand all


1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.