Ask Your Question

orientation angle of ellipse

asked 2017-09-12 03:57:28 -0500

jappoz92 gravatar image

Hello everyone, I am having some trouble in understanding how the angle parameter of the ellipse function actually works. In the documentation it is meant to be anti-clockwise and referring to the main axis. Therefore, for instance, if I try to draw an ellipse of size (100,50) and angle 45 deg I expect it to be in the first quadrant while instead it is in the second.

For instance this:

ellipse(im, Point(im.cols/2, im.rows/2), Size(100, 50), 45, 0, 360, Scalar(200,0,0));

leads to the image below.

Of course if I switch the axis the orientation gets correct but this seems to be in contrast with the image shown in the documentation. (opencv drawing doc)

What am I misunderstanding?

image description

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2017-09-12 04:13:51 -0500

LBerger gravatar image

updated 2017-09-12 04:23:04 -0500

You can find some axis system in opencv explanation here or here center(0,0) is at upper left of image corner.

x axis is horizontal with positive value on the right

y axis is vertical Positive values down

90° means x axis becomes y axis after rotation

Ellipse is good image description

edit flag offensive delete link more


I knew this but if they say that the rotation sense is anticlockwise this is a bit misleading, at least in my opinion. Anyway, thanks for the answer

jappoz92 gravatar imagejappoz92 ( 2017-09-12 04:20:41 -0500 )edit

Warning your link is in opencv doc 2.4. Do you use opencv 2.4 or 3.3?

LBerger gravatar imageLBerger ( 2017-09-12 04:24:46 -0500 )edit

my version is 3.2

jappoz92 gravatar imagejappoz92 ( 2017-09-12 04:31:32 -0500 )edit

may be doc in 3.2 is wrong....

Doc is new Thanks to @pklab

all doc are here

LBerger gravatar imageLBerger ( 2017-09-12 04:34:23 -0500 )edit

Question Tools

1 follower


Asked: 2017-09-12 03:57:28 -0500

Seen: 1,844 times

Last updated: Sep 12 '17