labelDataAtTime
Description
returns the scene label data at the specified timestamps and for the specified label names
present in a labelData
= labelDataAtTime(sceneData
,labelNames
,timestamps
)SceneLabelData
object, sceneData
.
Examples
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)
weatherLabelData=9×2 timetable
timeStamps sunny rainy
__________ _____ _____
0 sec true false
1 sec true false
2 sec true false
3 sec true false
4 sec true false
5 sec true false
6 sec false true
7 sec false true
8 sec false true
Input Arguments
sceneData
— Scene label data
SceneLabelData
object
Scene label data, specified as a SceneLabelData
object.
labelNames
— Scene label names
string vector
Scene label names, specified as a string vector. The scene label names must be
present in the sceneData
input.
Example: ["sunny" "rainy"]
timestamps
— Timestamps
duration
vector
Timestamps, specified as a duration
vector.
Example: seconds(5:10)
specifies a duration
vector from 5 to 10 seconds.
Output Arguments
labelData
— Scene label data at specified timestamps
timetable
Scene label data at specified timestamps, returned as a timetable. The first column
contains the timestamps specified by the timestamps
input. The
remaining columns correspond to the scene labels specified by the
labelNames
input. These columns contain logical
1
(true
) and logical 0
(false
) values that specify the scene labels present at each
timestamp in the input sceneData
.
Version History
Introduced in R2020a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)