필터 지우기
필터 지우기

how to draw a circle in an image?

조회 수: 1 (최근 30일)
ajeet verma
ajeet verma 2017년 3월 1일
답변: Image Analyst 2017년 3월 1일
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