How do I fix 'imread' related error ?

8 views (last 30 days)
Toyin Popoola
Toyin Popoola on 19 Apr 2015
Answered: Walter Roberson on 17 Jul 2015
I installed Matlab R2015a on a 64bit windows 8 laptop and have the image processing toolbox. All folders and subfolders are in the matlab work path.
PROBLEM 1. READING AN IMAGE
>> A= imread('boy14.jpg');
Error using assert
Too many input arguments.
Error in isjpg (line 8)
assert(fid ~= -1, message('MATLAB:imagesci:validate:fileOpen', filename));
Error in imftype (line 50)
tf = feval(fmt_s.isa, filename);
Error in imread (line 359)
[format, fmt_s] = imftype(filename);
2. TO DISPLAY MULTIPLE IMAGES
image_folder = 'B:\Matlabcode2015\codes\Mboy';
filenames = dir(fullfile(image_folder, '*.jpg'));
total_images = numel(filenames);
for n = 1:total_images
full_name= fullfile(image_folder, filenames(n).name);%specifies images names, full path and extension
our_images = imread(filenames); % Read images
figure (n) % used index n so old figs are not over written by new new figs
imshow(our_images)
end
THE ERROR MESSAGE I GET :
>> read_image
Error using imread>parse_inputs (line 457)
The file name or URL argument must be a string.
Error in imread (line 316)
[filename, fmt_s, extraArgs] = parse_inputs(varargin{:});
Error in read_image (line 8)
our_images = imread(filenames); % Read images

Answers (1)

Walter Roberson
Walter Roberson on 17 Jul 2015
Checking around, it appears most probably that you have your own assert.m that is being used instead of the MATLAB assert.m . Please check with
which -all assert
and probably the first entry is something you have added to your MATLAB path.

Categories

Find more on Image Processing and Computer Vision 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!