Matlab批量处理图像思路

%% Matlab批处理图像框架
%————————————————————————————————–
% 此m文件是批量处理图像的框架
% 2009.10.12 shine
shuchong1987@sina.com
%————————————————————————————————–

%% 命令集

t = cd(‘xxxxx’); % dos命令cd重置当前路径,自行设置,其下包含全部待处理文件

allnames = struct2cell(dir);%dos命令dir列出所有的文件,用struct2cell转换为元胞数组

[m,n] = size(allnames);

for i= 3:n

name = allnames{1,i} %逐次取出文件名

filename = [t,’\’,name]%组成文件名

I = imread(filename);%本人测试了一下,imread要比importdata效率高一些

//Do your own work

end

This entry was posted in Others. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *