matlab 폴더에 있는 모든 그림을 대량으로 읽는 몇 가지 방법

%            1.bmp  2.bmp.......
clear;clc;
file_path =  '               \';
img_path_list = dir(strcat(file_path,'*.bmp'));
img_num = length(img_path_list);
if img_num > 0
    for j = 1:img_num
        image =  imread(strcat(int2str(j),'.bmp'));
        % %   
        % image_name = img_path_list(j).name;
        % image =  imread(strcat(file_path,image_name));    
        
    end
end

%            first1.jpg first2.jpg....first50.jpg.....
clear all;
clc;
file_path1 ='C:\Users\Administrator\Desktop\1\';
img_path_list1 = dir(strcat(file_path1,'*.jpg'));
Len= length(img_path_list1);                                            %         (              )
for k=1:Len
    Img = imread([file_path1,'first',num2str(k),'.jpg']);
    imshow(Img)
end

 
 
 
%            first00001.bmp  first00002.bmp.......first00050.bmp  
clear;clc;  
file_path =  '               \';  
img_path_list = dir(strcat(file_path,'*.bmp'));  
img_num = length(img_path_list);  
if img_num > 0  
    for j = 1:img_num  
        is=num2str(Startframe1);  
        number = '00000';  %        0      6 0   
        number(end-length(is)+1:end)=is;  
        filename11=[ file_path1 'first' number '.bmp'];  
        image = imread(filename11);  
    end  
end  

 
 
 
% 삭제

좋은 웹페이지 즐겨찾기