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.

Use Custom Data Source Reader for Ground Truth Labeling

The Ground Truth Labeler (requires Automated Driving Toolbox™) and Video Labeler apps enable you to label ground truth data in a video or in a sequence of images.

You can use a custom reader to import any video or sequence of images that is supported by VideoReader or imread. You can either use the custom reader dialog box in the app or open the app and specify a custom reader source.

The Image Labeler app does not support custom data source readers.

Import Data Source Using Custom Reader Dialog Box

In your app, Load > Custom Reader to load your data by using a custom reader function. You must provide the Custom reader function handle and the Data source name. In addition, you must import corresponding timestamps from the MATLAB® workspace.

Import Data Source Using Custom Reader Function

Specify the Custom Reader

Specify a custom reader as a function handle. The custom reader must have the syntax:

outputImage = readerFcn(sourceName,currentTimeStamp)
where readerFcn is the name of your custom reader function.

The custom reader function loads an image from sourceName, which corresponds to the current timestamp specified by currentTimeStamp.

currentTimeStamp = timestamps(currIdx);

The outputImage from the custom function must be a grayscale or RGB image in any format supported by imshow. currentTimeStamp is a scalar value that corresponds to the current frame that the algorithm is executing.

Read Ground Truth Data Using Custom Reader

Use the groundTruthDataSource function to read the custom source data with the custom reader function handle:

gtSource = groundTruthDataSource(sourceName,readerFcn,timeStamps)
The syntax returns a groundTruthDataSource object with the custom reader function handle, readerFcn. The app uses the handle to load the custom data source specified by sourceName. The custom reader function loads an image from sourceName that corresponds to the current timestamp specified by the indexed value in the timeStamps vector.

The syntax returns a groundTruthDataSource object, which the app uses to read data from the custom source.

Read Ground Truth Data Using Custom Reader

Use the groundTruthDataSource function to read the custom source data with the custom reader function handle:

gtSource = groundTruthDataSource(sourceName,readerFcn,timeStamps)
The syntax returns a groundTruthDataSource object with the custom reader function handle, readerFcn. The app uses the handle to load the custom data source specified by sourceName. The custom reader function loads an image from sourceName that corresponds to the current timestamp specified by the indexed value in the timeStamps vector.

The syntax returns a groundTruthDataSource object, which the app uses to read data from the custom source.

Import Ground Truth Data into App

You can import the returned groundTruthDataSource object into the Ground Truth Labeler or Video Labeler app. For example:

groundTruthLabeler(gtSource)
videoLabeler(gtSource)

See Also

Apps

Functions

Related Topics