%透视变换
i=imread('cameraman.tif');
udata=[0 1];
vdata=[0 1];
tform=maketform('projective',[0 0; 1 0; 1 1;0 1],...
[-4 2;-8 -3;-3 -5;6 3]);
[b,xd,yd]=imtransform(i,tform,'bicubic',...
'udata',udata,...
'vdata',vdata,...
'size',size(i),...
'fill',128);
subplot(1,2,1),imshow(udata,vdata,i),axis on;
subplot(1,2,2),imshow(udata,vdata,b),axis on;
|