主要内容

filter

Filter track data from actor track data object

Since R2025a

Description

filter(trackData,TrackID=trackID) filters and updates the input actor track data object trackData using the specified actor track IDs trackID.

filter(trackData,Category=category) filters and updates the input actor track data object trackData using the specified category names of the actors category.

filter(trackData,ROI=roi) filters and updates the input actor track data object trackData using the specified region of interest roi.

filter(trackData,Orientation=orientation) filters and updates the input actor track data object trackData using the specified orientation range orientation.

filter(trackData,Dimension=dimension) filters and updates the input actor track data object trackData using the specified dimension range dimension.

filter(trackData,Velocity=velocity) filters and updates the input actor track data object trackData using the specified velocity range velocity.

filter(trackData,Age=age) filters and updates the input actor track data object trackData using the specified age range of the actor track age.

filter(trackData,Speed=speed) filters and updates the input actor track data object trackData using the specified speed range speed.

filteredTrackData = filter(___) additionally returns an ActorTrackData object, filteredTrackData, that contains filtered actor tracks.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install the Scenario Builder for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

example

Examples

collapse all

Load recorded actor track data into the workspace.

load("trackedActorData.mat")

Initialize an ActorTrackData object using the information from the loaded actor track data.

timestamps = trackedActorData.Timestamps;
trackID = trackedActorData.TrackID;
position = trackedActorData.Position;
age = trackedActorData.Age;
trackData = scenariobuilder.ActorTrackData(timestamps,trackID,position,Age=age)
trackData = 
  ActorTrackData with properties:

                Name: ''

          NumSamples: 600
            Duration: 29.9510
          SampleRate: 20.0327
          SampleTime: 0.0500
          Timestamps: [600×1 double]

             TrackID: {600×1 cell}
            Category: []
            Position: {600×1 cell}
           Dimension: []
         Orientation: []
            Velocity: []
               Speed: []
                 Age: {600×1 cell}

          Attributes: []

      UniqueTrackIDs: [18×1 string]
    UniqueCategories: []

Play the actor track data object.

play(trackData)

Filter actor tracks with ages greater than 20 and less than 100.

filteredTrackData = filter(trackData,Age=[20 100])
filteredTrackData = 
  ActorTrackData with properties:

                Name: ''

          NumSamples: 544
            Duration: 29.9007
          SampleRate: 18.1936
          SampleTime: 0.0551
          Timestamps: [544×1 double]

             TrackID: {544×1 cell}
            Category: []
            Position: {544×1 cell}
           Dimension: []
         Orientation: []
            Velocity: []
               Speed: []
                 Age: {544×1 cell}

          Attributes: []

      UniqueTrackIDs: [18×1 string]
    UniqueCategories: []

Play the filtered actor track data object.

play(filteredTrackData)

Input Arguments

collapse all

Actor track data, specified as an ActorTrackData object.

Track IDs for which to filter the track data, specified as an N-by-1 string array. N is the number of track IDs to filter.

Data Types: string

Category names for which to filter the track data, specified as an N-by-1 string array. N is the number of category names to filter.

Data Types: string

Region of interest in which to filter track data, specified as a six-element row vector of the form [xmin xmax ymin ymax zmin zmax]. Units are in meters.

The function compares the minimum and maximum xyz-coordinate values to the coordinates in the Position property of the input actor track data object trackData.

Data Types: double

Orientation range for which to filter the track data, specified as a six-element row vector of the form [yawmin yawmax pitchmin pitchmax rollmin rollmax]. Units are in degrees.

The function compares the minimum and maximum yaw, pitch, and roll values to the yaw, pitch, and roll values in the Orientation property of the input actor track data object trackData.

Data Types: double

Dimension range to filter the actors, specified as a six-element row vector in the form [lengthmin lengthmax widthmin widthmax heightmin heightmax]. Units are in meters.

Minimum and maximum length, width, and height values of actors corresponds to the Dimension property of the input actor track data object trackData.

Data Types: double

Velocity range for which to filter the track data, specified as a six-element row vector of the form [vxmin vxmax vymin vymax vzmin vzmax]. Units are in meters per second.

The function compares the minimum and maximum xyz-velocity values of actors to the length, width, and height values in the Velocity property of the input actor track data object trackData.

Data Types: double

Age range of the actor tracks for which to filter the track data, specified as a two-element row vector of positive integers of the form [agemin agemax].

The function compares the minimum and maximum age values of actor tracks to the age values in the Age property of the input actor track data object trackData.

Data Types: double

Speed range for which to filter the track data, specified as a two-element row vector of the form [speedmin speedmax]. Units are in meters per second.

The function compares the minimum and maximum speed values of actors to the speed values in the Speed property of the input actor track data object trackData.

Data Types: double

Output Arguments

collapse all

Filtered actor track data, returned as an ActorTrackData object.

Version History

Introduced in R2025a