Interface to connect external tool to Ground Truth Labeler app
driving.connector.Connector class creates an
interface between a custom visualization or analysis tool and a signal in the Ground
Truth Labeler app. You can use the connector with video and image sequence signals
driving.connector.Connector class is a
Connector class that is inherited from the
Connector interface is called a
The client can:
Sync an external tool to each frame change event for a specific signal loaded into the Ground Truth Labeler. Syncing allows you to control the external tool through the range slider and playback controls of the app.
Control the current time in the external tool and the corresponding display in the app.
Export custom labeled data from an external tool via the app.
To connect an external tool to the Ground Truth Labeler app, follow these steps:
Define a client class that inherits from
driving.connector.Connector. You can use the
Connector class template to define a class and implement your custom
visualization or analysis tool. At the MATLAB® command prompt,
Save the file to any folder on the MATLAB path. Alternatively, save the file to a folder and add the folder to
MATLAB path by using the
VideoStartTime— Start time of signal
Start time of the signal, specified as a real scalar in seconds.
VideoEndTime— End time of signal
End time of the signal, specified as a real scalar in seconds.
StartTime— Start of time interval in app
Start of the time interval in the app, specified as a real scalar in seconds. To set the start time, use the start flag interval in the app.
CurrentTime— Time of frame currently displaying in app
Time of the frame currently displaying in the app for the connected signal, specified as a real scalar in seconds. If the slider is between two timestamps, then the currently displaying frame is the frame that is at the previous timestamp. For more details, see Control Playback of Signal Frames for Labeling.
EndTime— End of time interval in app
End of the time interval in the app, specified as a real scalar in seconds. To set the end time, use the end flag interval in the app.
TimeVector— Timestamps for connected signal
Timestamps for the connected signal, specified as a
vector. This signal must be the master signal. If you change the master signal, the
TimeVector property updates to the timestamps for new master
LabelData— Label data imported from external tool
Label data imported from the external tool, specified as a two-column table. The first column contains the timestamps of the connected signal and the second column contains the label information that you specify for the corresponding timestamp.
The first column contains the timestamps for that signal
The second column contains the label information that you specify for the corresponding timestamp.
LabelName— Names of labels
Names of labels, specified as a character vector, a string scalar, a cell array of
character vectors, or a string array. These names must be valid MATLAB variables that correspond to the label names specified in the second
LabelDescription— Descriptions of labels
' '(default) | character vector | string scalar | cell array of character vectors | string array
Descriptions of labels, specified as a character vector, a string scalar, a cell
array of character vectors, or a string array. Each description of
LabelDescription corresponds to a label specified in
|Update external tool when new frame is displayed in Ground Truth Labeler app|
|Update external tool for new label definitions in Ground Truth Labeler app|
|Update external tool for new label data in Ground Truth Labeler app|
|Add custom label data at current time|
|Query for custom label data at current time|
|Update current time in Ground Truth Labeler app|
|Close external tool connected to Ground Truth Labeler app|
|Disconnect external tool from Ground Truth Labeler app|
|Update external tool when connecting to signal being loaded into Ground Truth Labeler app|
Connect a lidar display tool to the Ground Truth Labeler app. Use the app and tool to display synchronized lidar and video data.
Specify the name of a video signal to load into the app.
signalName = '01_city_c2s_fcw_10s.mp4';
Add the path to the function handle for the lidar display tool.
path = fullfile(toolboxdir('driving'),'drivingdemos'); addpath(path)
Connect the lidar display to the app.
After the app loads the video and lidar display tool, remove the path to the function handle.
For an example of an external tool, see this
driving.connector.Connector class implementation. This class implements a
lidar visualization tool. You can use this code as a starting point for creating your own
To keep an external tool synchronized with the app, specify timestamps that are at the same frame rate as the signals loaded in the app. If the tool visualizes data at a timestamp that is between two frames, then the app displays the frame that is at the previous timestamp. For more details, see Control Playback of Signal Frames for Labeling.