主要内容

selectLabelsByName

根据标签名称选择地面真值标签

描述

例子

gtLabel= selectLabelsByName (gTruthlabelNames选择由labelNames从一个groundTruth对象,gTruth.函数返回相应的groundTruth对象,gtLabel,只包含选定的标签。如果gTruth是向量groundTruth对象,则函数返回相应的向量groundTruth只包含选定标签的对象。

例子

全部折叠

将图像目录添加到MATLAB路径中。

imageDir = fullfile (matlabroot,“工具箱”“愿景”“visiondata”“stopSignImages”);目录(imageDir);

加载groundTruth对象。

负载(“stopSignsAndCarsGroundTruth.mat”);

查看标签定义。

stopSignsAndCarsGroundTruth。LabelDefinitions
ans =3×3表名称类型组  ____________ _________ ________ {' stopSign的矩形}{‘没有’}{‘carRear}矩形{‘没有’}{‘carFront}矩形{'没有'}

获取地面真实数据StopSign标签的名字。

stopSignGroundTruth = selectLabelsByName (stopSignsAndCarsGroundTruth,...“stopSign”);

获取地面真实数据carRearcarFront

carGroundTruth = selectLabels (stopSignsAndCarsGroundTruth,...“carRear”“carFront”});

从路径中删除映像目录。

rmpath (imageDir);

输入参数

全部折叠

地面真理,指定为groundTruth物体或向量groundTruth对象。

标签名称,指定为字符向量、字符串标量、字符向量单元格数组或字符串向量。

查看a中的所有标签名称groundTruth对象,gTruth,在MATLAB中输入这个命令®命令提示符。

gTruth.LabelDefinitions.Name

例子:“汽车”

例子:“汽车”

例子:{“车”、“车道”}

例子:(“车”“车道”)

输出参数

全部折叠

只有选定标签的Ground truth,返回为groundTruth物体或向量groundTruth对象。

每一个groundTruth对象gtLabel对应于一个groundTruth对象gTruth输入。属性指定的名称所返回的对象只包含标签labelNames输入。

限制

  • 不支持按名称选择像素标签。万博1manbetx但是,您可以选择像素类型的所有标签。使用selectLabelsByType函数,指定标签类型为labelType。PixelLabel枚举。

  • 不支持按名称选择子标签。万博1manbetx

介绍了R2019a