Contenido principal

removeSublabel

R2026b

Remove sublabel from label in multi-sensor label definition creator

Since R2026b

Description

removeSublabel(ldc,labelName,sublabelName) removes the specified sublabel from the indicated label. This label must be associated with the labelDefinitionCreatorMultiSensor object ldc.

Note

Removing a sublabel also removes any attributes associated with that sublabel.

example

Examples

collapse all

Remove a sublabel from a label 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" and add a description. Adding a "Rectangle" also adds a "Cuboid" entry to the label definitions table.

addLabel(ldc,"TrafficLight",labelType.Rectangle,Description="Bounding boxes for traffic light")

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

addSublabel(ldc,"TrafficLight","RedLight","Rectangle")
addSublabel(ldc,"TrafficLight","GreenLight","rect")
addSublabel(ldc,"TrafficLight","YellowLight",labelType.Rectangle)

Display information about the label "TrafficLight" using the object function info, to confirm that the sublabels have been added to the label definitions.

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

           Name: "TrafficLight"
     SignalType: PointCloud
      LabelType: Cuboid
          Group: "None"
     LabelColor: {''}
     Attributes: []
      Sublabels: ["RedLight"    "GreenLight"    "YellowLight"]
    Description: 'Bounding boxes for traffic light'

Remove the sublabel "YellowLight" from the label "TrafficLight".

removeSublabel(ldc,"TrafficLight","YellowLight")

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

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 multi-sensor workflow, specified as a labelDefinitionCreatorMultiSensor object.

Label name, specified as a character 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 removed from the indicated label labelName.

Version History

Introduced in R2026b