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.

driving.connector.Connector class

Interface to connect external tool to Ground Truth Labeler app

Description

The driving.connector.Connector class creates an interface between a custom visualization or analysis tool and the Ground Truth Labeler app.

Construction

The Connector class that inherits from the Connector interface, is called a client.

The client can:

  • Sync an external tool to each frame change event within 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 for it in the app.

  • Export custom labeled data from an external tool via the app.

  1. Define a client class that inherits from driving.connector.Connector. You can use a ConnectorClass template to define the class and implement your custom visualization or analysis tool. At the MATLAB® command prompt, enter:

    driving.connector.Connector.openTemplateInEditor
    Follow the steps found in the template.

  2. Save the file to any folder on the MATLAB path. Alternatively, add the folder into which you saved the file to the MATLAB path. To add a folder to the path, use the addpath function.

Properties

expand all

This property is read-only.

Start time of source video file, specified as a real scalar in seconds.

This property is read-only.

End time of source video file, specified as a real scalar in seconds.

This property is read-only.

Start time of video interval in app, specified as a real scalar in seconds. To set the start time, use the start flag interval in the app.

This property is read-only.

Time of video frame currently displaying in app, specified as a real scalar in seconds.

This property is read-only.

End time of video in app, specified as a real scalar in seconds. To set the end time, use the end flag interval in the app.

This property is read-only.

Timestamps for the loaded video, specified in an array.

This property is read-only.

Label data imported from external tool, specified as a two-column table. The first column contains timestamps and the second column contains the label information that you specify for the corresponding timestamp.

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 column of LabelData.

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 LabelName.

Methods

The client class must implement the following methods:

frameChangeListenerUpdate external tool when a new frame is detected

The client class can optionally implement the following methods:

closeClose external tool
labelDefinitionLoadListenerUpdate new label definitions from external tool
labelLoadListenerUpdate new label data from external tool

The client class can call the following methods:

addLabelDataAdd custom label data at current time
dataSourceChangeListenerUpdate external tool when you add data source to app
disconnectDisconnect external tool from app
queryLabelDataQuery for custom label data at current time
updateLabelerCurrentTimeUpdate current time for app

Examples

collapse all

Connect a lidar data visualization tool to the Ground Truth Labeler app. Use the app and tool to display synchronized lidar and video data. To use another set of data, modify the MATLAB code in this example.

Specify the video name to display in the Ground Truth Labeler.

videoName = '01_city_c2s_fcw_10s.mp4';

Add the path to the lidar display data.

addpath(fullfile(matlabroot,'toolbox','driving','drivingdemos'));

Connect the lidar display to the Ground Truth Labeler.

groundTruthLabeler(videoName,'ConnectorTargetHandle',@LidarDisplay);

Introduced in R2017a