Files in different folders
Mostra commenti meno recenti
If you have 12 different folders (that each contain pictures), is there a way to create a loop that will sum up the first images in all the folders, and the sum of the second images in all the folders, etc... for all the images?
Risposte (3)
Sean de Wolski
il 31 Mag 2013
Modificato: Sean de Wolski
il 31 Mag 2013
0 voti
Azzi Abdelmalek
il 31 Mag 2013
folders={f1,f2,f3}; % your folders
for k=1:numel(folders)
f=dir([folders{k} '/*.jpg']);
files{k}={f.name};
end
for ii=1:numel(files{1});
im{ii}=0;
for jj=1:numel(files)
im{ii}=im{ii}+imread(files{jj}{ii});
end
end
Image Analyst
il 31 Mag 2013
0 voti
You can take the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F and adapt it to use genpath() to get all subfolders.
2 Commenti
Jenna
il 1 Giu 2013
Image Analyst
il 2 Giu 2013
If they're grayscale:
oneRow = grayImage(theRowNumber, :);
If they're color
oneRowRed = rgbImage(theRowNumber, :, 1);
oneRowGreen = rgbImage(theRowNumber, :, 2);
oneRowBlue = rgbImage(theRowNumber, :, 3);
Categorie
Scopri di più su Convert Image Type in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!