Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [steps,diffs] = rotate(img)
- steps = [];
- diffs = [];
- [n,m] = size(img)
- BigImg = zeros(1024)
- BigImg((n/2):(n/2+n-1) , (m/2):(m/2+m-1)) = img
- for fi=7:7:42
- steps = [steps,fi];
- Rotated = imrotate(BigImg,fi,'crop');
- Rotatedback = imrotate(Rotated,-fi,'crop');
- Rotatedback = Rotatedback((n/2):(n/2+n-1) , (m/2):(m/2+m-1))
- imwrite(Rotatedback,'corvi_peppers_transformed.pgm')
- corr = Extract('peppers.pgm','corvi_peppers_transformed.pgm','corvi')
- diffs = [diffs,str2double(corr)];
- end
- %figure;
- %subplot(1,3,1); imshow(uint8(img)); title('Input');
- %subplot(1,3,2); imshow(uint8(Rotated)); title('Big');
- %subplot(1,3,3); imshow(uint8(Rotatedback)); title('Rotated');
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement