What is the efficient way to read the images from the subfolders?
Afficher commentaires plus anciens
I saved the file location on the variable (1*815 cell array). I used the following code to read the image. But however I am getting out of Memory error in Windows 7, Matlab 2015 trail version
for i=1:815
ni(i)=imread(char(fullFileName(1,i)));
end
Any help is appreciated
Thanks in Advance
1 commentaire
Stephen23
le 13 Sep 2015
The OP has continued this topic in a new question:
Réponses (1)
Walter Roberson
le 12 Sep 2015
for K = 1:length(fullFileName)
ni{K} = imread(fullFileName{K});
end
If your images are large enough, you will run out of memory trying to store all of them in memory simultaneously. If so then be sure to use 64 bit MATLAB and increase your physical memory or your swap space (but swap space is slow!!!). Or reconsider your code to figure out whether you really need all of the images to be in memory at the same time.
8 commentaires
Jab
le 12 Sep 2015
Walter Roberson
le 13 Sep 2015
Even a 64 bit version of MATLAB can run out of RAM if you read in more data than your RAM can handle.
You did not say how you are using the data so we cannot comment on whether there are other approaches that might not need all of it in memory at the same time.
Image Analyst
le 13 Sep 2015
Jabasan, why do you want to put all the images into a cell array? Will you need them after the loop exits? Probably not. Even if you do, it would probably be more efficient just to read them in from disk again rather than use up gigabytes of RAM storing images.
Jab
le 13 Sep 2015
Modifié(e) : Walter Roberson
le 13 Sep 2015
Walter Roberson
le 13 Sep 2015
I do not see anything in your description that requires that you compute anything between images ? Other than that you care calculating 44 features per image to end up with an 812 x 44 result. It does not sound like you are, for example, calculating the average of each voxel like a time series.
Jab
le 13 Sep 2015
Stephen23
le 13 Sep 2015
The OP has continued this topic in a new question:
Image Analyst
le 13 Sep 2015
Please learn how to format code here: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!