This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

labelDefinitionCreator

Object for storing, modifying and creating label definitions table

Description

The labelDefinitionCreator object stores definitions of labels, sublabels, and attributes for labeling ground truth data. Use Object Functions to add, remove, modify, or display label definitions. Using the create object function, you can create label definitions table from the labelDefinitionCreator object. You can use this label definitions table with the Ground Truth Labeler (requires Automated Driving System Toolbox™), Image Labeler, and Video Labeler apps.

Creation

Syntax

ldc = labelDefinitionCreator()
ldc = labelDefinitionCreator(labelDefs)

Description

example

ldc = labelDefinitionCreator() creates an empty label definition creator object, ldc. Add label definitions by using Object Functions. The details of the stored labels, sublabels, and attributes can be inspected using the info object function.

example

ldc = labelDefinitionCreator(labelDefs) creates a label definition creator object ldc and stores definitions from the label definitions table labelDefs. Use Object Functions to add new label definitions or modify the existing label definitions. The details of the stored labels, sublabels, and attributes can be inspected using the info object function.

Input Arguments

expand all

Label definitions, specified as a table with up to five columns. The possible columns are Name, Type, PixelLabelID, Description, and Hierarchy. This table specifies the definitions of labels, sublabels, and attributes for labeling ground truth data. For more details, see LabelDefinitions.

Output Arguments

expand all

Label definition creator, returned as a labelDefinitionCreator object that contains information about label definitions associated with ground truth data.

Note

The labelDefinitionCreator supports the Ground Truth Labeler, Image Labeler, and Video Labeler. Use of the Ground Truth Labeler requires Automated Driving System Toolbox.

Object Functions

addLabelAdd label to label definition creator object
addSublabelAdd sublabel to label in label definition creator object
addAttributeAdd attributes to label or sublabel in label definition creator object
removeLabelRemove label from label definition creator object
removeSublabelRemove sublabel from label in label definition creator object
removeAttributeRemove attribute from label or sublabel in label definition creator object
editLabelDescriptionModify description of label or sublabel in label definition creator object
editAttributeDescriptionModify description of attribute in label definition creator object
create Create label definitions table from the label definition creator object
infoDisplay information about a label, sublabel, or attribute stored in label definition creator object

Examples

collapse all

Create an empty label definition creator object.

ldc = labelDefinitionCreator()
ldc = 

labelDefinitionCreator with 0 labels. Use the addLabel method to add a label.

Add a label with the name "Vehicle" and specify the type of label as a rectangle.

addLabel(ldc,'Vehicle',labelType.Rectangle)

Add a sublabel with the name "Wheel" and an attribute with the name "Color" to the label "Vehicle" stored in ldc. Specify the type of sublabel as a rectangle and the attribute type as a string with value 'Red'.

addSublabel(ldc,'Vehicle','Wheel',labelType.Rectangle)
addAttribute(ldc,'Vehicle','Color',attributeType.String,'Red')

Display the details of the label definition creator object.

ldc
ldc = 

labelDefinitionCreator contains the following labels:

	Vehicle with 1 sublabels and 1 attributes.	(info)

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

Load an existing label definitions table into the workspace.

labelDefFile = fullfile(toolboxdir('vision'), 'visiondata', 'labelDefsWithAttributes.mat');
ld = load(labelDefFile)
ld = 

  struct with fields:

    labelDefs: [4×4 table]

Create a label definition creator object from the label definitions table. Display the details of the label definition creator object.

ldc = labelDefinitionCreator(ld.labelDefs)
ldc = 

labelDefinitionCreator contains the following labels:

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

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

Introduced in R2018b