I have a folder with multiple images. The format of all images is .png. When I try to read all those images in a cell array I am getting following error.
Error:
Error using imread>get_format_info (line 543)
Unable to determine the file format.
Error in imread/call_format_specific_reader (line 464)
fmt_s = get_format_info(fullname);
Error in imread (line 440)
[X, map] = call_format_specific_reader();
%Specify training and test folders
train_fold = ['..',filesep,'Train_Set',filesep]; test_fold = ['..',filesep,'Test_Set',filesep];%Read train and test set images folder information
train_ims = dir(train_fold);test_ims = dir(test_fold);%Remove all the train folders that do not contain images
for i = 1:length(train_ims) if (length(train_ims(i).name)<10) train_ims(i).name = []; endendtrain_ims = train_ims(~cellfun('isempty',{train_ims.name}));% Remove all the test folders that do not contain images
for i = 1:length(test_ims) if (length(test_ims(i).name)<10) test_ims(i).name = []; endendtest_ims = test_ims(~cellfun('isempty',{test_ims.name}));for i = 1:length(train_ims) ims{i} = imread([train_fold,filesep,'compositeImage', num2str(i), '.png']); end
Best Answer