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.
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.
Specify a custom reader as a function handle. The custom reader must have the syntax:
outputImage = readerFcn(sourceName,currentTimeStamp)
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.
Use the groundTruthDataSource
function to read the
custom source data with the custom reader function
handle:
gtSource
= groundTruthDataSource(sourceName
,readerFcn
,timeStamps
)
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.
Use the groundTruthDataSource
function to read the
custom source data with the custom reader function
handle:
gtSource
= groundTruthDataSource(sourceName
,readerFcn
,timeStamps
)
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.
You can import the returned groundTruthDataSource
object into the Ground
Truth Labeler or Video Labeler app.
For
example:
groundTruthLabeler(gtSource)
videoLabeler(gtSource)