sceneTimeRanges - Time ranges of scene labels from ground truth data - MATLAB (original) (raw)
Main Content
Time ranges of scene labels from ground truth data
Since R2021b
Syntax
Description
[timeRanges](#mw%5F00422be9-f915-4c23-a68b-6b88898bbdec) = sceneTimeRanges([gTruth](#mw%5F3dd1dcc2-e747-413f-a136-538ed41b3925))
returns the time ranges that define the start and end times for the scene labels applied to the ground truth data sources in gTruth
.
[[timeRanges](#mw%5F00422be9-f915-4c23-a68b-6b88898bbdec),[sceneLabels](#mw%5F17c9e115-5478-41e4-986e-0b3e083180d5)] = sceneTimeRanges([gTruth](#mw%5F3dd1dcc2-e747-413f-a136-538ed41b3925))
also returns the scene labels that correspond to the time ranges.
Examples
Load ground truth scene label definitions and label data into the workspace.
data = load("groundTruthSceneLabels.mat"); labelDefinitions = data.labelDefinitions; labelData = data.labelData;
Create a ground truth data source using a video file.
gSource = groundTruthDataSource("viptrain.avi");
Create a ground truth object using the ground truth data source.
gTruth = groundTruth(gSource,labelDefinitions,labelData);
Gather all the scene time ranges and the scene labels.
[timeRanges,sceneLabels] = sceneTimeRanges(gTruth);
Display the scene time ranges for the ground truth data.
ans = 3×2 duration 0 sec 8.0333 sec 8.3 sec 10.033 sec 12 sec 16.333 sec
Display the corresponding scene labels for the ground truth data.
ans = 3×1 categorical walking sitting trainMoving
Input Arguments
Output Arguments
Time ranges of the ground truth source data, returned as an_M_-by-1 cell array. M is the number of elements ingTruth. Each of the cell array contains a_T_-by-2 duration matrix. T is the number of time ranges in the corresponding element of gTruth
. Each row of the matrices corresponds to a time range in the ground truth data for which a scene label has been applied, specified in the form [rangeStart _rangeEnd_].
To select and obtain scene time ranges for specific signals in a groundTruthMultisignal (Automated Driving Toolbox) object, use the selectLabelsBySignalName (Automated Driving Toolbox) function before calling thesceneTimeRanges
function.
Scene labels for each time range, returned as an _M_-by-1 cell array of _T_-by-2 categorical vectors. M is the number of elements in gTruth. T is the number of time ranges in each corresponding ground truth data source.
Version History
Introduced in R2021b
See Also
Objects
- groundTruthMultisignal (Automated Driving Toolbox) | groundTruthDataSource | groundTruth
Functions
- selectLabelsBySignalName (Automated Driving Toolbox) | gatherLabelData | objectDetectorTrainingData | pixelLabelTrainingData | writeVideoScenes