メインコンテンツ

countEachLabel

ImageDatastore ラベル内のファイルをカウントする

説明

T = countEachLabel(imds) は、imds 内にあるラベルの概要テーブルと、個々のラベルに関連付けられているファイルの数を返します。

すべて折りたたむ

ImageDatastore オブジェクトを作成し、イメージを含むフォルダーに従って各イメージにラベルを付けます。

imds = imageDatastore(["cloudCombined.png","example.tif","landOcean.jpg","ngc6543a.jpg",...
    "corn.tif","street1.jpg","street2.jpg","peppers.png"],...
    LabelSource="foldernames",FileExtensions=[".jpg",".png",".tif"])
imds = 

  ImageDatastore with properties:

      Files: {
             ' ...\folder1\cloudCombined.jpg';
             ' ...\folder1\example.tif';
             ' ...\folder1\landOcean.jpg'
              ... and 5 more
             }
     Labels: [folder1; folder1; folder1 ... and 5 more categorical]
    ReadFcn: @readDatastoreImage

各ラベルのファイル数をリストします。

T = countEachLabel(imds)
T = 

     Label      Count
    ________    _____

    folder1       6    
    folder2       2    

入力引数

すべて折りたたむ

入力データストア。ImageDatastore オブジェクトとして指定します。イメージ データから ImageDatastore を作成するには、関数 imageDatastore を使用します。

出力引数

すべて折りたたむ

ラベル数のテーブル。imds 内の各ラベルの名前と、各ラベルに関連付けられたファイルの数を含む 2 列のテーブルとして返されます。

データ型: table

拡張機能

すべて展開する

バージョン履歴

R2016a で導入