Main Content

addLabel

Add label to label definition creator object for lidar workflow

    Description

    example

    addLabel(ldc,labelName,typeOfLabel) adds a label with the specified name and type to the labelDefinitionCreatorLidar object ldc.

    example

    addLabel(___,Name,Value) specifies options using one or more name-value pair arguments in addition to the input arguments in the previous syntax. For example, Group, truck sets the group of the added label to truck.

    Examples

    Add Labels Using Label Definition Creator for Lidar Workflow

    Create an empty labelDefinitionCreatorLidar object.

    ldc = labelDefinitionCreatorLidar;
    Add a Cuboid label, Vehicle, to the label definition creator object.

    addLabel(ldc, 'Vehicle', 'Cuboid');

    Add a Scene label, Bike, to the object.

    addLabel(ldc, 'Bike', 'Scene');

    Display the details of the updated label definition creator object.

    ldc
    ldc = 
    
    labelDefinitionCreatorLidar contains the following labels:
    
    	Vehicle with 0 attributes and belongs to None group.	(info)
    	Bike with 0 attributes and belongs to None group.	(info)
    
    For more details about attributes, use the info method.

    Display information about the Vehicle label using the info object function.

    info(ldc,'Vehicle')
               Name: "Vehicle"
               Type: Cuboid
         LabelColor: {''}
              Group: "None"
         Attributes: []
        Description: ' '

    Add Label with Additional Details

    Create an empty labelDefinitionCreatorLidar object.

    ldc = labelDefinitionCreatorLidar;
    Add a Cuboid label, Vehicle, to the label definition creator object. Include Group and LabelColor information for the label.

    addLabel(ldc, 'Vehicle', 'Cuboid','Group',"Transport",'LabelColor',[1 0 0]);

    Add a Scene label, TrafficSign, to the object. Include Group information for the label.

    addLabel(ldc, 'TrafficSign', 'Scene','Group',"Data");

    Display the details of the updated label definition creator object.

    ldc
    ldc = 
    
    labelDefinitionCreatorLidar contains the following labels:
    
    	Vehicle with 0 attributes and belongs to Transport group.	(info)
    	TrafficSign with 0 attributes and belongs to Data group.	(info)
    
    For more details about attributes, use the info method.

    Display information about the Vehicle label using the info object function.

    info(ldc,'Vehicle')
               Name: "Vehicle"
               Type: Cuboid
         LabelColor: {[1 0 0]}
              Group: "Transport"
         Attributes: []
        Description: ' '

    Input Arguments

    collapse all

    Label definition creator for the lidar workflow, specified as a labelDefinitionCreatorLidar object.

    Label name, specified as a character vector or string scalar. This sets the name of the label in the label definition creator object.

    Type of label, specified using one of these options. For example, labelType.Cuboid specifies a Cuboid label type.

    • labelType enumeration — Specify the type of label as a Scene or Cuboid labelType enumerator.

    • Character vector or string scalar — Specify a value that partially or fully matches one of the labelType enumerators. For example, Cub specifies a Cuboid label type.

    Name-Value Pair Arguments

    Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

    For example, Group, truck sets the group of the added label to truck.

    Group name, specified as a comma-separated pair consisting of 'Group' and the character vector or string scalar. Use this name-value pair arguments to specify a name for a group of labels.

    Label description, specified as a comma-separated pair consisting of 'Description' and the character vector or string scalar. Use this name-value pair arguments to describe the label.

    Introduced in R2020b