How do I run all images in a folder through an image processing code?
53 ビュー (過去 30 日間)
古いコメントを表示
I have written code to process an image in a certain way. I want to be able to add a bunch of similar images into a folder and possibly create a loop that processes each image through the code. Ideas or hints would be greatly appreciated.
0 件のコメント
採用された回答
Image Analyst
2018 年 5 月 18 日
You can find simple snippets in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
Or you can find a nice GUI framework here: http://www.mathworks.com/matlabcentral/fileexchange/24224
0 件のコメント
その他の回答 (2 件)
Ameer Hamza
2018 年 5 月 18 日
imageBatchProcessor
You can specify the input dataset containing multiple images. You can specify the function you want to apply and also use parallel processing directly from the app to speed up the processing. It will also give the option to save all the processed file in a folder or the workspace.
For doing it programmatically, refer to this link. The general idea is to loop through all files as shown here
files = dir('*.jpg'); % specigy the extension of your image file
for i = 1:numel(files);
filename = files(i).name;
image = imread(filename);
% apply processing to the loaded image
% save the image to an array or back to the folder using
end
0 件のコメント
Hargun Kaur
2023 年 5 月 2 日
移動済み: Image Analyst
2023 年 5 月 2 日
kindly use Image Batch Processor app, already installed in matlab. Just import data from your folder, define a function, and process it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!