Read nth image from a folder and compare it with nth image from different folders and store the result
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
So i have 3 folders say F1,F2,F3. Each folder contains images. i.e F1 conatins a1, a2,...; F2= b1,b2,....; F3=c1,c2,....; I want to read image (a1,b1) ,do some operation and store the value in a text file or a m x n table preferably. Similarly i want to read (a2,b2) , (a3, b3) and so on and do the same operation and update the text file. I want to repeat the same thing for (a1, c1), (a2, c2),etc and store it in another file/table. How do i do that?
The names of the files are not simply a1, b1, etc they are very randomly named so the program should read the nth file from F1,nth file from F2 and nth file from F3.
1 comentario
Image Analyst
el 28 de Nov. de 2022
If they are randomly names how do you know if "fkjsalf.png" from F1 matches up with "eiruwoeiru.PNG" from F2 or 'xcvnxc.PNG" from F2? How do you plan on associating a given file from F1 with the right corresponding file from F2, F3, etc.if their names are all different????
Also even if the names are the same in two folders, it's not guaranteed that the operating system will say the 3rd file from each folder has the same names. The orders may be different even if all the names are the same.
Respuestas (1)
David Hill
el 28 de Nov. de 2022
a=dir('F1/');b=dir('F2/');c=dir('F3/');
for k=1:length(a.name)
i1=imread([a(k).folder,'/',a(k).name]);
i2=imread([b(k).folder,'/',b(k).name]);
%do some stuff
end
0 comentarios
Ver también
Categorías
Más información sobre Import, Export, and Conversion 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!