在一幅图像上画圆

在这里插入图片描述

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,[])

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40653652/article/details/114855543