I have a set of 100 jpg images named consecutively and I want to add them up to get a single image. I have seen the answer from here, but it does not run with me, what happened?
Here is the code:
im = imread('C:\Documents and Settings\1026175117_1.jpg');
for i = 2:10
im = imadd(im,imread(sprintf('C:\Documents and Settings\1026175117_%d.jpg',i)));
end
im = im/1000;
imshow(im,[]);
Here's the error message:
Error using ==> imread
Can't open file "C:" for reading;
you may not have read permission.
Backslash is a special character for sprintf() and needs to be escaped. Either use "\\" instead of "\" or try constructing your file paths another way. fullfile() is a good way to do it, so you only have to use sprintf for the file name part. Also see help sprintf.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With