地面
Ground truth label data
Description
这地面
object contains information about the data source, label definitions, and marked label annotations for a set of ground truth labels. You can export or import a地面
object from theImage Labeler和Video Labelerapps.
从数组中创建对象检测器的训练数据
地面
objects, use theobjectDetectorTrainingData
function.为语义分割网络创建培训数据
地面
objects, use thepixelLabelTrainingData
function.
Creation
To export a地面
来自标签应用程序的对象,在App Toolstrip上,选择Export Labels>To Workspace。这app exports the object to the MATLAB®工作区。创建一个地面
object programmatically, use the地面
function (described here).
Description
returns an object containing ground truth labels that can be imported into theImage Labeler和Video Labelerapps.gTruth
= groundTruth(数据源
,Labeldefs
,labelData
)
数据源
指定地面真相数据的来源,并设置数据源
property.Labeldefs
specifies the label, sublabel, and attribute definitions of the ground truth data and sets thelabeldefinitions
property.labelData
指定标记标签的识别信息,位置和时间戳,并设置Labeldata
property.
Properties
数据源
—地面真相数据的来源
地面图
object
地面真相数据的来源, specified as a地面图
目的。该对象包含描述视频,图像序列或自定义数据源的信息,从那里标记了地面真相数据。
To access images from the original data source, use录像师
或者成像
。You can also use a custom read function. For more details, see利用Custom Image Source Reader for Labeling。
labeldefinitions
—Label definitions
桌子
此属性仅阅读。
标签定义,指定为表。要创建此表,请使用以下选项之一。
在其中一个标签应用程序中,创建标签定义,然后将其导出为
地面
目的。利用a
labelDefinitionCreator
对象生成标签定义表。如果将此表保存到垫子文件中,则可以通过选择标签定义将标签定义加载到标签应用程序中Load>标签定义from the app toolstrip.在MATLAB命令行中创建标签定义表。
该表描述了在该表中指定的表的必需列labeldefinitions
property.
柱子 | Description | 必需的或者Optional |
---|---|---|
Name |
Strings or character vectors specifying the name of each label definition. | 必需的 |
类型 |
标签 enumerations that specify the type of each label definition, such asRectangle 或者Scene 。 |
必需的 |
LabelColor |
1-by-3 row vectors of RGB triplets that specify the colors of the label definitions. Values are in the range [0, 1]. The color yellow (RGB triplet [1 1 0]) is reserved for the color of selected labels in the labeling apps. | Optional 当您在标签应用中定义标签时,必须指定颜色。因此,导出的标签定义表总是包含此列。 当您创建标签定义时 |
PixelLabelID |
Scalars, column vectors, orM-by-3 matrices of integer-valued label IDs.PixelLabelID 指定用于表示标签定义的像素标签值。像素标签ID值必须在0到255之间。 |
Optional 当您在标签应用中定义像素标签或 在MATLAB命令行中创建标签定义表时,如果您设置 |
团体 |
字符串或字符向量指定每个标签定义所属的组。 | Optional If you create the label definitions table at the MATLAB command line, you do not need to include a 如果您从标签应用程序导出标签定义或使用 |
Description |
Strings or character vectors that describe each label definition. | Optional If you create the label definitions table at the MATLAB command line, you do not need to include a 如果您从标签应用程序导出标签定义或使用 |
等级制度 |
每个标签定义中包含sublabel和属性数据的结构。作为一个例子等级制度 format, see开始使用图像标签或者Get Started with the Video Labeler。 |
Optional In labeling apps, when you define sublabels or attributes, the exported |
例如,考虑一个带有标签定义的表格Sky
,Vegetation
,车道
,StopSign
, 和Vehicle
, 和that was exported from theVideo Labeler应用程序。
标签定义包括像素标签,因此该表包括一个
PixelLabelID
column.Two of the labels contain attributes, so the app created a
等级制度
适用于所有标签定义的列。标签定义没有分配的组,因此
团体
列是'None'
for all label definitions.
Note
标签应用程序只能加载具有1到255之间的像素ID的像素数据。
Labeldata
—每个ROI和场景标签的标签数据
桌子|timetable
此属性仅阅读。
每个ROI和场景标签的标签数据, specified as a桌子
for image collections or atimetable
for videos or image sequences. Each column ofLabeldata
保留单个标签定义的标签,并对应于Name
每行的值labeldefinitions
。这seLabeldata
描述表的元素。标签类别指定为标签
enumerations.
一个lternatively, for ROI label data that is grouped by label type, a single column labeledRoilabeldata
, can be used and specified as a structure containing at least one label type,矩形
,多边形
,lineata
, 或者ProjCuboidData
。
表中描述了每个标签类型的存储格式。
标签类型 | 每个时间戳上标签的存储格式 |
---|---|
标签。Rectangle |
|
|
该图显示了这些值如何确定长方体的位置。 |
|
该图显示了这些值如何确定长方体的位置。
|
labelType.line |
|
labelType.pixellabel |
Label data for all pixel label definitions is stored in a singleM-by-1 |
labelType.polygon |
|
labelType.custom |
标签与时间表中指定的准确存储。如果您导入地面Multisignal object containing custom label data into theGround Truth Labelerapp, this data is not imported into the app. Use custom data when gathering label data for training and combining it with data labeled in the app. |
Supported GroundTruth Objects
Video Labeler App | Image Labeler App | |
---|---|---|
数据源 | 视频文件,图像序列文件夹,自定义阅读器 | 图像文件 |
Label definitions | Rectangle ,Line ,PixelLabel , 或者Scene label types |
Rectangle ,Line ,PixelLabel , 或者Scene label types |
Label data | 时间表Rectangle ,Line ,PixelLabel , 或者Scene label types |
Table (no timetable) forRectangle ,Line ,PixelLabel , 或者Scene label types |
添加不是ROI的地面真相数据(Rectangle
,Line
,PixelLabel
) orScene
label category to a地面
对象,提供标签定义标签
that isCustom
。将其加载到标签应用程序中时,自定义数据不可见。
Object Functions
SelectLabelsByGroup |
Select ground truth labels by label group |
selectlabelsbytype |
Select ground truth labels by label type |
SelectLabelsByName |
通过标签名称选择地面真相标签 |
变化膜 |
改变地面实况数据文件路径 |
gatherLabelData |
从地面真相收集标签数据 |
Examples
Create Ground Truth for Stop Signs and Cars
从图像集合中创建数据源。
data = load('stopSignsAndCars.mat'); imageFilenames = data.stopSignsAndCars.imageFilename(1:2)
imageFilenames =2x1 cell{'stopSignImages/image001.jpg'} {'stopSignImages/image002.jpg'}
imageFileNames = fullfile(toolboxDir('vision'),'visiondata',imageFilenames); dataSource = groundTruthDataSource(imageFilenames);
定义用于指定地面真相的标签。利用labelDefinitionCreator
创建标签定义表。
LDC = labeldefinitionCreator();Addlabel(LDC,'停止标志',labelType.Rectangle); addLabel(ldc,'carRear',labelType.Rectangle); labelDefs = create(ldc)
Labeldefs=2×5桌Name Type LabelColor Group Description ____________ _________ __________ ________ ___________ {'stopSign'} Rectangle {0x0 char} {'None'} {' '} {'carRear' } Rectangle {0x0 char} {'None'} {' '}
初始化矩形ROI的标签数据。
stopSignTruth = {[856 318 39 41];[445 523 52 54]}; carRearTruth = {[398 378 315 210];[332 633 691 287]};
Construct a table of label data.
labelNames = {'停止标志';'carRear'};labelData = table(stopSignTruth,carRearTruth,'VariableNames',labelNames)
labelData=2×2桌stopSign carRear _________________ ___________________ {[856 318 39 41]} {[398 378 315 210]} {[445 523 52 54]} {[332 633 691 287]}
创建一个ground truth object.
gTruth = groundTruth(dataSource,labelDefs,labelData)
gTruth = groundTruth with properties: DataSource: [1x1 groundTruthDataSource] LabelDefinitions: [2x5 table] LabelData: [2x2 table]
创建道路车道的地面真相数据
创建一个地面
对象存储代表标记道路车道的数据。
从图像创建数据源。
dataSource = groundTruthDataSource({'stopSignTest.jpg'});
定义用于指定地面真相的标签。利用labelDefinitionCreator
创建标签定义表。
LDC = labeldefinitionCreator();Addlabel(LDC,'车道',labelType.line);labeldefs =创建(LDC);
一个ssign two lane markers in the image.
laneMarkerTruth = {[257 254;311 180] [327 183;338 205;374 250]};
Construct a table of label data.
labelNames = {'车道'};labelData = table(laneMarkerTruth,'VariableNames',labelNames)
labelData=桌子车道____________________________ {2x2 double} {3x2 double}
创建一个地面目的。
gTruth = groundTruth(dataSource,labelDefs,labelData)
gTruth = groundTruth with properties: DataSource: [1x1 groundTruthDataSource] LabelDefinitions: [1x5 table] LabelData: [1x1 table]
为像素标签创建地面真相数据
创建一个地面
对象存储代表场景部分的数据。
创建一个数据源。
dataSource = groundTruthDataSource({'VisionTeam.jpg'});
利用labelDefinitionCreator
创建标签定义表。Define labels,'Person'
和'背景'
。将其相应标签类型分配为PixelLabel
。
LDC = labeldefinitionCreator();Addlabel(LDC,'Person',labelType.pixellabel);Addlabel(LDC,'背景',labelType.pixellabel);labeldefs =创建(LDC)
Labeldefs=2×6桌Name Type LabelColor PixelLabelID Group Description ______________ __________ __________ ____________ ________ ___________ {'Person' } PixelLabel {0x0 char} {[1]} {'None'} {' '} {'Background'} PixelLabel {0x0 char} {[2]} {'None'} {' '}
为图像指定像素标签数据的位置。
datafile = {'VisionTeamPixellabels.png'}
datafile =1x1单元格数组{'VisionTeamPixellabels.png'}
为像素标签数据构建标签数据表。
labelData = table(dataFile,'VariableNames',{'PixelLabelData'})
labelData=桌子pixellabeldata _____________________________________________________________________________________________________
创建一个地面
目的。
gTruth = groundTruth(dataSource,labelDefs,labelData)
gTruth = groundTruth with properties: DataSource: [1x1 groundTruthDataSource] LabelDefinitions: [2x6 table] LabelData: [1x1 table]
为汽车和车道标记创建地面真相
创建一个data source from a video.
videoName ='caltech_cordova1.avi'; dataSource = groundTruthDataSource(videoName);
定义用于指定地面真相的标签。利用alabelDefinitionCreator
对象创建标签定义表。
LDC = labeldefinitionCreator();Addlabel(LDC,'Cars',labelType.Rectangle); addLabel(ldc,“ lanemarkers”,labelType.line);labeldefs =创建(LDC)
Labeldefs=2×5桌Name Type LabelColor Group Description _______________ _________ __________ ________ ___________ {'Cars' } Rectangle {0x0 char} {'None'} {' '} {'LaneMarkers'} Line {0x0 char} {'None'} {' '}
Create label data for cars and lane markers.
numrows = numel(datasource.timestamps);CARSTRUTH = Cell(Numrows,1);lanemarkerTruth = cell(numrows,1);
一个dd two car labels and two lane markers to the first frame.
carsTruth{1} = [182 186 31 22;404 191 53 34]; laneMarkerTruth{1} = {[257 254;311 180] [327 183;338 205;374 250]};
创建一个桌子of label data.
labelNames = {'Cars',“ lanemarkers”};labeldata = table(carstruth,lanemarkertruth,'VariableNames',labelNames);
创建一个地面
目的。To import this object into a labeling app, select an option from the打开>导入标签menu.
gTruth = groundTruth(dataSource,labelDefs,labelData)
gTruth = groundTruth with properties: DataSource: [1x1 groundTruthDataSource] LabelDefinitions: [2x5 table] LabelData: [250x2 timetable]
提示
地面
基于视频的数据源的对象依赖于操作系统的视频阅读功能。一个地面
使用视频数据源创建的对象仅对用于创建它的同一平台保持一致。创建独立于平台的地面
对象,将视频转换为一系列图像,并包含带有图像序列的相关时间戳。
Version History
See Also
一个pps
Functions
Objects
一个brir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha Hecho Clic en ener eNRACE que对应了este comando de matlab:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
选择一个网站
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:。
您还可以从以下列表中选择一个网站:
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.
美洲
- AméricaLatina(Español)
- 加拿大(English)
- 美国(English)
欧洲
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- 瑞典(English)
- 瑞士
- United Kingdom(English)