Image resizing using augmentedImageDatastore

i tried to resize the image stored in the following path. C:\Users\manjurama\Desktop\study\PG\PROJECT\finger vein database\database_10
imagefolder = 'C:\Users\manjurama\Desktop\study\PG\PROJECT\finger vein database\database_10';
imds = imageDatastore(imagefolder,'IncludeSubfolders',true,'LabelSource','foldernames');
veinimage = augmentedImageDatastore([227 227],imds)
numTrainFiles = 0.75;
[TrainImages, TestImages] = splitEachLabel(veinimage, numTrainFiles,'randomize'); % this is the line 14 error shown here.
But i got this error
Check for missing argument or incorrect argument data type in call to function 'splitEachLabel'.
Error in Classification (line 14)
[TrainImages, TestImages] = splitEachLabel(veinimage, numTrainFiles,'randomize');
Could you please let me know about the problem in my code. Thanks.

 採用された回答

Ibrahim A
Ibrahim A 2020 年 10 月 15 日

1 投票

Hi Rd,
I had same problem and fixed by splitting the data before I do the augmentedImageDatastore then have two augmentedImageDatastores one for the training portion and one for testing. So the code will be like.
imagefolder = 'C:\Users\manjurama\Desktop\study\PG\PROJECT\finger vein database\database_10';
imds = imageDatastore(imagefolder,'IncludeSubfolders',true,'LabelSource','foldernames');
numTrainFiles = 0.75;
imageSize = [227 227];
[TrainImages, TestImages] = splitEachLabel(imds, numTrainFiles,'randomize');
TrainImages = augmentedImageDatastore(imageSize,TrainImages)
TestImages = augmentedImageDatastore(imageSize,TestImages)

1 件のコメント

Rd
Rd 2020 年 10 月 30 日
Your answer is really helpful. Thanks a lot sir.

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

その他の回答 (1 件)

Mohammad Sami
Mohammad Sami 2020 年 9 月 9 日

0 投票

The last argument to split each label is not spelled correctly. It's
splitEachLabel(___,'randomized').

1 件のコメント

Rd
Rd 2020 年 9 月 9 日
I changed it as randomized. Still the same error is displaying.

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

カテゴリ

ヘルプ センター および File ExchangeRead, Write, and Modify Image についてさらに検索

タグ

質問済み:

Rd
2020 年 9 月 8 日

コメント済み:

Rd
2020 年 10 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by