How can I rotate multi-image files?
이전 댓글 표시
I'm working on a project about analysing image data. I have a folder where contains 8 thousands images. Each image file has to be rotated in each specific angle. The angle data are in an excel file. I am a MATLAB beginner, please help me. Here is my code but I don't understand where is wrong. The error message shows 'Subscripted assignment dimension mismatch. Error in ImageRotate newImage(i) = imrotate(I,wd(i));'. I tested it in a director where there is only one gif image and set 'wd = num(2,8);), But I still got the same error message.
%load all images from a directory. AllImageRead.m
myFolder = '/Users/anqili/Documents/MATLAB/gifImage/';
filePattern = fullfile(myFolder,'*.gif');
scrFiles = dir(filePattern);
for k = 1:length(scrFiles)
baseFileName = srcFiles(k).name;
fullFileName = strcat(myFolder,baseFileName);
I = imread(fullFileName);
end
%load rotation angles from xls. WDirection.m
[num,txt] = xlsread('sta_201209_ver18.xls');
wd = num(:8);
%Rotate Images. ImageRotate.m
for i = 1:length(wd)
newImage(i) = imrotate(I,wd(i));
figure, imshow(newImage);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


