read all .exr files

Hi, I'm using this user-defined function (exrread) to read .exr file but how can I read all of my .exr files at once? I try to use dir and put .* after the name of the file but I still couldn't get the list of all my files. k=exrread('file.exr'); This k value will be used to calculate MSE.

Respuestas (1)

Walter Roberson
Walter Roberson el 6 de Dic. de 2016

0 votos

dinfo = dir('*.exr');
nfile = length(dinfo);
for K = 1 : nfile
thisfile = dinfo(K).name;
try
data = exrread(thisfile);
fprintf('Was able to read file "%s"\n', thisfile);
catch
fprintf('Was not able to read file "%s"\n', thisfile);
end
end

4 comentarios

shazwani seth
shazwani seth el 7 de Dic. de 2016
Editada: Walter Roberson el 7 de Dic. de 2016
Hi, what I mean is I have these coding:
F1= exrread('beerfest_lightshow_01_001591.exr');
F2= exrread('001.exr');
MSE=MSE1(F1,F2);
but that only calculate the MSE for one image. I have 94 images, what should I put to make a loop on this system in order for me to get the MSE for all 94 images in one run? thanks
Walter Roberson
Walter Roberson el 7 de Dic. de 2016
Is each of the 94 images to be compared to each of the other 93 images, for a total of (93*94)/2 MSE values calculated? If not then which image is to be compared to which other image?
shazwani seth
shazwani seth el 7 de Dic. de 2016
I have 94 compressed images to be compared to their respective original images.
Walter Roberson
Walter Roberson el 7 de Dic. de 2016
Are the compressed files and the original files in different directories? Given the name of a compressed file, how can you determine the name of the original file (or the other way around) ?

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 6 de Dic. de 2016

Comentada:

el 7 de Dic. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by