Main Content

selectLabelsBySignalName

Select multisignal ground truth by signal name

Since R2020a

Description

gtLabel = selectLabelsBySignalName(gTruth,signalNames) selects labels for the signals specified by signalNames from a groundTruthMultisignal object, gTruth. The function returns a corresponding groundTruthMultisignal object, gtLabel, that contains only the selected labels. If gTruth is a vector of groundTruthMultisignal objects, then the function returns a vector of corresponding groundTruthMultisignal objects that contain only the selected labels.

example

Examples

collapse all

Select ground truth labels from a groundTruthMultisignal object by specifying a signal name.

Load a groundTruthMultisignal object containing ROI and scene label data for a video and corresponding lidar point cloud sequence. The helper function used to load this object is attached to the example as a supporting file.

gTruth = helperLoadGTruthVideoLidar;

Inspect the ROI labels. The object contains labels for the lidar point cloud sequence and the video.

gTruth.ROILabelData
ans = 

  ROILabelData with properties:

    video_01_city_c2s_fcw_10s: [204x2 timetable]
                lidarSequence: [34x2 timetable]

Create a new groundTruthMultisignal object that contains labels for only the lidarSequence signal.

signalNames = "lidarSequence";
gtLabel = selectLabelsBySignalName(gTruth,signalNames);

For the original and new objects, inspect the first five rows of label data for the lidar point cloud sequence. The new object contains the same label data for the lidar sequence as the original object.

lidarLabels = gTruth.ROILabelData.lidarSequence;
lidarLabelsSelection = gtLabel.ROILabelData.lidarSequence;

numrows = 5;
head(lidarLabels,numrows)
head(lidarLabelsSelection,numrows)
       Time            car            truck    
    ___________    ____________    ____________

    0 sec          {1x1 struct}    {1x0 struct}
    0.29926 sec    {1x1 struct}    {1x0 struct}
    0.59997 sec    {1x1 struct}    {1x0 struct}
    0.8485 sec     {1x1 struct}    {1x0 struct}
    1.1484 sec     {1x1 struct}    {1x0 struct}

       Time            car            truck    
    ___________    ____________    ____________

    0 sec          {1x1 struct}    {1x0 struct}
    0.29926 sec    {1x1 struct}    {1x0 struct}
    0.59997 sec    {1x1 struct}    {1x0 struct}
    0.8485 sec     {1x1 struct}    {1x0 struct}
    1.1484 sec     {1x1 struct}    {1x0 struct}

For the original and new objects, inspect the first five rows of label data for the video. The new object contains no label data for the video.

videoLabels = gTruth.ROILabelData.video_01_city_c2s_fcw_10s;
videoLabelsSelection = gtLabel.ROILabelData.video_01_city_c2s_fcw_10s;

head(videoLabels,numrows)
head(videoLabelsSelection,numrows)
      Time          car            truck    
    ________    ____________    ____________

    0 sec       {1x3 struct}    {1x0 struct}
    0.05 sec    {1x3 struct}    {1x0 struct}
    0.1 sec     {1x3 struct}    {1x0 struct}
    0.15 sec    {1x3 struct}    {1x0 struct}
    0.2 sec     {1x3 struct}    {1x0 struct}

      Time  
    ________

    0 sec
    0.05 sec
    0.1 sec
    0.15 sec
    0.2 sec

Input Arguments

collapse all

Multisignal ground truth data, specified as a groundTruthMultisignal object or vector of groundTruthMultisignal objects.

Signal names, specified as a character vector, string scalar, cell array of character vectors, or string vector.

To view all signal names in a groundTruthMultisignal object, gTruth, enter this command at the MATLAB® command prompt.

gTruth.DataSource.SignalName

Example: 'lidarSequence'

Example: "lidarSequence"

Example: {'lidarSequence','imageSequence'}

Example: ["lidarSequence" "imageSequence"]

Output Arguments

collapse all

Ground truth with only the selected labels, returned as a groundTruthMultisignal object or vector of groundTruthMultisignal objects.

Each groundTruthMultisignal object in gtLabel corresponds to a groundTruthMultisignal object in the gTruth input. The returned objects contain only the labels with signal names specified by the signalNames input.

Version History

Introduced in R2020a