how i can move an circle diagonal direction??
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!