Borrar filtros
Borrar filtros

how to save an image dataset into a specific folder

2 visualizaciones (últimos 30 días)
Hend Abouche
Hend Abouche el 14 de Mzo. de 2022
Comentada: Voss el 15 de Mzo. de 2022
Hello everyone, I'm trying to read from a folder and apply pre-processing techniques on an images dataset and then save the dataset to another folder, but it's not working for me,
here is my code and thanks in advance for your help
clear
close all;
Source = "my_dataset_source";
imds = imageDatastore(Source,"IncludeSubfolders",true,"FileExtensions",".jpg");
for i= 1 :size(imds.Files,1)
I = readimage(imds,i);
%*************************processing images
FileName = fullfile('D:\targetfolder',sprintf('%d.jpg',i));
imwrite(I,sprintf('%d.jpg',i),'jpg');
end

Respuesta aceptada

Voss
Voss el 14 de Mzo. de 2022
FileName = fullfile('D:\targetfolder',sprintf('%d.jpg',i));
imwrite(I,FileName,'jpg');
  2 comentarios
Hend Abouche
Hend Abouche el 15 de Mzo. de 2022
thank you for your answer, It worked
Voss
Voss el 15 de Mzo. de 2022
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by