Ask Your Question

# fast way to draw ellipse axes?

Is there any way to draw ellipse axes in opencv?

edit retag close merge delete

## Comments

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

( 2012-08-31 04:36:51 -0600 )edit

## 1 answer

Sort by ยป oldest newest most voted

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.

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.

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

( 2012-08-31 08:21:29 -0600 )edit

Official site

GitHub

Wiki

Documentation

## Stats

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

Seen: 1,442 times

Last updated: Aug 31 '12