How can read a particular file pattern and store it in the same pattern?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
My folder consists of 1000 images. File names are of pattern P1_G1_1,P1_G1_2,.................P1_G1_10
P1_G2_1.....................................P1_G2_10
.
.
.
P10_G10_1.....................................P10_G10_10
After the rotation I want to store them in a different folder using the same name pattern . How to do this ?
0 commentaires
Réponse acceptée
darova
le 14 Mai 2019
I'd use loops (not tested)
path = 'd:\Studying\matlab\'; % read from
dest = 'd:\Studying\SolidWorks\'; % save to
for i = 1:10
for j = 1:10
for k = 1:10
f = sprintf('P%i_G%i_%i.png',i,j,k); % file name with ".png" extension
A = imread([path, f]); % read image
B = imrotate(A,10); % roate image by 10 degree
imwrite(B,[dest, f]); % save rotated image
end
end
end
6 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing and Computer Vision dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!