how can i solve the error of reading permission during loading of number of images from a folder
Show older comments
d=dir('d:\train2');
for i=1:4
fname=d(i).name;
z=imread(fname,'bmp');
end
this code is giving error
??? Error using ==> imread at 358 Can't open file "." for reading; you may not have read permission.
help me out to solve this error please
Accepted Answer
More Answers (2)
Image Analyst
on 28 Apr 2013
0 votes
Try
d=dir('d:\train2\*.bmp');
3 Comments
tejas
on 29 Apr 2013
Abdullah
on 4 Apr 2016
Edited: Walter Roberson
on 12 Nov 2021
Hello I have the same issue can you share with me how you solved it ?
tu1=imread('C:\Users\Mostwanted\Desktop\Upgrade 03062016\Upgrade 03062016\Adaptive Exposure\AEx2\','*.jpg');
Walter Roberson
on 13 Nov 2021
projectdir = 'C:\Users\Mostwanted\Desktop\Upgrade 03062016\Upgrade 03062016\Adaptive Exposure\AEx2';
d = dir(fullfile(projectdir, '*.jpg'));
num_files = numel(d);
all_images = cell(num_files,1);
file_okay = false(num_files,1);
for K = 1 : num_files
fname = fullfile(projectdir, d(K).name);
try
all_images{K} = fread(fname);
file_okay(K) = true;
catch ME
warning('file "%s" is not a readable image', fname);
end
end
all_images = all_images(file_okay);
Zheng Heliang
on 3 Aug 2020
0 votes
I have the same issue, and finally I find out my problem: I opened too much files without closing them. https://www.mathworks.com/matlabcentral/answers/124335-caught-std-exception-exception-message-is-message-catalog-matlab-builtins-was-not-loaded-from-th
1 Comment
Walter Roberson
on 3 Aug 2020
Running out of file slots should never result in the error message reported here. The problem here is that the user assumed that the first two names returned were . and .. but Windows with NTFS does not make any promises about the order of files, and in practice there are several valid filename characters that can sort before .
Categories
Find more on Image Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!