Ask Your Question
3

fast way to draw ellipse axes?

asked 2012-08-31 01:46:15 -0600

mrgloom gravatar image

Is there any way to draw ellipse axes in opencv?

edit retag flag offensive close merge delete

Comments

What information you have about the ellipse, do you know its center coordinates, width and height, more?

Rui Marques gravatar imageRui Marques ( 2012-08-31 04:36:51 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-08-31 04:42:13 -0600

Rui Marques gravatar image

These 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.

edit flag offensive delete link more

Comments

I 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.

mrgloom gravatar imagemrgloom ( 2012-08-31 06:47:39 -0600 )edit

If 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.

Rui Marques gravatar imageRui Marques ( 2012-08-31 08:21:29 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-08-31 01:46:15 -0600

Seen: 1,437 times

Last updated: Aug 31 '12