Interface for loading signal data into Ground Truth Labeler app
vision.labeler.loading.MultiSignalSource class creates an interface for
loading signals from a data source into the Ground
Truth Labeler app. The data source can be a file format or any custom source.
The interface created using this class enables you to customize the panel for loading custom data sources in the Add/Remove Signal dialog box of the app. The figure shows a sample loading panel.
The class also provides an interface to read frames from loaded signals. The app renders these frames for labeling.
To define a custom class to load a data source into the app, follow these steps.
Create a class that inherits from the
vision.labeler.loading.MultiSignalSource class. The class definition
must have this format, where
is the name of your
custom data source
classdef customSourceClass < vision.labeler.loading.MultiSignalSource
Save the class to this folder, where
is the full path to your
MATLAB® installation folder as returned by the
Alternatively, create a
structure, add these folders to the MATLAB search path, and save the class to the
+vision/+labeler/+loading folder. The Ground Truth
Labeler app recognizes data source classes in folders with this path
Define the class properties and methods required to load the data source into the app. This table shows the predefined custom classes that you can use as starting points for defining these properties and methods.
|Class||Data Source Loaded by Class||Command to View Class Source Code|
|Image sequence folder|
|Velodyne® packet capture (PCAP) file|
|Point cloud sequence folder|
|Custom image format|
For an explanation of the required properties and methods used for defining a custom data source class, see the Create Class for Loading Custom Ground Truth Data Sources example.
vision.labeler.loading.MultiSignalSource class is a
For information on class attributes, see Class Attributes.
Name— Name of source type
Name of the type of source that this class loads, specified as a string scalar.
Description— Description of class functionality
Description of the functionality that this class provides, specified as a string scalar.
SourceName— Name of data source
Name of the data source, specified as a string scalar. Typically,
SourceName is the name of the file from which the signal is
SourceParams— Parameters for loading signals from data source
Parameters for loading signals from the data source into the app, specified as a
structure. The fields of this structure contain values that the
loadSource method requires to load the signal.
SignalName— Names of signals in data source
Names of the signals that can be loaded from the data source, specified as a string vector.
SignalType— Types of signals in data source
Types of the signals that can be loaded from the data source, specified as a vector of
vision.labeler.loading.SignalType enumerations. Each signal listed in the
SignalName property is of the type in the corresponding position of
Timestamp— Timestamps of signals in data source
Timestamps of the signals that can be loaded from the data source, specified as a cell array
duration vectors. Each signal listed in the
SignalName property has the timestamps in the corresponding
NumSignals— Number of signals in data source
Number of signals that can be read from the data source, specified as a nonnegative integer.
NumSignals is equal to the number of signals in the
Customize the loading panel for the data source object. In the loading dialog box of the app, this method is invoked when you select the data source type from the Source Type list.
Obtain the data needed to load the data source object currently selected in the loading panel. In the loading dialog box of the app, this method is invoked when you add a source. The method returns these outputs.
[sourceName,sourceParams] = getLoadPanelData(sourceObj)
Both of these outputs are passed to the
Load a data source object into the app. In the loading dialog box of the app, this method is invoked after you add a source and the
Read a frame of data from a signal contained in a data source object at the specified timestamp index. The index must be in the bounds of the length of the timestamps for that signal.
frame = readFrame(sourceObj,signalName,tsIndex)
Check the load panel for the loading dialog box of the app. This method opens a dialog box similar to the loading dialog box that you open from the Open menu on the app toolstrip. Use this method to preview how the