I would like to perform the same operation on many images in the same folder stored in C drive of my computer. How to do the same with respect to the code attached ??
1 view (last 30 days)
Show older comments
This is my code for detecting black spot. Well, I would like to perform the same operation on many images in the same folder stored in C drive of my computer. How to do the same with respect to the code attached ??
0 Comments
Accepted Answer
Adam
on 12 Jan 2015
s = dir( folder );
folderFiles = s( ~[s.isdir] );
filenames = { filderFiles.name };
will give you a list of filenames in the directory. You can interrogate these using fileparts and/or string-based functions such as strcmp to get rid of those that don't have the correct extension or are hidden files or some other type of file you do not want.
Then just loop over the rest with your code.
2 Comments
More Answers (1)
Image Analyst
on 12 Jan 2015
Put that code into a function, and then call that function from inside a "for" loop like in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
0 Comments
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!