Info
This question is closed. Reopen it to edit or answer.
reading multiple imgaes from folder in a sequence
    3 views (last 30 days)
  
       Show older comments
    
I am using following code to read multiple images from a source folder, rotate them and save in target folder. However the images are not read in same sequence as they are in source folder. I want the images to be processed one by one in sequence from source folder. Can anyone please help me to identify the issue with this code.
folder = 'E:\Source folder\';
filePattern = fullfile(folder, '*.png');
myFiles = dir(filePattern);
for k = 1 : length(myFiles)
    fullFileName = fullfile(myFiles(k).folder, myFiles(k).name);
    imageArray = imread(fullFileName);   
    I1=(imageArray);
    figure
    imshow(I1);
    I2=I1';
    figure
    imshow(I2);
    Res='E:\target folder';
    mkdir(Res);
    baseFN= sprintf('%d.png',k);
    fullFileName = fullfile(Res,baseFN)
    imwrite(I2,fullFileName);
end
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
