Borrar filtros
Borrar filtros

Ho can i imread all images in the Path

4 visualizaciones (últimos 30 días)
abdullah al-dulaimi
abdullah al-dulaimi el 4 de Nov. de 2022
Comentada: abdullah al-dulaimi el 4 de Nov. de 2022
I have this Code for only one image, I want to convert code to imread all images in the path = ('C:\Users\hp\Desktop\New folder (4)\boss_256_0.4\cover')., and second path=
%% Getting the input images
% disp('Provide the main image...')
[img_file1, img_path1] = uigetfile({'*.png'});
img1 = imread([img_path1,img_file1]);

Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Nov. de 2022
img_path1 = 'C:\Users\hp\Desktop\New folder (4)\boss_256_0.4\cover';
dinfo = dir( fullfile(img_path1, '*.png') );
filenames = fullfile({dinfo.folder}, {dinfo.name});
numfiles = length(filenames);
results = zeros(numfiles, SomethingAppropriate);
for K = 1 : numfiles
thisfilename = filenames{K};
img1 = imread(thisfilename);
%now process img1
results(K,:) = something appropriate
end
You might also want to start looking at the flows permitted by imageDatastore -- especially in combination with tools such as augmentedImageDatastore which can automatically resize and convert to rgb or grayscale, so that your later code does not need to worry about that.
  1 comentario
abdullah al-dulaimi
abdullah al-dulaimi el 4 de Nov. de 2022
thank you brother, i ask a a new question, check it please mybe you can help me.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by