How to know the size of imageDatastore?
22 ビュー (過去 30 日間)
古いコメントを表示
Hadi Ghahremannezhad
2020 年 9 月 23 日
回答済み: Srivardhan Gadila
2020 年 9 月 28 日
Is there a function that returns the total number of images in an imageDatastore?
For example, if I load images from a directory and wanted to know the total number of images and index each image, how can I do that?
imds = imageDatastore(ipath, 'FileExtensions', {'.jpg', '.tif', '.png'});
i = 1;
while hasdata(imds)
[img, imgInfo] = readImage(imds, i);
fprintf('process %s \n', imgInfo.('Filename'));
i = i+1;
end
The above code shows out of index error ( i exceeds number of files ).
and is this the fastest way to read images from a location?
0 件のコメント
採用された回答
Srivardhan Gadila
2020 年 9 月 28 日
imds = imageDatastore({'street1.jpg','street2.jpg','peppers.png','corn.tif'})
numImages = numel(imds.Files)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!