How to read images from one directory into variables using loop?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Md Farhad Mokter
el 27 de Mayo de 2019
Comentada: Rik
el 28 de Mayo de 2019
I am new in Matlab. I want to read all images from a directory and store each of them into separate variables. For example, if there are 225 images then i should have 225 variables, each of them containing pixel values of corresponding image, no matter same name as image or different.
0 comentarios
Respuesta aceptada
Image Analyst
el 28 de Mayo de 2019
See the FAQ for explanation and code samples: The FAQ
0 comentarios
Más respuestas (1)
Rik
el 27 de Mayo de 2019
You don't want numbered variables. Try a cell array instead. That way you can much more easily loop through your images to do the further processing.
6 comentarios
Rik
el 28 de Mayo de 2019
You are much better off just processing the images in a loop without storing the intermediate steps. You could also consider a struct array with a field for the file name and a field with the property of interest (and you could even add a field with the image itself).
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!