📄 transform.m
字号:
function [J]=transform(I)
[m,n]=size(I);
Ar = size(I,1); % Ar = number of rows of the input image
Ac = size(I,2); % Ac = number of columns of the input image
Center = [(Ac+1)/2 (Ar+1)/2];
rm=35;
J=zeros(2*rm+1,2*rm+1);
for i=1:m
for j=1:n
the=pi*j/n;%y
ri=rm/4+3*i*rm/(4*m);
xx=ri*cos(the)+rm;
xx=round(xx);
yy=rm-ri*sin(the);
yy=round(yy);
the1=pi*j/n+pi;%y
ri1=rm/4+3*i*rm/(4*m);
xx1=ri1*cos(the1)+rm;
xx1=round(xx1);
yy1=rm-ri*sin(the1);
yy1=round(yy1);
if(xx>0&xx<=2*rm&yy>0&yy<=2*rm)
J(yy,xx)=I(i,j);
end
if(xx1>0&xx1<=2*rm&yy1>0&yy1<=2*rm)
J(yy1,xx1)=I(i,j);
end
end
end
figure,imshow(J);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -