hi; I have a set of circles where each circle is defined by its center position (x,y) and its radius r. i want to find a way in order to draw those circles on a given image* Img* . i used a matrix with three columns [x y r] to store the set of circles. any idea please? thank you

 채택된 답변

Elad
Elad 2012년 6월 6일

0 개 추천

imshow(image);
hold on
% x, y: Center of the circle
% r: Radius of the circle
theta = 0 : (2 * pi / 10000) : (2 * pi);
pline_x = r * cos(theta) + x;
pline_y = r * sin(theta) + y;
plot(pline_x, pline_y, '-');
hold off

댓글 수: 6

thoraya
thoraya 2012년 6월 7일
thank you Elad.this work very well
i incorporated it in a for loop so it gave me good results
if i have another geometric shape ellipses or rectangle i do it with the same way?
thoraya
thoraya 2012년 6월 7일
thank you Elad.this work very well
i incorporated it in a for loop so it gave me good results
if i have another geometric shape ellipses or rectangle i do it with the same way?
thoraya
thoraya 2012년 6월 7일
thank you Elad.this work very well
i incorporated it in a for loop so it gave me good results
if i have another geometric shape ellipses or rectangle i do it with the same way?
thoraya
thoraya 2012년 6월 7일
thank you Elad.this work very well
i incorporated it in a for loop so it gave me good results
if i have another geometric shape ellipses or rectangle i do it with the same way?
Ryan
Ryan 2012년 6월 7일
Your comment is showing. You can use that method to plot any pair of x,y vectors on top of an image, you just need to know the equation that defines the shape.
is not working on my image. I want 1d 2d and 3d like r1 r2 and r3 circle on my image how can I add, please help me

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2012년 6월 6일

댓글:

2018년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by