主要内容

removeAttribute

R2026b

Remove attribute from label or sublabel in multi-sensor label definition creator

Since R2026b

Description

removeAttribute(ldc,labelName,attributeName) removes the specified attribute from the indicated label or sublabel in the labelDefinitionCreatorMultiSensor object ldc.

example

Examples

collapse all

Remove attributes from a label and a sublabel in a labelDefinitionCreatorMultiSensor object and verify the removal.

Create an empty labelDefinitionCreatorMultiSensor object.

ldc = labelDefinitionCreatorMultiSensor;

Add a label with the name "TrafficLight". Specify the type of label as "Rectangle". Adding a "Rectangle" also adds a "Cuboid" entry to the label definitions table.

addLabel(ldc,"TrafficLight","Rectangle")

Add attribute "Active" to the label. Specify the attribute type as "Logical" with the value true.

addAttribute(ldc,"TrafficLight","Active","Logical",true)

Display information about the attributes under the label "TrafficLight" using the object function info.

info(ldc,"TrafficLight")
           Name: "TrafficLight"
     SignalType: Image
      LabelType: Rectangle
          Group: "None"
     LabelColor: {''}
     Attributes: "Active"
      Sublabels: []
    Description: ' '

           Name: "TrafficLight"
     SignalType: PointCloud
      LabelType: Cuboid
          Group: "None"
     LabelColor: {''}
     Attributes: "Active"
      Sublabels: []
    Description: ' '

Remove the attribute "Active" from the label "TrafficLight".

removeAttribute(ldc,"TrafficLight","Active")

Add a sublabel called "RedLight" to the label "TrafficLight". Specify the type of the sublabel as "Rectangle".

addSublabel(ldc,"TrafficLight","RedLight","Rectangle")

Add an attribute "isOn" to the sublabel "RedLight". Specify the type for the attribute "isOn" as "Logical" with the value false.

addAttribute(ldc,"TrafficLight/RedLight","isOn","Logical",false)

Display information about the attributes under the sublabel "RedLight" in the label "TrafficLight" using the object function info.

info(ldc,"TrafficLight/RedLight")
           Name: "RedLight"
           Type: Rectangle
     LabelColor: ''
     Attributes: "isOn"
      Sublabels: []
    Description: ' '

Remove the attribute "isOn" from the sublabel "RedLight".

removeAttribute(ldc,"TrafficLight/RedLight","isOn")

Display information about the label "TrafficLight" using the object function info, to confirm that the attribute "Active" has been removed from the label definitions.

info(ldc,"TrafficLight")
           Name: "TrafficLight"
     SignalType: Image
      LabelType: Rectangle
          Group: "None"
     LabelColor: {''}
     Attributes: []
      Sublabels: "RedLight"
    Description: ' '

           Name: "TrafficLight"
     SignalType: PointCloud
      LabelType: Cuboid
          Group: "None"
     LabelColor: {''}
     Attributes: []
      Sublabels: "RedLight"
    Description: ' '

Display information about the sublabel "RedLight" in the label "TrafficLight" using the object function info, to confirm that the attribute "isOn" has been removed from the label definitions.

info(ldc,"TrafficLight/RedLight")
           Name: "RedLight"
           Type: Rectangle
     LabelColor: ''
     Attributes: []
      Sublabels: []
    Description: ' '

Input Arguments

collapse all

Label definition creator for the multi-sensor workflow, specified as a labelDefinitionCreatorMultiSensor object.

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

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

Example: removeAttribute(ldc,"TrafficLight","Active")

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

Example: removeAttribute(ldc,"TrafficLight/RedLight","isOn")

Attribute name, specified as a character vector or string scalar that identifies the attribute to be removed from the label or sublabel indicated by labelName.

Version History

Introduced in R2026b