Main Content

editAttributeDescription

Modify description of attribute in label definition creator object

Description

example

editAttributeDescription(ldc,labelName,attributeName,description) modifies the description of an attribute under the label or sublabel identified by labelName. The label or sublabel must be in the label definition creator object ldc.

Examples

collapse all

Load an existing label definitions table into the workspace.

labelDefFile = fullfile(toolboxdir('vision'), 'visiondata', 'labelDefsWithAttributes.mat');
ld = load(labelDefFile)
ld = struct with fields:
    labelDefs: [4x4 table]

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

ldc = labelDefinitionCreator(ld.labelDefs)
ldc = 
labelDefinitionCreator contains the following labels:

	Vehicle with 0 sublabels and 3 attributes and belongs to None group.	(info)
	Pedestrian with 0 sublabels and 0 attributes and belongs to None group.	(info)
	LaneMarker with 0 sublabels and 2 attributes and belongs to None group.	(info)
	TrafficLight with 1 sublabels and 0 attributes and belongs to None group.	(info)

For more details about attributes and sublabels, use the info method.

Modify the Description of Attribute Under a Label

Display information about the label "Vehicle".

info(ldc,'Vehicle')
           Name: "Vehicle"
           Type: Rectangle
     LabelColor: {''}
          Group: "None"
     Attributes: ["Class"    "Color"    "View"]
      Sublabels: []
    Description: 'Draw a tight bounding box around the vehicle. Use this label for cars, buses and trailers.'

Display information about the attribute "Color" under the label "Vehicle".

info(ldc,'Vehicle/Color')
            Name: "Color"
            Type: String
    DefaultValue: ""
     Description: 'Color of the vehicle, specified as a string, such as red, blue, white.'

Modify the description of the attribute "Color" under the label "Vehicle".

editAttributeDescription(ldc,'Vehicle','Color','Color of the vehicle, specified as a string, e.g. "red".')

Display information about the label "Vehicle" to verify the modified attribute description.

info(ldc,'Vehicle/Color')
            Name: "Color"
            Type: String
    DefaultValue: ""
     Description: 'Color of the vehicle, specified as a string, e.g. "red".'

Modify the Description of Attribute Under a Sublabel

Display information about the label "TrafficLight".

info(ldc,'TrafficLight')
           Name: "TrafficLight"
           Type: Rectangle
     LabelColor: {''}
          Group: "None"
     Attributes: []
      Sublabels: "Light"
    Description: 'Mark a tight bounding box around the traffic light. Use the sublabels to mark each individual light'

Display information about the sublabel "Light" under the label "TrafficLight".

info(ldc,'TrafficLight/Light')
           Name: "Light"
           Type: Rectangle
     Attributes: ["Active"    "Color"]
      Sublabels: []
    Description: 'Mark a tight bounding box around each light.'

Display information about the attribute "Active" under the sublabel "TrafficLight/Light".

info(ldc,'TrafficLight/Light/Active')
            Name: "Active"
            Type: Logical
    DefaultValue: 0
     Description: 'Mark true if this light is active and false if not.'

Modify the description of the attribute "Active" under the sublabel "TrafficLight/Light".

editAttributeDescription(ldc,'TrafficLight/Light','Active','Is Active: true (DefaultValue: 1), false (DefaultValue: 0)')

Display information about the attribute "Active" to verify the modified attribute description.

info(ldc,'TrafficLight/Light/Active')
            Name: "Active"
            Type: Logical
    DefaultValue: 0
     Description: 'Is Active: true (DefaultValue: 1), false (DefaultValue: 0)'

Input Arguments

collapse all

Label definition creator, specified as a labelDefinitionCreator object.

Label or sublabel name, specified as a character vector or string scalar that uniquely identifies the label or sublabel to which the attribute is associated.

  • To specify a label, use the form 'labelName'.

  • To specify a sublabel, use the form 'labelName/sublabelName'. In this case, the attribute is associated with the sublabel.

Attribute name, specified as a character vector or string scalar that identifies the attribute for which the description is to be updated.

Description, specified as a character vector or string scalar that contains the new description for the attribute identified by attributeName.

Version History

Introduced in R2018b