Contenu principal

selectLabelsByName

R2026b

(To be removed) Select ground truth data by label name

selectLabelsByName will be removed in a future release. Use the groundTruthMultiSensor object instead. For information on updating your code, see Version History.

Description

gtLabel = selectLabelsByName(gTruth,labelNames) selects ground truth data of the specified label names labelNames from a groundTruthLidar object gTruth. The function returns a corresponding groundTruthLidar object gtLabel that contains only the selected labels. If gTruth is a vector of groundTruthLidar objects, then the function returns a vector of corresponding groundTruthLidar objects that contain only the selected labels.

example

Examples

collapse all

Load a groundTruthLidar object containing labels of various groups, types, and names.

load('lidarLabelerGtruth.mat')

Inspect the label definitions. The object contains label definitions with various names.

gTruth.LabelDefinitions
ans = 4×5 table
         Name          Type            LabelColor              Group       Description
    ______________    ______    ________________________    ___________    ___________

    {'pole'      }    Cuboid    {[0.6207 0.3103 0.2759]}    {'None'   }    {0×0 char} 
    {'vegetation'}    Cuboid    {[          0 1 0.7586]}    {'None'   }    {0×0 char} 
    {'bike'      }    Cuboid    {[     0.5172 0.5172 1]}    {'vehicle'}    {0×0 char} 
    {'car'       }    Cuboid    {[0.5862 0.8276 0.3103]}    {'vehicle'}    {0×0 char} 

	Get insights using Copilot

Create a new groundTruthLidar object that contains only the label definitions with the name 'car'.

labelNames = 'car';
gtLidarLabel = selectLabelsByName(gTruth,labelNames)
gtLidarLabel = 
  groundTruthLidar with properties:

          DataSource: [1×1 vision.labeler.loading.PointCloudSequenceSource]
    LabelDefinitions: [1×5 table]
           LabelData: [4×1 timetable]

View the label definitions of the returned groundTruthLidar object.

gtLidarLabel.LabelDefinitions
ans = 1×5 table
     Name       Type            LabelColor              Group       Description
    _______    ______    ________________________    ___________    ___________

    {'car'}    Cuboid    {[0.5862 0.8276 0.3103]}    {'vehicle'}    {0×0 char} 

	Get insights using Copilot

Input Arguments

collapse all

Lidar ground truth data, specified as a groundTruthLidar object or vector of groundTruthLidar objects.

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

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

unique(gTruth.LabelDefinitions.Name)

Example: 'car'

Example: "car"

Example: {'car','lane'}

Example: ["car" "lane"]

Output Arguments

collapse all

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

Each groundTruthLidar object in gtLabel corresponds to a groundTruthLidar object in the gTruth input. The returned objects contain only the labels that are of the label names specified by the labelNames input.

Version History

Introduced in R2020b

collapse all