标签:
%% 储存某目录所有的图片
1
2
3
4
5
6
7
8
9
|
pt = ‘d:\imgs\‘; ext = ‘*.jpg‘ ; dis = dir([pt ext]); nms = {dis.name}; for k = 1 :length(nms) nm = [pt nms{k}]; % 注意要加上路径 my_images{k} = imread(nm); end save( ‘my_images.mat‘ , ‘my_images‘ );
|
%% 调用
1
2
3
4
5
|
clc; clear all; load my_images.mat p1 = my_images{ 1 }; imshow(p1); |
标签:
原文地址:http://www.cnblogs.com/anyview/p/5033070.html