Contenido principal

selectLabelsByGroupName

R2026b

Select multi-sensor ground truth by label group name

Since R2026b

Description

gtLabel = selectLabelsByGroupName(gTruth,labelGroups) selects labels belonging to the groups specified by labelGroups 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.

Examples

collapse all

Select ground truth labels from a groundTruthMultiSensor object by specifying a group name.

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 label definitions in a "Vehicles" group. Ungrouped labels are in the group named "None".

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}

Create a new groundTruthMultiSensor object that contains labels for only the "Vehicles" group.

groupNames = "Vehicles";
gtLabel = selectLabelsByGroupName(gTruth,groupNames);

For the original and new objects, inspect the ROI label data. Because "Vehicles" is the only group used for the ROI label data, the original and new object contain identical ROI label data.

gTruth.ROILabelData
gtLabel.ROILabelData
ans =

  ROILabelData with properties:

    video_01_city_c2s_fcw_10s: [204×2 timetable]
                lidarSequence: [34×2 timetable]


ans =

  ROILabelData with properties:

                lidarSequence: [34×2 timetable]
    video_01_city_c2s_fcw_10s: [204×2 timetable]

For the original and new objects, inspect the scene label data. The "None" group, which is used only in scene labels, was not selected. Therefore, the new object contains no scene label data.

gTruth.SceneLabelData
gtLabel.SceneLabelData
ans =

  SceneLabelData with properties:

    sunny: [0 sec    10.15 sec]


ans =

  SceneLabelData with properties:

    sunny: [0×0 duration]

Input Arguments

collapse all

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

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

To view all label group names in a groundTruthMultiSensor object, gTruth, enter this command at the MATLAB® command prompt.

unique(gTruth.LabelDefinitions.Group)

Example: "Vehicles"

Example: "Vehicles"

Example: {"Vehicles","Signs"}

Example: ["Vehicles" "Signs"]

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 belonging to the groups specified by the labelGroups input.

Version History

Introduced in R2026b