Main Content

removeSublabel

Remove sublabel from label in label definition creator object for multisignal workflow

Since R2020a

Description

example

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

Note

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

Examples

collapse all

Create an empty labelDefinitionCreatorMultisignal object.

ldc = labelDefinitionCreatorMultisignal;

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 multisignal workflow, specified as a labelDefinitionCreatorMultisignal 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 R2020a