Main Content

checkSignalType

Class: vision.labeler.AutomationAlgorithm
Namespace: vision.labeler

Validate signal type

Since R2020a

Description

In the labeling apps, the checkSignalType method validates whether each signal selected for automation supports the signal type relevant to the automation algorithm.

  • Algorithms that automate the labeling of image collections, videos, or image sequences support signals of type Image only.

  • Algorithms that automate the labeling of lidar point clouds support signals of type PointCloud only.

The implementation of this method depends on which labeling app the automation algorithm is being used with.

Labeling App of Automation AlgorithmcheckSignalType Implementation

Image Labeler

Video Labeler

You do not need to implement this method. By default, this method validates that the signal being automated is of type Image, which is the only signal type that these apps support.

Ground Truth Labeler (Automated Driving Toolbox)

Update this method to validate whether the automation algorithm supports Image signals, PointCloud signals, or both types of signals.

Lidar Labeler (Lidar Toolbox)

You do not need to implement this method. If you do implement this method, update it to validate that the signal is of type PointCloud, which is the only signal type that this app supports.

example

isValid = checkSignalType(signalType) returns logical 1 (true) when the specified signal type is valid. In the Ground Truth Labeling app, if you select an automation algorithm, select signals that are of an invalid type, and then click Automate, the app displays an error.

Examples

expand all

Implement the checkSignalType method to designate Image signals as valid and all other signals as invalid.

function isValid = checkSignalType(signalType)
    isValid = (signalType == vision.labeler.loading.SignalType.Image);
end

Implement the checkSignalType method to designate PointCloud signals as valid and all other signals as invalid.

function isValid = checkSignalType(signalType)
    isValid = (signalType == vision.labeler.loading.SignalType.PointCloud);
end

Implement the checkSignalType method to designate Image and PointCloud signals as valid.

function isValid = checkSignalType(signalType)
    isValid = any(signalType == vision.labeler.loading.SignalType.Image) && ...
    any(signalType == vision.labeler.loading.SignalType.PointCloud);
end

Input Arguments

expand all

Signal type, specified as a vision.labeler.loading.SignalType (Automated Driving Toolbox) enumeration.

Example: vision.labeler.loading.SignalType.Image

Example: vision.labeler.loading.SignalType.PointCloud

Output Arguments

expand all

Result of the signal type validity check, returned as logical 1 (true) or logical 0 (false).

Attributes

Statictrue

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2020a