plotDetection
Description
plotDetection(
plots detections on the tracking globe viewer.viewer
,detections
)
plotDetection(___,
specifies
the reference frame used to interpret the coordinates of the detections.frame
)
plotDetection(___,
specifies options using one or more name-value arguments. For example,
Name=Value
)plotDetection(viewer,detect,Color=[1 0 0])
specifies the color of the
plotted detections as the RGB triplet [1 0 0]
.
Examples
Plot Detections in trackingGlobeViewer
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)
Plot Range-Only and Angle-Only Detections in trackingGlobeViewer
Create a tracking globe viewer and specify its reference location and coordinate frame. Specify the camera position and orientation.
frame = "ENU";
refloc = [42.366978 -71.022362 50];
viewer = trackingGlobeViewer(ReferenceLocation=refloc);
campos(viewer,42.3374,-71.0605,872.7615);
camorient(viewer,[39 0 -2.7]);
Create an angle-only detection with an azimuth of 0 degrees.
MP1 = struct(Frame="Spherical",HasAzimuth=true, ... HasElevation=false,HasRange=false,HasVelocity=false); det1 = objectDetection(0,0,SensorIndex=1,MeasurementParameters=MP1);
Create an angle-only detection with an azimuth of 90 degrees and an elevation of 50 degrees.
MP2 = struct(Frame="Spherical",HasAzimuth=true, ... HasElevation=true,HasRange=false,HasVelocity=false); det2 = objectDetection(0,[90; 50],SensorIndex=2,MeasurementParameters=MP2);
Create a range-only detection with a range of 1500 meters.
MP3 = struct(Frame="Spherical",HasAzimuth=false, ... HasElevation=false,HasRange=true,HasVelocity=false); det3 = objectDetection(0,1500,SensorIndex=3,MeasurementParameters=MP3);
Plot the detections using the plotDetection
object function. Specify the color for the detections from each sensor.
plotDetection(viewer,{det1,det2,det3},"ENU",Color=[1 0 0; 0 1 0; 0 0 1]);
Take a snapshot and show the results.
drawnow snapshot(viewer)
Input Arguments
viewer
— Tracking globe viewer
trackingGlobeViewer
object
Tracking globe viewer, specified as a trackingGlobeViewer
object.1
detections
— Object detections
objectDetection
object | array of objectDetection
objects | cell array of objectDetection
objects | structure | array of structures | cell array of structures
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.
frame
— Reference frame
"NED"
(default) | "ENU"
| "ECEF"
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
— Color of detections
"Auto"
(default) | RGB triplet | N-by-3 matrix of RGB triplets
Color of detections, specified as:
"Auto"
— Automatically select the color from a limited set of colors based on theSensorIndex
property or field of each detection.A 1-by-3 RGB triplet — Plot all the detections with the same color.
An N-by-3 matrix of RGB triplets — Plot detections from each sensor with a different color. N is the number of unique
SensorIndex
in thedetections
input. In this way, you can specify different colors for detections generated from different sensors.
SphereAlpha
— Transparency of range-only detection spheres
0.2
(default) | scalar in range [0, 1]
Transparency of the sphere for range-only detection plotting, specified as a scalar in the range [0, 1]. A value of 1 is fully opaque and 0 is completely transparent. Values between 0 and 1 are semitransparent.
Define a range-only detection using the objectDetection
object by specifying its
MeasurementParameters
property as a structure with these
fields. Set the:
Frame
field to"Spherical"
.HasRange
field totrue
.HasAzimuth
field tofalse
.HasElevation
field tofalse
.
See Plot Range-Only and Angle-Only Detections in trackingGlobeViewer for an example.
RayLength
— Length of ray for angle-only detections
0.2
(default) | positive scalar
Length of ray for angle-only detection plotting, specified as a positive scalar in meters.
Define an angle-only detection using the objectDetection
object by specifying its
MeasurementParameters
property as a structure with these
fields. Set the:
Frame
field as"Spherical"
.HasRange
field asfalse
.HasAzimuth
field astrue
.HasElevation
field astrue
orfalse
. When you specify this field asfalse
, the function assumes the elevation angle is 0.
See Plot Range-Only and Angle-Only Detections in trackingGlobeViewer for an example.
Version History
Introduced in R2021bR2023b: Plot range-only and angle-only detections
You can now plot range-only and angle-only detections by using the plotDetection
function of the trackingGlobeViewer
object. Additionally, you can use the two new properties,
SphereAlpha
and RayLength
, to specify the
transparency of the sphere for range-only detections and the ray length for angle-only
detections, respectively.
R2023b: Specify detection using structures
You can now specify the detections
input using structures.
R2023b: Use automatic colors for plotting detections
When plotting detections using the plotDetection
function, you can now specify the Color
name-value argument as
"Auto"
, which automatically plots detections using colors based on the
sensor IDs of the detections.
See Also
trackingGlobeViewer
| plotScenario
| plotPlatform
| plotTrajectory
| plotCoverage
| plotTrack
| clear
| snapshot
| campos
| camorient
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®.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)