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.

vision.labeler.AutomationAlgorithm

Interface for algorithm automation in ground truth labeling

Description

AutomationAlgorithm specifies the interface for defining custom automation algorithms to run in the labeling apps, such as the Image Labeler, Video Labeler, and Ground Truth Labeler. Classes that inherit from the AutomationAlgorithm interface can be used with the automation workflow of the labeling apps to generate ground truth labels. Use of the Ground Truth Labeler requires Automated Driving Toolbox™.

Properties

expand all

The AutomationAlgorithm class predefines this set of properties.

Selected label definitions, specified as a struct array containing two or three fields. The fields specify the Type, Name, and optionally Attributes for each selected label defintion. An additional field, PixelLabelID exists for label definitions of type PixelLabel.

The fields correspond to the selected label definition in the labeling app. Selected label definitions are highlighted in yellow on the left panels titled ROI Label Definition and Scene Label Definition in the labeling app.

FieldDescription
Type

Enumeration of class labelType with possible values of Rectangle, Line, PixelLabel, or Scene. Invalid label definitions are grayed out.

The Video Labeler and Ground Truth Labeler support Rectangle, Line, PixelLabel and Scene labels. The Image Labeler supports Rectangle, PixelLabel, and Scene labels.

NameCharacter vector that contains the name of the selected label definition.
Attribute

Struct containing one field for each attribute that is part of the label definition. The value for each field describes the specifications of the attribute. The first field contains an attribute name. The second field contains the values associated with the name. The values are contained in (an additional) struct. If you are defining a List attribute, you must also define the list of values for it. Values for Numerical value, String, or Logical are optional. Descriptions for the attributes are optional for all cases. The figure shows the app interface for setting these values.

See the example below for the programmatic version.

PixelLabelID

Positive integer that holds the ID for each selected pixel label.

Note

This field is valid only for labels of type PixelLabel.

Example: Define SelectedLabelDefinitions structure array for Rectangle and Scene labels:

selectedLabelDefs(1).Name = 'Car';
selectedLabelDefs(1).Type = labelType.Rectangle;
selectedLabelDefs(1).Attributes = struct('distance',struct('DefaultValue',0,'Description','Sensor distance');
selectedLabelDefs(2).Name = 'Sunny';
selectedLabelDefs(2).Type = labelType.Scene;
selectedLabelDefs(2).Attributes = [];

Example: Define SelectedLabelDefinitions structure for PixelLabel label:

selectedLabelDefs.Name = 'Road';
selectedLabelDefs.Type = labelType.PixelLabel;
selectedLabelDefs.PixelLabelID = 2;

All valid label definitions that satisfy the checkLabelDefinition method, specified as a struct array containing these fields.

FieldDescription
TypeEnumeration of class labelType with possible values of Rectangle, Line, PixelLabel, or Scene. Invalid label definitions are grayed out.
Namecharacter vector that contains the name of the label definition
PixelLabelID

Positive integer that holds the ID for each valid pixel label

Note

This field is valid only for labels of type PixelLabel.

Ground truth of marked labels, specified as a groundTruth object. The object holds all the labels marked in the labeling app prior to automation.

Clients of AutomationAlgorithm class are required to define the following properties. These properties setup the name, description, and user instructions for your automated algorithm.

Automation algorithm name, specified as a character vector.

Algorithm description, specified as a character vector.

Algorithm directions displayed in app, specified as a cell array. UserDirections are specified as a cellstr, with each string representing a separate direction. Use the checkSetup method to verify that the directions have been adhered to.

Object Functions

Clients of an AutomationAlgorithm implement these user-defined functions to define execution of the algorithm.

checkLabelDefinitionValidate label definition
checkSetupSet up validation (optional)
initializeInitialize state for algorithm execution (optional)
runRun label automation on every frame in interval
terminateTerminate automated algorithm (optional)

Clients of an AutomationAlgorithm can also implement the user-defined settingsDialog function to display algorithm settings, or a constructor with no input arguments.

For more information on creating your own automation algorithm, see Create Automation Algorithm for Labeling.

Introduced in R2017a