%% Get Scene Label Data at Timestamps
% Get the scene label data present at a specific time range in a SceneLabelData object.
% Create a SceneLabelData object. The object has labels for specifying whether a scene is sunny, rainy, urban, or rural. The scene labels are applied at these time ranges.
% "sunny" — 0 to 5 seconds
% "rainy" — 6 to 10 seconds
% "urban" — 0 to 8 seconds
% "rural" — 9 to 10 seconds

labelNames = ["sunny" "rainy" "urban" "rural"];

sunnyData = seconds([0 5]);
rainyData = seconds([6 10]);
urbanData = seconds([0 8]);
ruralData = seconds([9 10]);

labelData = {sunnyData rainyData urbanData ruralData};
sceneData = vision.labeler.labeldata.SceneLabelData(labelNames,labelData);

%
% Get the label data for the weather-related scene labels ("sunny" and "rainy") over the time range that the "urban" scene label is applied.

weatherLabelNames = ["sunny" "rainy"];
urbanTimestamps = seconds(0:8);
weatherLabelData = labelDataAtTime(sceneData,weatherLabelNames,urbanTimestamps)

% Copyright 2019 The MathWorks, Inc.