how to draw a circle in an image?

1 次查看(过去 30 天)
i want to draw a circle on an image using this equation x^2+y^2=r
  1 个评论
Jan
Jan 2017-3-1
编辑:Jan 2017-3-1
According to this formula, the circle is a line with an infinitesimal width, such that it is invisible on the screen. Do you want to draw a disc? Do you mean r^2?

请先登录,再进行评论。

采纳的回答

Jan
Jan 2017-3-1
img = rand(100, 100, 3) * 0.2; % Test data
value = bsxfun(@plus, ((1:100) - 50) .^ 2, ((1:100).' - 50) .^ 2);
r = 30;
mask = value < (r + 1)^2 & value > (r - 1)^2;
mask3 = cat(3, mask, mask, mask);
img(mask3) = 1.0;
image(img);

更多回答(1 个)

Image Analyst
Image Analyst 2017-3-1

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by