Showing Error imread due the saved as of each image in the database of the folder

1 view (last 30 days)
Hello Image Analyst, I have issues with sytax below
for i=1:980
i1=num2str(i);
I = imread(['C:\Users\Administrator\Documents\DistortedImages\t',i1,'.bmp']);
Command Window
Error using imread
File "C:\Users\Administrator\Documents\DistortedImages\t1.bmp" does not exist.
It is observed that each image of the 980 distorted images is saved as t(1), t(2), t(3) and so on till it reaches the last image with t(980) all distorted images with different distortion types and levels.
Also, what is the syntax code using referenece image of about 20 images and corresponding distorted images which is about 980 images. with every reference image compared and obtain an output score with respect to the respective 49 distorted images
first reference image to 49 distorted images
second reference image to 49 distorted images
and so till it reaches the 20th refernce image and corresponding distorted image
All the distorted images are in the database are saved as t(1), t(2) and on till it reaches t(980).
Thank you in advance.
  3 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 26 Dec 2018
You should use the robust code in the FAQ: The FAQ
So either use dir() to get what files are actually there, OR build up the filename with sprintf() but check with exist() if the file is actually there before trying to process it.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!