cl;
w=0.6; %放大或缩小的宽度
h=1.4; %放大或缩小的高度
img=imread('Corner.png');
imshow(img);
[m n]=size(img);
imgn=zeros(h*m,w*n);
rot=[h 0 0;0 w 0;0 0 1]; %变换矩阵x=h*u,y=w*v
inv_rot=inv(rot);
for x=1:h*m
for y=1:w*n
pix=[x y 1]*inv_rot;
imgn(x,y)=img(round(pix(1)),round(pix(2)));
end
end
figure,imshow(uint8(imgn))