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 内の各ラベルの名前と、各ラベルに関連付けられたファイルの数を含む 2 列のテーブルとして返されます。
データ型: 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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ