Importing multiple jpg files using imread. File format error.
Mostrar comentarios más antiguos
Recently created a subset of script to import a number of .jpg files by putting them in a loop. This script has been working perfectly for me, until today. I've not changed anything and have tried this both on my personal PC and University PCs, and still get the same error.
I got the information for the script from this link and followed it exactly. http://uk.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html
My script looks like this:
jpegFiles = dir('*.jpg');
numfiles = length(jpegFiles);
images = cell(1, numfiles);
for k = 1:numfiles
images{k} = imread(jpegFiles(k).name);
end
Previously, as I mentioned, there have been no problems. I now suddenly get this error, and have tried all I can think of!
Error using imread (line 362)
Unable to determine the file format.
Error in imagesin (line 6)
images{k} = imread(jpegFiles(k).name);
I am new to this and any suggestions would be appreciated!
Thanks in advance.
Respuesta aceptada
Más respuestas (1)
Muhammad Usman Saleem
el 24 de Jun. de 2016
jpegFiles = dir('*.jpeg');
numfiles = size(jpegFiles);
try to use this
1 comentario
Kelsey Frewin
el 24 de Jun. de 2016
Categorías
Más información sobre Desktop en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!