Azzera filtri
Azzera filtri

how i can move an circle diagonal direction??

1 visualizzazione (ultimi 30 giorni)
yasmeen hadadd
yasmeen hadadd il 7 Ott 2019
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

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by