Creating Bounding rotated boxes and ellipses for contours {#tutorial_bounding_rotated_ellipses}
=========================================================

Goal
----

In this tutorial you will learn how to:

-   Use the OpenCV function @ref cv::minAreaRect
-   Use the OpenCV function @ref cv::fitEllipse

Theory
------

Code
----

This tutorial code's is shown lines below. You can also download it from
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp)
@include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp

Explanation
-----------

Result
------

Here it is:
![](images/Bounding_Rotated_Ellipses_Source_Image.jpg)
![](images/Bounding_Rotated_Ellipses_Result.jpg)
