Main Content

dataFormat

Structure for data format required by task-oriented tracker

Since R2024b

    Description

    trackerDF = dataFormat(tracker) returns and displays a structure detailing the required data format for the tracker object.

    example

    sensorDF = dataFormat(sensorSpec) returns and displays a structure detailing the required data format for any task-oriented tracker initialized with sensorSpec.

    example

    targetDF = dataFormat(targetSpec) returns and displays a structure detailing the required data format for any task-oriented tracker initialized with targetSpec.

    Tip

    You can use the hasTrackerInput function for targetSpec to determine if a tracker initialized with targetSpec requires additional input.

    example

    Examples

    collapse all

    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 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

    collapse all

    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

    collapse all

    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.

    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.

    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