how i can move an circle diagonal direction??

1 次查看(过去 30 天)
I have an image that contains a circle with a certine raduis , and i wanted to move it in a diagonal direction with 45 degree.what a new m,n should i do??
this is a code for an image:
s1=350;
s2=350;
ImageOrg1=zeros(s1,s2); %Image creation with [x by y] pixels
ImageOrg_sh=zeros(s1,s2);
rad= s1/30;
for m=1:s1
for n=1:s2
Di1=sqrt((m-s1/2)^2+(n-s2/2)^2);
if (Di1<=rad)
ImageOrg1(m,n)=1;
m_new=
n_new=
ImageOrg_sh(m_new,n_new)=1;
end
end
end
figure;imagesc(ImageOrg1); colormap gray; axis square
figure;imagesc(ImageOrg_sh); colormap gray; axis square

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by