How to draw circle with imellipse?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi
I want to draw a circle with imellipse. I used something like:
AA = imellipse(gca,[xmin ymin radius radius]);
but I can only specify the xmin and ymin of the circle, while I want to specify the center.
How can I do so?
Thanks!
Steven
0 件のコメント
採用された回答
Image Analyst
2014 年 1 月 18 日
2 件のコメント
Image Analyst
2014 年 1 月 18 日
編集済み: Image Analyst
2014 年 1 月 18 日
If you really want to do it with imellipse, you can just compute the xmin and ymin from the diameter. By the way, imellipse takes width and height (diameter) not radius.
diameter = 10;
radius = diameter / 2;
xCenter = 60;
yCenter = 30;
xMin= xCenter - radius;
yMin = yCenter - radius;
hEllipse = imellipse(gca,[xMin, yMin, diameter, diameter]);
% Plot center
hold on;
plot(xCenter, yCenter, 'r+', 'LineWidth', 5, 'MarkerSize', 20);
grid on;
その他の回答 (1 件)
Tim Jackman
2018 年 9 月 25 日
In R2018b you can create a circular ROI with the drawcircle function.
3 件のコメント
Image Analyst
2019 年 2 月 18 日
編集済み: Image Analyst
2019 年 2 月 18 日
It does have a 'DrawingArea' option to restrict the drawing area to what you specify.
Have you tried waitfor()?
参考
カテゴリ
Help Center および File Exchange で Particle Swarm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!