Draw a circle on an image

Insert picture description here

A=imread('1.png');
figure(1),imshow(A)
[a,b,c]=size(A);
[x,y]=ginput();
R=50;
t = linspace(0,2*pi, 2e2);
xt = x + R*cos(t);
yt = y + R*sin(t);
for i = 1 : length(xt)
 A(round(yt(i)),round(xt(i)),1) = 255;
 A(round(yt(i)),round(xt(i)),2) = 0;
 A(round(yt(i)),round(xt(i)),3) = 0;
end
figure(2),imshow(A,[])

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_40653652/article/details/114855543