导入多个图像matlab [英] importing multiple images matlab

查看:183
本文介绍了导入多个图像matlab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组连续命名的100个jpg图像,我想将它们添加起来以获得单个图像。我已经看到这里的答案,但它不和我一起跑,发生什么事了?

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?

这是代码:

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,[]); 

以下是错误消息:

Error using ==> imread
Can't open file "C:" for reading;
you may not have read permission.


推荐答案

反斜杠是 sprintf()并需要进行转义。使用\\而不是\或尝试以另一种方式构建文件路径。 fullfile()是一种很好的方法,所以你只需要使用sprintf作为文件名部分。另请参阅 help sprintf

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.

这篇关于导入多个图像matlab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆