Reading an image from path stored in a text file using IMREAD
Mostra commenti meno recenti
I want to use imread() for reading an image by giving the path stored in a text file, given as input argument. I get an error saying Error in ==> imread at 199 if (strfind(filename, '://'))
WHAT SHALL BE DONE TO GET IT THROUGH?
the code is
fid=fopen('d:/output.txt','r'); data_line = fgetl(fid); data_line [a b] = strread(data_line, '%s %s', 'delimiter', ','); fclose(fid);
% where a and b are the paths i.e d:\pic\image_3.bmp and d:\pic\image_2.bmp
m1 = imread(a); m2 = imread(b);
1 Commento
Paulo Silva
il 8 Apr 2011
what's inside a and b after the strread function?
(just remove the ; after the strread function and look at the results in the command line)
Risposta accettata
Più risposte (1)
Imran
il 9 Apr 2011
0 voti
Categorie
Scopri di più su Convert Image Type in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!