Main Content

vision.labeler.AutomationAlgorithm Class

Namespace: vision.labeler

Interface for algorithm automation in ground truth labeling

Description

The vision.labeler.AutomationAlgorithm class specifies the interface for defining custom automation algorithms to run in the Image Labeler, Video Labeler, and Ground Truth Labeler (Automated Driving Toolbox) apps. Classes that inherit from the AutomationAlgorithm interface can be used with the automation workflow of the labeling apps to generate ground truth labels.

You can also use a custom function that creates an automation algorithm. The function, which you can specify in the labeling apps, enables you to adjust the automation parameters. For more details, see Create Automation Algorithm Function for Labeling.

The vision.labeler.AutomationAlgorithm class is a handle class.

Class Attributes

Abstract
true

For information on class attributes, see Class Attributes.

Properties

expand all

The AutomationAlgorithm class predefines this set of properties.

Ground truth data, specified as a groundTruth or groundTruthMultisignal (Automated Driving Toolbox) object. This property holds all the labels in the labeling app prior to automation.

  • For automation algorithms used in the Image Labeler or Video Labeler app, this property must be a groundTruth object.

  • For automation algorithms used in the Ground Truth Labeler (Automated Driving Toolbox) app, this property must be a groundTruthMultisignal object.

Attributes:

GetAccess
public
SetAccess
private

Label definitions selected for automation in the labeling app, specified as a structure. The labeling apps support selection of only one labeling definition per automation session. In the labeling apps, the selected label definition is highlighted in yellow in either the ROI Labels or Scene Labels pane on the left.

The structure contains these fields.

FieldDescription
Type

labelType enumeration that contains the type of label definition. Valid label types are:

  • labelType.Rectangle

  • labelType.Polygon

  • labelType.Cuboid (for point clouds)

  • labelType.ProjectedCuboid (for image and video data)

  • labelType.Line

  • labelType.PixelLabel

  • labelType.Scene

labelType.Custom is not supported.

NameCharacter vector that contains the name of the label definition.
Attributes (optional)

Structure array that contains one structure for each attribute in the label definition. If the label definition does not contain attributes, then this property does not include the Attributes field.

The first field of each attribute structure in this structure array contains the attribute name. The second field contains a structure of values that are associated with that name. If you are defining a List attribute, you must also define the list of values for that attribute. Values for Numeric Value, String, or Logical attributes are optional. Descriptions for the attributes are optional for all cases.

PixelLabelID (optional)Positive integer that contains the pixel label ID for the label definition. This PixelLabelID field applies only for label definitions of type PixelLabel.

To view a sample SelectedLabelDefinitions structure that contains an attribute, enter this code at the MATLAB® command prompt.

selectedLabelDefs.Type = labelType.Rectangle;
selectedLabelDefs.Name = 'Car';
selectedLabelDefs.Attributes = struct('distance', ...
    struct('DefaultValue',0,'Description','Sensor distance'))

To view a sample SelectedLabelDefinitions structure that contains pixel label definitions, enter this code at the MATLAB command prompt.

selectedLabelDefs.Type = labelType.PixelLabel;
selectedLabelDefs.Name = 'Car';
selectedLabelDefs.Attributes = struct('distance', ...
    struct('DefaultValue',0,'Description','Sensor distance'))

Attributes:

GetAccess
public
SetAccess
private

Valid label definitions that the algorithm can automate, specified as a structure array. Each structure in the array corresponds to a valid label definition. To determine which label definitions are valid, the app uses the checkLabelDefinition method. This table describes the fields for each valid label definition structure.

FieldDescription
Type

labelType enumeration that contains the type of label definition. Valid label types are:

  • labelType.Rectangle

  • labelType.Polygon

  • labelType.Cuboid (for point clouds)

  • labelType.ProjectedCuboid (for image and video data)

  • labelType.Line

  • labelType.PixelLabel

  • labelType.Scene

labelType.Custom is not supported.

NameCharacter vector that contains the name of the label definition.
Attributes (optional)

Structure array that contains one structure for each attribute in the label definition. If the label definition does not contain attributes, then this property does not include the Attributes field.

The first field of each attribute structure in this structure array contains the attribute name. The second field contains a structure of values that are associated with that name. If you are defining a List attribute, you must also define the list of values for that attribute. Values for Numeric Value, String, or Logical attributes are optional. Descriptions for the attributes are optional for all cases.

PixelLabelID (optional)Positive integer that contains the pixel label ID for the label definition. This PixelLabelID field applies only for label definitions of type PixelLabel.

To view a sample ValidLabelDefinitions structure that contains an attribute, enter this code at the MATLAB command prompt.

validLabelDefs(1).Type = labelType.Rectangle;
validLabelDefs(1).Name = 'Car';
validLabelDefs(2).Type = labelType.Line;
validLabelDefs(2).Name = 'LaneMarker';
validLabelDefs(3).Type = labelType.Scene
validLabelDefs(3).Name = 'Sunny';

To view a sample ValidLabelDefinitions structure that contains pixel label definitions, enter this code at the MATLAB command prompt.

validLabelDefs(1).Type = labelType.PixelLabel;
validLabelDefs(1).Name = 'Road';
validLabelDefs(1).PixelLabelID  = 1;
validLabelDefs(2).Type = labelType.PixelLabel;
validLabelDefs(2).Name = 'Sky';
validLabelDefs(2).PixelLabelID = 2

Attributes:

GetAccess
public
SetAccess
private

Index of current frame, specified as an integer. The object updates CurrentIndex while the algorithm runs. Use this index value to access the current frame ground truth data from the GroundTruth property.

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

Automation algorithm name, specified as a character vector.

Attributes:

GetAccess
public
Abstract
true
Constant
true
NonCopyable
true

Algorithm description, specified as a character vector.

Attributes:

GetAccess
public
Abstract
true
Constant
true
NonCopyable
true

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.

Attributes:

GetAccess
public
Abstract
true
Constant
true
NonCopyable
true

Methods

expand all

Version History

Introduced in R2017a