addSublabel
Add sublabel to label in label definition creator object for multisignal workflow
Since R2020a
Description
addSublabel(
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 the ldc
,labelName
,sublabelName
,typeOfSublabel
)labelDefinitionCreatorMultisignal
object ldc
.
addSublabel(___,
specifies options using one or more name-value pair arguments in addition to the input
arguments in the previous syntax.Name,Value
)
Examples
Add Sublabels to Labels in Label Definition Creator Object for Multisignal Workflow
Create an empty labelDefinitionCreatorMultisignal
object.
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 updated labelDefinitionCreatorMultisignal
object.
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 function info
.
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 function info
.
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 updated labelDefinitionCreatorMultisignal
object.
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 function info
.
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
ldc
— Label definition creator for multisignal workflow
labelDefinitionCreatorMultisignal
object
Label definition creator for the multisignal workflow, specified as a labelDefinitionCreatorMultisignal
object.
labelName
— Label name
character vector | string scalar
Label name, specified as a character vector or string scalar that uniquely identifies the label with which the sublabel is associated.
sublabelName
— Sublabel name
character vector | string scalar
Sublabel name, specified as a character vector or string scalar that identifies the sublabel to be added.
typeOfSublabel
— Type of sublabel
labelType
enumeration | character vector | string scalar
Type of sublabel, specified as one of these values:
labelType
enumeration — The type of the sublabel must be one of theselabelType
enumerators:Rectangle
orLine
.
Example: addSublabel(ldc,'Car','Wheel',labelType.Rectangle);
Character vector or string scalar — This value must partially or fully match one of these
labelType
enumerators:Rectangle
orLine
.
Example: addSublabel(ldc,'Car','Wheel','Rec');
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: addSublabel(ldc,'Car','Wheel','Rec','Description','Bounding box for
Wheel');
Description
— Sublabel description
' '
(default) | character vector | string scalar
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.
Version History
Introduced in R2020a
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)