Contenido principal

selectLabelsBySignalType

R2026b

Select multi-sensor ground truth labels by signal type

Since R2026b

Description

gtLabel = selectLabelsBySignalType(gTruth,signalTypes) selects labels of the signal types specified by signalTypes from a groundTruthMultiSensor object, gTruth. The function returns a corresponding groundTruthMultiSensor object, gtLabel, that contains only the selected labels. If gTruth is a vector of groundTruthMultiSensor objects, then the function returns a vector of corresponding groundTruthMultiSensor objects that contain only the selected labels.

example

Examples

collapse all

Select ground truth labels from a groundTruthMultiSensor object by specifying a signal type.

This example assumes you have a groundTruthMultiSensor object, gTruth, in the workspace containing ROI and scene label data for a video and corresponding lidar point cloud sequence.

Inspect the label definitions. The object contains definitions for image, point cloud, and time signals.

gTruth.LabelDefinitions
ans =

  5×7 table

      Name       SignalType    LabelType       Group        Description           LabelColor            Hierarchy
    _________    __________    _________    ____________    ___________    ________________________    ____________

    {'car'  }    Image         Rectangle    {'Vehicles'}    {0×0 char}     {[0.5862 0.8276 0.3103]}    {1×1 struct}
    {'car'  }    PointCloud    Cuboid       {'Vehicles'}    {0×0 char}     {[0.5862 0.8276 0.3103]}    {1×1 struct}
    {'truck'}    Image         Rectangle    {'Vehicles'}    {0×0 char}     {[     0.5172 0.5172 1]}    {0×0 double}
    {'truck'}    PointCloud    Cuboid       {'Vehicles'}    {0×0 char}     {[     0.5172 0.5172 1]}    {0×0 double}
    {'sunny'}    Time          Scene        {'None'    }    {0×0 char}     {[     0 0.7241 0.6552]}    {0×0 double}

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: [204×2 timetable]
                lidarSequence: [34×2 timetable]

Create a new groundTruthMultiSensor object that contains labels for only point cloud signals.

signalTypes = vision.labeler.loading.SignalType.PointCloud;
gtLabel = selectLabelsBySignalType(gTruth,signalTypes);

For the original and new objects, inspect the first five rows of label data for the lidar point cloud sequence. Because lidar signals are of type PointCloud, 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          {1×1 struct}    {1×0 struct}
    0.29926 sec    {1×1 struct}    {1×0 struct}
    0.59997 sec    {1×1 struct}    {1×0 struct}
    0.8485 sec     {1×1 struct}    {1×0 struct}
    1.1484 sec     {1×1 struct}    {1×0 struct}

       Time            car            truck
    ___________    ____________    ____________

    0 sec          {1×1 struct}    {1×0 struct}
    0.29926 sec    {1×1 struct}    {1×0 struct}
    0.59997 sec    {1×1 struct}    {1×0 struct}
    0.8485 sec     {1×1 struct}    {1×0 struct}
    1.1484 sec     {1×1 struct}    {1×0 struct}

For the original and new objects, inspect the first five rows of label data for the video. Because video signals are of type Image, 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       {1×3 struct}    {1×0 struct}
    0.05 sec    {1×3 struct}    {1×0 struct}
    0.1 sec     {1×3 struct}    {1×0 struct}
    0.15 sec    {1×3 struct}    {1×0 struct}
    0.2 sec     {1×3 struct}    {1×0 struct}

      Time
    ________

    0 sec
    0.05 sec
    0.1 sec
    0.15 sec
    0.2 sec

Input Arguments

collapse all

Multi-sensor ground truth data, specified as a groundTruthMultiSensor object or vector of groundTruthMultiSensor objects.

Signal types, specified as a vision.labeler.loading.SignalType enumeration or vector of vision.labeler.loading.SignalType enumerations.

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

unique(gTruth.LabelDefinitions.SignalType)

Example: vision.labeler.loading.SignalType.Image

Example: [vision.labeler.loading.SignalType.Image vision.labeler.loading.SignalType.PointCloud]

Output Arguments

collapse all

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

Each groundTruthMultiSensor object in gtLabel corresponds to a groundTruthMultiSensor object in the gTruth input. The returned objects contain only the labels that are of the signal types specified by the signalTypes input.

Limitations

  • Selecting sublabels by signal type is not supported.

Version History

Introduced in R2026b