dataFormat
Syntax
Description
returns and displays a structure detailing the required data format for any task-oriented
tracker initialized with sensorDF
= dataFormat(sensorSpec
)sensorSpec
.
returns and displays a structure detailing the required data format for any task-oriented
tracker initialized with targetDF
= dataFormat(targetSpec
)targetSpec
.
Tip
You can use the hasTrackerInput
function for targetSpec
to determine
if a tracker initialized with targetSpec
requires additional
input.
Examples
Determine Data Format Required byTask-Oriented Tracker
Create and configure sensor specifications for a camera and a lidar mounted on an ego vehicle.
cameraSpec = trackerSensorSpec("automotive","camera","bounding-boxes"); lidarSpec = trackerSensorSpec("automotive","lidar","bounding-boxes"); configCamera(cameraSpec); configLidar(lidarSpec);
Create and configure target specifications for cars and trucks.
carSpec = trackerTargetSpec("automotive","car","highway-driving"); truckSpec = trackerTargetSpec("automotive","truck","highway-driving"); carSpec.MaxSpeed = 30; truckSpec.MaxSpeed = 20;
Create a JIPDAtracker with the sensor and target specifications
.
tracker = multiSensorTargetTracker({carSpec,truckSpec},{cameraSpec,lidarSpec},"jipda")
tracker = fusion.tracker.JIPDATracker with properties: TargetSpecifications: {[1×1 HighwayCar] [1×1 HighwayTruck]} SensorSpecifications: {[1×1 AutomotiveCameraBoxes] [1×1 AutomotiveLidarBoxes]} MaxMahalanobisDistance: 5 ConfirmationExistenceProbability: 0.9000 DeletionExistenceProbability: 0.1000
Use the dataFormat
function on the tracker
to determine the format of data required for update. The tracker is initialized with two sensor specifications, so the first two structures in the returned cell, trackerData
, correspond to the data formats required by the cameraSpec
and lidarSpec
, respectively. Additionally, the tracker needs ego motion information to compensate for ego motion in the tracks. Therefore, a third structure is returned, indicating the data format required by the target specification."
trackerData = dataFormat(tracker)
trackerData=1×3 cell array
{1×1 struct} {1×1 struct} {1×1 struct}
You can also use the dataFormat
function on the sensor specification and target specifications, and the returned structures are identical to the structures in trackerData
.
dataFormat(cameraSpec)
ans = struct with fields:
Time: 0
BoundingBox: [4×64 double]
dataFormat(lidarSpec)
ans = struct with fields:
Time: 0
BoundingBox: [9×64 double]
dataFormat(carSpec)
ans = struct with fields:
Time: 0
EgoPositionalDisplacement: [0 0 0]
EgoRotationalDisplacement: [0 0 0]
dataFormat(truckSpec)
ans = struct with fields:
Time: 0
EgoPositionalDisplacement: [0 0 0]
EgoRotationalDisplacement: [0 0 0]
Update the tracker with sensor and target data which follows the required format.
cameraData = struct("Time",1,"BoundingBox", ... [400,500;200,200;25,20;15,20]); lidarData = struct("Time",zeros(0,1),"BoundingBox",zeros(9,20)); egoData = struct("Time",1,"EgoPositionalDisplacement",[0,0,0], ... "EgoRotationalDisplacement",[0,0,0]); tracks = tracker(cameraData,lidarData,egoData)
tracks = 0×1 objectTrack array with properties: TrackID BranchID SourceIndex UpdateTime Age State StateCovariance StateParameters ObjectClassID ObjectClassProbabilities TrackLogic TrackLogicState IsConfirmed IsCoasted IsSelfReported ObjectAttributes
function configCamera(spec) spec.MaxNumMeasurements = 20; spec.MountingLocation = [2.1398 -0.3180 1.2014]; spec.MountingAngles = [0 2 0.2]; spec.WidthAccuracy = 10; spec.CenterAccuracy = 10; spec.HeightAccuracy = 5; spec.MaxRange = 120; spec.DetectionProbability = 0.95; spec.EgoOriginHeight = 0.4826; spec.Intrinsics = [1176.29501, 0. , 520.32287; 0 , 1176.28913, 389.60511; 0. , 0. , 1 ]; spec.ImageSize = [768 1024]; spec.NumFalsePositivesPerImage = 1e-2; spec.NumNewTargetsPerImage = 1e-2; end function configLidar(spec) spec.MaxNumMeasurements = 20; spec.MountingLocation = [2.12090 0.01270 1.10712]; spec.MountingAngles = [0 2 0.2]; spec.ElevationLimits = [-25 25]; spec.AzimuthLimits = [-90 90]; spec.MaxRange = 150; spec.DetectionProbability = 0.9; spec.DimensionAccuracy = 0.25; spec.CenterAccuracy = 0.25; spec.OrientationAccuracy = 5; spec.DetectionProbability = 0.9; spec.NumFalsePositivesPerScan = 2; spec.NumNewTargetsPerScan = 1; end
Create and Configure Specification for Vehicle-Mounted Camera
Create a specification for a camera mounted on an ego vehicle.
cameraSpec = trackerSensorSpec("automotive","camera","bounding-boxes")
cameraSpec = AutomotiveCameraBoxes with properties: ReferenceFrame: 'ego' MaxNumMeasurements: 64 MountingLocation: [0 0 0] m MountingAngles: [0 1 0] deg EgoOriginHeight: 0.3 m Intrinsics: [3⨯3 double] ImageSize: [480 640] pixels MaxRange: 100 m CenterAccuracy: 10 pixels HeightAccuracy: 10 pixels WidthAccuracy: 10 pixels DetectionProbability: 0.9 NumFalsePositivesPerImage: 0.01 NumNewTargetsPerImage: 0.01
Configure the camera specification based on your application. In this example, the camera of interest is mounted at [3.7920 0 1.1]
meters with respect to the ego vehicle origin and is pointing downward with a pitch angle of 1 degree. The resolution of the camera is 640 pixels in width and 480 pixels in height. Its intrinsics matrix is [800 0 320; 0 600 240; 0 0 1]
and the maximum range is 80 meters. The height of the ego vehicle frame origin with respect to ground is 0.4 meters.
cameraSpec.MountingLocation = [3.7920 0 1.1]; cameraSpec.MountingAngles = [0 1 0]; cameraSpec.ImageSize = [480 640]; cameraSpec.Intrinsics = [800 0 320 0 600 240 0 0 1]; cameraSpec.MaxRange = 80; cameraSpec.EgoOriginHeight = 0.4;
You can use the camera specification as an input to the multiSensorTargetTracker
function along with your target specifications to create a JIPDAtracker
.
carSpec = trackerTargetSpec("automotive","car","highway-driving"); tracker = multiSensorTargetTracker(carSpec,cameraSpec,"jipda")
tracker = fusion.tracker.JIPDATracker with properties: TargetSpecifications: {[1x1 HighwayCar]} SensorSpecifications: {[1x1 AutomotiveCameraBoxes]} MaxMahalanobisDistance: 5 ConfirmationExistenceProbability: 0.9000 DeletionExistenceProbability: 0.1000
Use the dataFormat
function to determine the format of inputs required by the tracker.
The camera requires bounding boxes in the image space.
cameraData = dataFormat(cameraSpec)
cameraData = struct with fields:
Time: 0
BoundingBox: [4x64 double]
Input Arguments
tracker
— Task-oriented tracker
JIPDAtracker
System object™
Task-oriented tracker, specified as a JIPDAtracker
System object. You can use the multiSensorTargetTracker
function to generate task-oriented tracker
objects.
sensorSpec
— Sensor specification
sensor specification object
Sensor specification, specified as a sensor specification object. You can use the
trackerSensorSpec
function to generate sensor specification
objects.
targetSpec
— Target specification
target specification object
Target specification, specified as a target specification object. You can use the trackerTargetSpec
function to generate target specification objects.
Output Arguments
trackerDF
— Sensor data format required by tracker
cell array of structures
Data format required by the tracker, returned as a cell array of structures. The first N structures correspond to the N sensor specifications used to initialize the tracker.
If the tracker does not require additional input for the target specification, then
trackerDF
contains N structures.If the tracker does require additional input for the target specification, then
trackerDF
contains N+1 structures, where the last structure corresponds to the target specification used to initialize the tracker.
For more information on the sensor specification data format and target
specification data format, see the sensorDF
argument and the targetDF
argument.
sensorDF
— Sensor data format required by trackers
structure
Sensor data format required by task-oriented trackers initialized with
sensorSpec
, returned as a structure. To interpret the field names
of the returned data format, see the More About section
in the sensor specification object reference pages, which are linked in the list
below.
targetDF
— Target data format required by trackers
structure
Target data format required by task-oriented trackers initialized with
sensorSpec
, returned as a structure. To interpret the field names
of the returned data format, see the More About section
in the target specification object reference pages, which are linked in the list
below.
Version History
Introduced in R2024b
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 (한국어)