Reading an image from path stored in a text file using IMREAD
Show older comments
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 Comment
Paulo Silva
on 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)
Accepted Answer
More Answers (1)
Imran
on 9 Apr 2011
0 votes
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!