|
| HOMOG2D_INUMTYPE | area () const |
| | Area of ellipse. More...
|
| |
| void | draw (img::Image< cv::Mat > &, img::DrawParams dp=img::DrawParams()) const |
| | Draw Ellipse (Opencv implementation) More...
|
| |
| void | draw (img::Image< img::SvgImage > &, img::DrawParams dp=img::DrawParams()) const |
| | Draw Ellipse (SVG implementation) More...
|
| |
| std::pair< Line2d_< FPT >, Line2d_< FPT > > | getAxisLines () const |
| | Returns pair of axis lines of ellipse. More...
|
| |
| HOMOG2D_INUMTYPE | length () const |
| | Returns (approximate) perimeter of ellipse using the Ramanujan second formulae. More...
|
| |
| template<typename TX , typename TY > |
| void | moveTo (TX x, TY y) |
| | Move Ellipse to new location. More...
|
| |
| template<typename T1 > |
| void | moveTo (const Point2d_< T1 > &new_org) |
| | Move Ellipse to new location, given by new_org. More...
|
| |
| bool | operator!= (const Ellipse_ &e) const |
| | Comparison operator. Does normalization if required. More...
|
| |
| bool | operator== (const Ellipse_ &h) const |
| | Comparison operator. Does normalization if required. More...
|
| |
| template<typename FPT2 > |
| bool | pointIsInside (const Point2d_< FPT2 > &) const |
| | Returns true if point is inside ellipse. More...
|
| |
| template<typename TX , typename TY > |
| void | translate (TX dx, TY dy) |
| | Translate Ellipse. More...
|
| |
| template<typename T1 , typename T2 > |
| void | translate (const std::pair< T1, T2 > &ppt) |
| | Translate Ellipse. More...
|
| |
| Type | type () const |
| |
|
| | Ellipse_ () |
| | Default constructor: centered at (0,0), major=2, minor=1. More...
|
| |
| template<typename T1 , typename T2 = double, typename T3 = double> |
| | Ellipse_ (const Point2d_< T1 > &pt, T2 major=2., T2 minor=1., T3 angle=0.) |
| | Constructor 1. More...
|
| |
| template<typename T1 , typename T2 = double, typename T3 = double> |
| | Ellipse_ (T1 x, T1 y, T2 major=2., T2 minor=1., T3 angle=0.) |
| | Constructor 2. More...
|
| |
| | Ellipse_ (const Circle_< FPT > &cir) |
| | Constructor 3, import from circle. More...
|
| |
| template<typename FPT2 > |
| | Ellipse_ (const Ellipse_< FPT2 > &other) |
| | Copy-Constructor. More...
|
| |
|
| constexpr size_t | size () const |
| | Returns 1. More...
|
| |
| bool | isCircle (HOMOG2D_INUMTYPE thres=1.E-10) const |
| | Returns true if ellipse is a circle. More...
|
| |
| Point2d_< FPT > | getCenter () const |
| | Returns center of ellipse. More...
|
| |
| CPolyline_< FPT > | getOBB () const |
| | Returns oriented bounding box of ellipse as a closed Polyline. More...
|
| |
| auto | getBB () const |
| | Returns axis-aligned bounding box of ellipse. More...
|
| |
| HOMOG2D_INUMTYPE | angle () const |
| | Returns angle of ellipse. More...
|
| |
| std::pair< HOMOG2D_INUMTYPE, HOMOG2D_INUMTYPE > | getMajMin () const |
| |
| HOMOG2D_INUMTYPE | determ () const |
| | Return determinant of matrix. More...
|
| |
| matrix_t< FPT > & | getRaw () |
| |
| const matrix_t< FPT > & | getRaw () const |
| |
| Matrix_ & | inverse () |
| | Inverse matrix. More...
|
| |
| bool | isNormalized () const |
| |
| | Matrix_ () |
| | Constructor. More...
|
| |
| template<typename FPT2 > |
| | Matrix_ (const Matrix_< FPT2 > &other) |
| | Copy-Constructor. More...
|
| |
| template<typename T > |
| void | set (size_t r, size_t c, T v) |
| |
| Matrix_ & | transpose () |
| | Transpose and return matrix. More...
|
| |
| const FPT & | value (size_t r, size_t c) const |
| |
| FPT & | value (size_t r, size_t c) |
| |
| std::pair< int, int > | dsize () const |
| | Get data size expressed as number of bits for, respectively, mantissa and exponent. More...
|
| |
| Dtype | dtype () const |
| | Get numerical data type as a Dtype value, can be stringified with h2d::getString(Dtype) More...
|
| |
| template<typename T > |
| constexpr bool | isInside (const Common< T > &) const |
| | This function is a fallback for all sub-classes that do not provide such a method. More...
|
| |
| size_t | size () const |
| |
| virtual | ~Root () |
| |
template<typename FPT>
class h2d::Ellipse_< FPT >
Ellipse as a conic in matrix form.
This enables its projection using homography
See:
General equation of an ellipse:
\[ A x^2 + B x y + C y^2 + D x + E y + F = 0 \]
It can be written as a 3 x 3 matrix:
\[ \begin{bmatrix} A & B/2 & D/2 \\ B/2 & C & E/2 \\ D/2 & E/2 & F \end{bmatrix} \]
Matrix coefficients computed from center x0,y0, major and minor distances (a,b) and angle theta:
\[ \begin{aligned} A &= a^2 \sin^2\theta + b^2 \cos^2\theta \\ B &= 2\left(b^2 - a^2\right) \sin\theta \cos\theta \\ C &= a^2 \cos^2\theta + b^2 \sin^2\theta \\ D &= -2A x_\circ - B y_\circ \\ E &= - B x_\circ - 2C y_\circ \\ F &= A x_\circ^2 + B x_\circ y_\circ + C y_\circ^2 - a^2 b^2 \end{aligned} \]
Homography projection: https://math.stackexchange.com/a/2320082/133647
\[ Q' = H^{-T} \cdot Q \cdot H^{-1} \]