[1422d3]: / util / imrotateAng.m

Download this file

18 lines (11 with data), 356 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
function [t3] = imrotateAng(im, rotMethod, pad, padMethod, angle)
%pad
t = padarray(im, pad, padMethod);
%get center
center = round([size(t,1) / 2, size(t,2) / 2]);
%rotate around center
t2 = rotateAround(t, center(1), center(2), angle, rotMethod);
%get crop area
rect = [pad(1)+1, pad(2)+1, size(im,2)-1, size(im,1)-1];
%crop
t3 = imcrop(t2, rect);