您的位置:首页 > 其它

图像处理(空间变换)

2010-12-12 17:40 260 查看
空间变换是将输入图像的像素位置映射到输出图像的新位置。

常用的图像几何操作:缩放、旋转、透视变换

示例一:剪变换

I=imread('cameraman.tif');

tform=maketform('affine',[1 0 0;.5 1 0;0 0 1]);

J=imtransform(I,tform);

subplot(1,2,1);imshow(I);

subplot(1,2,2);imshow(J);

示例二:透视变换

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,xdata,ydata]=imtransform(I,tform,'bicubic','udata',udata,'vdata',vdata,'size',size(I),'fill',128);

subplot(1,2,1);imshow(udata,vdata,I);

subplot(1,2,2);imshow(xdata,ydata,B);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: