create

Create label definitions table from the label definition creator object

Description

example

labelDefs = create(ldc) creates a label definitions table, labelDefs, from the label definition creator object ldc. You can import the labelDefs table into the Ground Truth Labeler (requires Automated Driving Toolbox™), Image Labeler, and Video Labeler apps to label ground truth data.

Examples

collapse all

Create an empty label definition creator object.

ldc = labelDefinitionCreator()
ldc = 
labelDefinitionCreator

Add a label "Vehicle" to the label definition creator object. Specify the type of label as a rectangle and add a description to the label.

addLabel(ldc,'Vehicle','Rectangle','Description','Bounding box for the vehicle. Use this label for cars and buses.')

Add an attribute "IsCar" to the label "Vehicle". Specify the type of attribute as logical with value true and add description to the attribute.

addAttribute(ldc,'Vehicle','IsCar','logical',true,'Description','Type of vehicle')

Add an attribute "IsBus" to the label "Vehicle". Specify the type of attribute as logical with value false and add description to the attribute.

addAttribute(ldc,'Vehicle','IsBus','logical',false,'Description','Type of vehicle')

Create a label definitions table from the definitions stored in the label definition creator object.

labelDefs = create(ldc)
labelDefs=1×4 table
      Name         Type                                  Description                                 Hierarchy  
    _________    _________    __________________________________________________________________    ____________

    'Vehicle'    Rectangle    'Bounding box for the vehicle. Use this label for cars and buses.'    [1×1 struct]

Input Arguments

collapse all

Label definition creator, specified as a labelDefinitionCreator object. The object ldc defines the labels, sublabels, and attributes used for generating the label definitions table labelDefs.

Output Arguments

collapse all

Label definitions, returned as a table with up to five columns. The possible columns are Name, Type, PixelLabelID, Description, and Hierarchy.

Label DefinitionDescription
NameCharacter vector identifying the name of the label specified by, labelName.
TypelabelType enumeration that identifies the label type specified by, typeOfLabel
PixelLabelIDA scalar, a column vector, or an M-by-3 matrix of integer-valued label IDs. PixelLabelID specifies the pixel label values used to represent a label. PixelLabelID values must be between 0 and 255. The function creates this column, when typeOfLabel is labelType.PixelLabel.
DescriptionCharacter vector that describes the label. The default value is ' '.
HierarchyA "nested" struct containing the sublabels and the attributes. The hierarchy column is generated, when the label definition creator object contains label definitions with one or more sublabels and attributes. The function adds the sublabel as a struct with name sublabelName under the associated label. The sublabel type specified in, typeOfSublabel and the sublabel description are added as members of this struct. Similarly, an attribute is added as struct with name attributeName under the associated label or sublabel. The attribute value specified in, attributeDefault and the attribute description are added as members of the attribute struct.

For example, this figure demonstrates the organization of the label definitions table created from the label definition creator object ldc.

Note

The sublabel and the attribute properties are allowed only for label definitions table associated with the Ground Truth Labeler and the Video Labeler apps. Hence, the Hierarchy field exists only in label definitions table associated with the Ground Truth Labeler and the Video Labeler app.

Introduced in R2018b