Main Content

addSublabel

Add sublabel to label in label definition creator object for multisignal workflow

描述

example

addSublabel(ldc,labelName,sublabelName,typeOfSublabel)adds a sublabel with the specified name and type to the indicated label. The sublabel is added under the hierarchy for the specified label in thelabelDefinitionCreatorMultisignalobjectldc.

addSublabel(___,Name,Value)specifies options using one or more name-value pair arguments in addition to the input arguments in the previous syntax.

Examples

collapse all

Create an emptylabelDefinitionCreatorMultisignalobject.

ldc = labelDefinitionCreatorMultisignal;

Add a label with the name'Vehicle'. Specify the type as'Rectangle'. Adding a'Rectangle'also adds a'Cuboid'entry to the label definitions table.

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

Add a sublabel with the name'Wheel'to the label'Vehicle'. Specify the type of the sublabel as'Rectangle'. Add a description to the sublabel.

addSublabel(ldc,'Vehicle','Wheel','rect','Description','Bounding boxes for wheel');

Display the details of the updatedlabelDefinitionCreatorMultisignalobject.

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

Display information about the label'Vehicle'using the object functioninfo.

info(ldc,'Vehicle')
Name: "Vehicle" SignalType: Image LabelType: Rectangle Group: "None" LabelColor: {''} Attributes: [] Sublabels: "Wheel" Description: ' ' Name: "Vehicle" SignalType: PointCloud LabelType: Cuboid Group: "None" LabelColor: {''} Attributes: [] Sublabels: "Wheel" Description: ' '

Display information about the sublabel'Wheel'in the label'Vehicle'using the object functioninfo.

info(ldc,'Vehicle/Wheel')
Name: "Wheel" Type: Rectangle LabelColor: '' Attributes: [] Sublabels: [] Description: 'Bounding boxes for wheel'

Add another label with the name'TrafficLight'. Specify the type as'Rectangle'. Add a description to the label.

addLabel(ldc,'TrafficLight','Rectangle','Description','Bounding boxes for traffic light');

Add sublabels called'RedLight'and'GreenLight'to the label'TrafficLight'. Specify the type of the sublabels as'Rectangle'.

addSublabel(ldc,'TrafficLight','RedLight','Rectangle'); addSublabel(ldc,'TrafficLight','GreenLight','Rectangle');

Display the details of the updatedlabelDefinitionCreatorMultisignalobject.

ldc
ldc = labelDefinitionCreatorMultisignal contains the following labels: Vehicle with 1 sublabels and 0 attributes and belongs to None group. (info) TrafficLight with 2 sublabels and 0 attributes and belongs to None group. (info) For more details about attributes and sublabels, use the info method.

Display information about the label'TrafficLight'using the object functioninfo.

info(ldc,'TrafficLight')
Name: "TrafficLight" SignalType: Image LabelType: Rectangle Group: "None" LabelColor: {''} Attributes: [] Sublabels: ["RedLight" "GreenLight"] Description: 'Bounding boxes for traffic light' Name: "TrafficLight" SignalType: PointCloud LabelType: Cuboid Group: "None" LabelColor: {''} Attributes: [] Sublabels: ["RedLight" "GreenLight"] Description: 'Bounding boxes for traffic light'

Input Arguments

collapse all

Label definition creator for the multisignal workflow, specified as alabelDefinitionCreatorMultisignalobject.

标签名称,指定为一个角色vector or string scalar that uniquely identifies the label with which the sublabel is associated.

Sublabel name, specified as a character vector or string scalar that identifies the sublabel to be added.

Type of sublabel, specified as one of these values:

  • labelTypeenumeration — The type of the sublabel must be one of theselabelTypeenumerators:RectangleorLine.

Example:addSublabel(ldc,'Car','Wheel',labelType.Rectangle);

  • Character vector or string scalar — This value must partially or fully match one of theselabelTypeenumerators:RectangleorLine.

Example:addSublabel(ldc,'Car','Wheel','Rec');

Name-Value Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

Example:addSublabel(ldc,'Car','Wheel','Rec','Description','Bounding box for Wheel');

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

Introduced in R2020a