dataFormat
Syntax
Description
sensorDF = dataFormat(sensorSpec)sensorSpec.
targetDF = dataFormat(targetSpec)targetSpec.
Tip
You can use the hasTrackerInput function for targetSpec to determine
            if a tracker initialized with targetSpec requires additional
            inputs.
Examples
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"); cameraSpec = configCamera(cameraSpec); lidarSpec = 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 data format required for the 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 objects, respectively. Additionally, the tracker needs ego motion information to compensate for ego motion in the tracks. Therefore, dataFormat returns a third structure, 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 sensor and target specifications, and the structures returned by the dataFormat function are identical to the structures in trackerData.
dataFormat(cameraSpec)
ans = struct with fields:
           Time: 0
    BoundingBox: [4×20 double]
dataFormat(lidarSpec)
ans = struct with fields:
           Time: 0
    BoundingBox: [9×20 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 in the format required by the tracker object.
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 spec = 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 spec = 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 a sensor 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                  
Specify the mounting location and angles, resolution, intrinsic matrix, maximum range, and height of the ego vehicle.
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;Create a target specification for a car. Then, use the sensor specification for the camera and the target specification for the car as inputs to the multiSensorTargetTracker function to create a JIPDA tracker.
carSpec = trackerTargetSpec("automotive","car","highway-driving"); tracker = multiSensorTargetTracker(carSpec,cameraSpec,"jipda")
tracker = 
  fusion.tracker.JIPDATracker with properties:
                TargetSpecifications: {[1×1 HighwayCar]}
                SensorSpecifications: {[1×1 AutomotiveCameraBoxes]}
              MaxMahalanobisDistance: 5
    ConfirmationExistenceProbability: 0.9000
        DeletionExistenceProbability: 0.1000
Use the dataFormat function to determine the data format for the inputs required by the tracker.
The camera requires bounding boxes in the image space.
cameraData = dataFormat(cameraSpec)
cameraData = struct with fields:
           Time: 0
    BoundingBox: [4×64 double]
Input Arguments
Task-oriented tracker, specified as a JIPDATracker
            System object. You can use the multiSensorTargetTracker function to generate task-oriented tracker
            objects.
Sensor specification, specified as a sensor specification object. You can use the
              trackerSensorSpec function to generate sensor specification
            objects.
Target specification, specified as a target specification object. You can use the trackerTargetSpec function to generate target specification objects.
Output Arguments
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 inputs for target specification, then - trackerDFcontains N structures.
- If the tracker requires additional inputs for target specification, then - trackerDFcontains 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.
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 linked here.
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 linked here.
Version History
Introduced in R2024bYou can display data format for the new AerospaceBistaticRadar sensor specification.
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)