how to read imge from my subfolder ?

1 visualización (últimos 30 días)
youb mr
youb mr el 8 de Sept. de 2020
Editada: Mohammad Sami el 8 de Sept. de 2020
hello everu one i want to read image from my subfilder but i have this error this is my code
d = dir('.\databasee\**\*.bmp')
num =length(d)
for i = 1:num
% img(i) = readimage(d ,i);
% currentfilename = d(i).name;
image{i} = imread(d(i).name);
% images{i} = currentimage;
end
this is my message error
Error using imread>get_full_filename (line 566)
File "Cr_1.bmp" does not exist.
Error in imread (line 375)
fullname = get_full_filename(filename);
Error in Untitled (line 44)
image{i} = imread(d(i).name);

Respuestas (1)

Mohammad Sami
Mohammad Sami el 8 de Sept. de 2020
Editada: Mohammad Sami el 8 de Sept. de 2020
You need to include the folder name as well.
% currentfilename = fullfile(d(i).folder,d(i).name);
image{i} = imread(fullfile(d(i).folder,d(i).name));

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by