OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 31 Aug 2012 08:21:29 -0500fast way to draw ellipse axes?http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/Is there any way to draw ellipse axes in opencv?Fri, 31 Aug 2012 01:46:15 -0500http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/Comment by Rui Marques for <p>Is there any way to draw ellipse axes in opencv?</p>
http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?comment=1951#post-id-1951What information you have about the ellipse, do you know its center coordinates, width and height, more?Fri, 31 Aug 2012 04:36:51 -0500http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?comment=1951#post-id-1951Answer by Rui Marques for <p>Is there any way to draw ellipse axes in opencv?</p>
http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?answer=1953#post-id-1953These are a couple of opencv functions regarding ellipses:
// this outputs to 'pts' the points representing an ellipse arc defined by the other parameters
Core.ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, pts);
// this draws an ellipse
Core.ellipse(img, center, axes, angle, startAngle, endAngle, color);
**axes** parameter is of type Size and means the width and height of the axes.
I will improve the answer if you provide more details.Fri, 31 Aug 2012 04:42:13 -0500http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?answer=1953#post-id-1953Comment by Rui Marques for <p>These are a couple of opencv functions regarding ellipses:</p>
<pre><code>// this outputs to 'pts' the points representing an ellipse arc defined by the other parameters
Core.ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, pts);
// this draws an ellipse
Core.ellipse(img, center, axes, angle, startAngle, endAngle, color);
</code></pre>
<p><strong>axes</strong> parameter is of type Size and means the width and height of the axes.</p>
<p>I will improve the answer if you provide more details.</p>
http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?comment=1962#post-id-1962If you have the RotatedRect that represents the ellipse then the middle of the RotatedRect four sides are the end of axes coordinates, right? So all you need is a method to get the coordinates of a point in the "middle" of a rectangle side. Let us know if you have troubles calculating that middle point.Fri, 31 Aug 2012 08:21:29 -0500http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?comment=1962#post-id-1962Comment by mrgloom for <p>These are a couple of opencv functions regarding ellipses:</p>
<pre><code>// this outputs to 'pts' the points representing an ellipse arc defined by the other parameters
Core.ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, pts);
// this draws an ellipse
Core.ellipse(img, center, axes, angle, startAngle, endAngle, color);
</code></pre>
<p><strong>axes</strong> parameter is of type Size and means the width and height of the axes.</p>
<p>I will improve the answer if you provide more details.</p>
http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?comment=1957#post-id-1957I use fitellipse for set of points and I have RotatedRect and I want to draw ellipse axes, actually I need coordinates of ends of axes, so I could warp one ellipse to another to fit.Fri, 31 Aug 2012 06:47:39 -0500http://answers.opencv.org/question/1945/fast-way-to-draw-ellipse-axes/?comment=1957#post-id-1957