how i can move an circle diagonal direction??

조회 수: 1 (최근 30일)
yasmeen hadadd
yasmeen hadadd 2019년 10월 7일
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