主题: [MATLAB图像处理] 大家帮忙看一看哪里出了问题呢
查看单个帖子
旧 2009-04-21, 19:46   #1
gj9951101
初级会员
 
注册日期: 2009-02-11
年龄: 41
帖子: 7
声望力: 0
gj9951101 正向着好的方向发展
默认 大家帮忙看一看哪里出了问题呢

谁能帮我看看这个对图像刚性变换的程序哪里出了问题,为什么只能旋转,不能平移呢?
function image_transform
f=imread('E:\photos\128128.bmp');
[m,n]=size(f);
fc=[m/2,n/2,1]
theta=pi/18;
T=[cos(theta),sin(theta),0;
-sin(theta),cos(theta),0
10,10,1];
ii=0;
for i=1:m
ii=ii+1; jj=0;
for j=1:n
jj=jj+1;
pf=[i,j,1];
pr=T*(pf-fc)'+fc';
if pr(1)>=m||pr(1)<=1||pr(2)<=1||pr(2)>=n
g(ii,jj)=0 ;
else
g(ii,jj) = BilinearInterplate(f,pr);
end
end
end
gj9951101 当前离线   回复时引用此帖