Auto Image Reading and Resizing

2 ビュー (過去 30 日間)
Chandra Bhushan
Chandra Bhushan 2020 年 5 月 29 日
コメント済み: Mohammad Sami 2020 年 5 月 29 日
Suppose There is a Directory Names "Database"
It contains 1000 plus image file
I want to read all the images of the folder Database
and Resize it to a new size of M x N
and sequentially keep showing rezied images in imshow
Suggest a minimal line for this task
  1 件のコメント
Mehmed Saad
Mehmed Saad 2020 年 5 月 29 日
what have you done so far. Show us your code

サインインしてコメントする。

回答 (1 件)

Mohammad Sami
Mohammad Sami 2020 年 5 月 29 日
If you have deep learning toolbox, this can be easily acheieved with the augmented Image Data Store.
a = imageDatastore(foldername,'IncludeSubfolders',true);
size = [m n 3]
a = augmentedImageDatastore(size,a);
  2 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 5 月 29 日
If you do not have deep learning toolbox you can use the transform function on image datastore to achieve the same results.
a = imageDatastore(foldername,'IncludeSubfolders',true);
m = 224;
n = 224;
targetSize = [m,n];
imdsReSz = transform(a,@(x) imresize(x,targetSize));
Mohammad Sami
Mohammad Sami 2020 年 5 月 29 日
An example is available in the Matlab documentation.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by