MATLAB 帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
对 ImageDatastore 标签中的文件进行计数
T = countEachLabel(imds)
T = countEachLabel(imds) 返回 imds 中的标签汇总表以及与每个标签关联的文件数。
T
imds
示例
全部折叠
创建一个 ImageDatastore 对象,并根据每个图像所在的文件夹为其添加标签。
ImageDatastore
imds = imageDatastore(fullfile(matlabroot, 'toolbox', 'matlab', {'demos','imagesci'}),... 'LabelSource', 'foldernames', 'FileExtensions', {'.jpg', '.png', '.tif'})
imds = ImageDatastore with properties: Files: { ' ...\matlab\toolbox\matlab\demos\cloudCombined.jpg'; ' ...\matlab\toolbox\matlab\demos\example.tif'; ' ...\matlab\toolbox\matlab\demos\landOcean.jpg' ... and 5 more } Labels: [demos; demos; demos ... and 5 more categorical] ReadFcn: @readDatastoreImage
列出每个标签的文件计数。
T = Label Count ________ _____ demos 6 imagesci 2
输入数据存储,指定为 ImageDatastore 对象。要根据图像数据创建 ImageDatastore,请使用 imageDatastore 函数。
imageDatastore
标签计数表,以包含两列的表形式返回,其中包含 imds 中每个标签的名称以及每个标签关联的文件数。
数据类型: table
table
全部展开
backgroundPool
ThreadPool
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
在 R2016a 中推出
ImageDatastore | splitEachLabel | datastore
splitEachLabel
datastore
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处