How to store resize images into new directory?
Mostra commenti meno recenti
When I resize single image and store into new directory, it is working properly
filename='E:\img\xyz.jpg';
im = imread('E:\img\xyz.jpg');
k=imresize(im,[300,300]);
imwrite(k,'E:/Resizeimage/aa.jpg','jpg');
But when I resize all images from one directory and try to store into new directory, it is not working properly. I am posting here code. Can anybody tell me what is the problem?
srcFiles = dir('E:\img\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('E:\img\',srcFiles(i).name);
im = imread(filename);
k=imresize(im,[300,300]);
nm= 'E;/Resizeimage/';
nm1='srcFiles(i).name';
strcat(nm,nm1);
imwrite(k,nm,'jpg');
end
6 Commenti
anu
il 1 Dic 2016
Amal Soltan
il 24 Nov 2017
would u plz tell us how do you have solved the problem as i'm facing same problem in imwrite function As i found the new image folder is empty,
anu
il 21 Dic 2017
rakesh kumar y
il 15 Dic 2020
thank you it helped me
SUJIT KRISHNANKUTTY
il 15 Giu 2021
Thank you, it helped me too!!
Luqmaan Ahmad Zaidi
il 13 Dic 2022
Thank you!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su High Dynamic Range Images in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!