How can I replace images inside a folder with another image from different folder?

5 ビュー (過去 30 日間)
Rupayan Saha
Rupayan Saha 2020 年 12 月 14 日
コメント済み: Image Analyst 2020 年 12 月 14 日
Hi. I have a large number of captured images, however few of them are corrupted. So I use pixel threshold to identify those images and able to delete them. But I want to replace them with another image located in different folder. I am beginner to MATLAB and not aware of many functions which may solve this issue. Please let me know if you have any suggestion for this task.
I used "DELETE" function to delete images after storing the file name as a string scalar. Tried "replace" function for replaceing the images but it did not work.

採用された回答

Jon
Jon 2020 年 12 月 14 日
編集済み: Jon 2020 年 12 月 14 日
If I understand what you are trying to do I think the copyfile function should do what you want
Type doc copyfile on the command line to view the documentation.
  1 件のコメント
Image Analyst
Image Analyst 2020 年 12 月 14 日
What is ready and ready2, and ee and all those other variables. My two mandatory tips for people who write code for me are to
  1. Use descriptive variable names, not cryptic ones.
  2. Put in LOTS of comments.
We can't even run your code because the code where you define imagenames, ready, etc. is not included. Please include that code, while following my tips, so we can fix your code and help you. But basically you can call
delete(destinationFileName)
copyfile(sourceFileName, destinationFileName);
You just have to set up those variables and make sure those files exist.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by