g = imresize(f, scale);
g = imresize(f, [ROW COL]);
圖像旋轉使用:
g = imrotate(f, angle);
圖像剪切使用:
g = imcrop(f, [X, Y, WIDTH, HEIGHT]);
在matlab中使用imtransform實現圖像的空間變換。語法是
g = imtransform(f, tform, interp);
其中,interp可以是'nearest','bilinear'或者'bicubic'。
比如:
f = chekerboard(50);
s = 0.8;
theta = pi/6;
T = [s*cos(theta) s*sin(theta) 0;-s*sin(theta) s*cos(theta) 0;0 0 1];
tform = maketform('affine', T);
g = imtransform(f, tform);