在MATLAB中加载多个'.bmp'图像 [英] Loading multiple '.bmp' images in MATLAB
本文介绍了在MATLAB中加载多个'.bmp'图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
im试图将一组扩展名为'.BMP'的图像加载到matlab,以便对每个图像进行一些处理,这是我的代码:
im trying to load a group of images with the extension'.BMP' to matlab to do some process over each, and here is my code:
s=dir('*.jpg')
numel(s)
for n=1:numel(s)
load(s(n).name);
% my processes over each image
end
但是我得到了这个错误:
but i got this errur:
Error using load
Number of columns on line 3 of ASCII file
D:\Study\Memo_Master\Group Images
Comprission\Matlabs\1.bmp must be the same as
previous lines.
其中"1.bmp"是图像,位于文件目标位置. 有帮助吗?
where '1.bmp' is a image exist in the file destination. ANY HELP??
推荐答案
load
函数旨在加载mat文件(即二进制数据文件),而不是图像.要加载图像,应改为使用imread
函数.
The load
function is aimed at loading mat-files (i.e. binary data files), not images. To load images, you should use the imread
function instead.
在您的代码中:
s = dir('*.bmp');
for n = 1:numel(s)
Img = imread(s(n).name);
% my processes over each image
end
最好
这篇关于在MATLAB中加载多个'.bmp'图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文