# bounding ellipse needed

Is there a method to get the bounding ellipse of a contour. I mean all the points should be inside the ellipse. fitEllipse get the best fitting ellipse,not the bounding ellipse.

bounding ellipse needed

add a comment

2

No, OpenCV don't have method that finds bounding ellipse. But it has function called minAreaRect that finds bounding rotated rectangle of the minimum area. It may give you results that are pretty close to bounding ellipse. Or you may use minEnclosingCircle function if your ellipse is close enough to circle.

Thank you very much~~I have a problem that need to describe the degree of ellipse of a contour. and I want to extract the bounding ellipse, then compare the contour's area and its bounding ellipse area. minAreaRect is not suitable. And I think I can judge by each pixel inside the contour, But I can not get all the points inside the contour.

Ellipse and rotated rectangle have same degrees of freedom: center, width, height and angle. minAreaRect will give you results that are pretty close to bounding ellipse. Actually, if your points really form an ellipse then results of bounding ellipse and minAreaRect will be identical.

I know you point. hope opencv will have a bounding ellipse api in the future.

Asked: **
2013-09-30 23:16:18 -0500
**

Seen: **249 times**

Last updated: **Oct 01 '13**

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.