Time ranges of scene labels from ground truth data
Gather Scene Time Ranges and Scene Labels
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 = 3x2 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 = 3x1 categorical walking sitting trainMoving
timeRanges — Time ranges of ground truth source data
M-by-1 cell array
Time ranges of the ground truth source data, returned as an
M-by-1 cell array. M is the number of elements in
gTruth. 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
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 the
sceneLabels — Scene labels for each time range
M-by-1 cell array of categorical vectors
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.
Introduced in R2021b