フィルターのクリア

How do I split a folder with images into two folders with images using MATLAB?

4 ビュー (過去 30 日間)
Gledson Melotti
Gledson Melotti 2018 年 2 月 22 日
コメント済み: Priyom Goswami 2021 年 5 月 11 日
Hi, how are you. I have a question about images in a folder. I have a folder with multiple images (2000). How do I separate this folder into two folders with randomly chosen images? For example, 70% of images in one folder and 30% in another folder.

回答 (1 件)

Jos (10584)
Jos (10584) 2018 年 2 月 22 日
編集済み: Jos (10584) 2018 年 2 月 22 日
  1. retrieve all filenames using dir
  2. create a random logical vector with 70% true, e.g. tf = randperm(N) > (0.70 *N), where N is the number of files
  3. create two new directories with mkdir
  4. loop over all files, using for
  5. use movefile to move the file to one folder, if the logical vector is true, otherwise move it to the other folder
  2 件のコメント
Gledson Melotti
Gledson Melotti 2018 年 12 月 12 日
Hello, thank you very much.
Priyom Goswami
Priyom Goswami 2021 年 5 月 11 日
Can You Help me with the code please, I'm unable to do so.

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

カテゴリ

Help Center および File ExchangeDeep Learning for Image Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by