addAttribute
Add attribute to label in label definition creator for lidar workflow
Since R2020b
Syntax
Description
addAttribute(
adds an attribute with the specified name and type to the indicated label. The attribute is
added to the hierarchy of the specified label in the ldc
,labelName
,attributeName
,typeOfAttribute
,attributeDefault
)labelDefinitionCreatorLidar
object
ldc
.
addAttribute(___,
specifies options using one or more name-value pair arguments in addition to the input
arguments in the previous syntax.Name,Value
)
Examples
Add Label and Attribute Using Lidar Label Definition Creator
Create an empty labelDefinitionCreatorLidar
object.
ldc = labelDefinitionCreatorLidar
ldc = labelDefinitionCreatorLidar with 0 labels. Use the
Add a Cuboid
label, Vehicle
, to the label definition creator object. Include Group
information for the label.
addLabel(ldc,'Vehicle','Cuboid','Group','Transport');
Add a Scene
label, TrafficSign
, to the object. Include Group
information for the label.
addLabel(ldc,'TrafficSign','Scene','Group','Data');
Add a Color
attribute to the Vehicle
label as a string.
addAttribute(ldc,'Vehicle','Color','String','Red');
Display the details of the updated label definition creator object.
ldc
ldc = labelDefinitionCreatorLidar contains the following labels: Vehicle with 1 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 label Vehicle
using the info
object function.
info(ldc,'Vehicle')
Name: "Vehicle" Type: {[Cuboid]} LabelColor: {''} Group: "Transport" Attributes: "Color" Description: ' '
Display information about the Color
attribute of the Vehicle
label using the info
object function.
info(ldc,'Vehicle/Color')
Name: "Color" Type: String DefaultValue: 'Red' Description: ' '
Input Arguments
ldc
— Label definition creator for lidar workflow
labelDefinitionCreatorLidar
object
Label definition creator for the lidar workflow, specified as a labelDefinitionCreatorLidar
object.
labelName
— Label name
character vector | string scalar
Label name, specified as a character vector or string scalar. This sets the label to which to add the attribute.
attributeName
— Attribute name
character vector | string scalar
Attribute name, specified as a character vector or string scalar. This sets the attribute to add to the label.
typeOfAttribute
— Type of attribute
attributeType
enumeration | character vector | string scalar
Type of attribute, specified using one of these options:
attributeType
enumeration — Specify the attribute as aNumeric
,Logical
,String
, orList
attributeType
enumerator. For example,attributeType.String
specifies aString
attribute type.
Character vector or string scalar — Specify a value that partially or fully matches one of the
attributeType
enumerators. For example,Str
specifies a String attribute type.
attributeDefault
— Default value of attribute
valid attribute value
Default value of the attribute, specified as a valid attribute value depending on
the value of the typeOfAttribute
argument:
Numeric — Specify the value as a numeric scalar.
Logical — Specify the value as a logical scalar.
String — Specify the value as a character vector or string scalar.
List — Specify the value as a cell array of character vectors or string scalars. The first element of the cell array is the default value.
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: 'Description','car'
sets the description of the added label
attribute to 'car'
.
Description
— Attribute description
' '
(default) | character vector | string scalar
Attribute description, specified as the comma-separated pair consisting of
'Description'
and a character vector or string scalar. Use this
name-value pair argument to describe the attribute.
Version History
Introduced in R2020b
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)