%% Get Scene Label Definition Names at Timestamp
% Get the scene label definition names that are applied at the first timestamp of 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 scene labels that are applied at the start of the time range, that is, the first timestamp.

tsStart = 0;
labelNamesAtStart = labelDefinitionsAtTime(sceneData,tsStart)

% Copyright 2019 The MathWorks, Inc.