Read@CVL
rdf::Ellipse Class Reference

#include <Shapes.h>

Collaboration diagram for rdf::Ellipse:

Public Member Functions

 Ellipse ()
 
 Ellipse (const Vector2D &center, const Vector2D &axis=Vector2D(), double angle=0.0)
 
 Ellipse (const cv::RotatedRect &rect)
 
bool isNull () const
 
bool isValid () const
 
QString toString () const
 
void setCenter (const Vector2D &center)
 
Vector2D center () const
 
void setAxis (const Vector2D &axis)
 
Vector2D axis () const
 
void scale (double factor)
 Scales the ellipse (center and size). More...
 
double majorAxis () const
 The ellipses major axis. More...
 
double minorAxis () const
 The ellipse's minor axis. More...
 
double radius () const
 The mean of major and minor axis. More...
 
double area () const
 
Rect bbox (bool squared=false) const
 Returns the ellipse's axis aligned bounding box. More...
 
cv::Mat toCov () const
 Converts the convidence ellipse to a covariance matrix. More...
 
void setAngle (double angle)
 
double angle () const
 
void move (const Vector2D &vec)
 
void draw (QPainter &p, double alpha=0.0) const
 
void pdf (cv::Mat &img, const Rect &box=Rect()) const
 
cv::Mat toBinaryMask (const Rect &box=Rect()) const
 
Vector2D getPoint (double angle) const
 Returns a point on the ellipse at the specified angle. 0 degree corresponds to the positive x-axis. The angle is clockwise. More...
 

Static Public Member Functions

static Ellipse fromData (const std::vector< cv::Point > &pts)
 
static Ellipse fromData (const QVector< Vector2D > &pts)
 
static Ellipse fromData (const cv::Mat &pts, const Vector2D &center)
 Returns the best fitting ellipse. More...
 

Protected Attributes

bool mIsNull = true
 
Vector2D mCenter
 
Vector2D mAxis
 
double mAngle = 0.0
 

Friends

DllCoreExport friend QDebug operator<< (QDebug d, const Ellipse &e)
 

Constructor & Destructor Documentation

rdf::Ellipse::Ellipse ( )
rdf::Ellipse::Ellipse ( const Vector2D center,
const Vector2D axis = Vector2D(),
double  angle = 0.0 
)
rdf::Ellipse::Ellipse ( const cv::RotatedRect &  rect)

Member Function Documentation

double rdf::Ellipse::angle ( ) const
double rdf::Ellipse::area ( ) const
Vector2D rdf::Ellipse::axis ( ) const
Rect rdf::Ellipse::bbox ( bool  squared = false) const

Returns the ellipse's axis aligned bounding box.

Parameters
squaredif set to true, the bounding box is squared (e.g. for pdfs).
Returns
Vector2D rdf::Ellipse::center ( ) const
inline
void rdf::Ellipse::draw ( QPainter &  p,
double  alpha = 0.0 
) const
Ellipse rdf::Ellipse::fromData ( const std::vector< cv::Point > &  pts)
static
Ellipse rdf::Ellipse::fromData ( const QVector< Vector2D > &  pts)
static
Ellipse rdf::Ellipse::fromData ( const cv::Mat &  pts,
const Vector2D center 
)
static

Returns the best fitting ellipse.

Parameters
ptsa N x 2 CV_32FC1 matrix representing the 2D points.
centerThe ellipses center.
Returns
Vector2D rdf::Ellipse::getPoint ( double  angle) const

Returns a point on the ellipse at the specified angle. 0 degree corresponds to the positive x-axis. The angle is clockwise.

Parameters
angleAn angle.
Returns
bool rdf::Ellipse::isNull ( ) const
bool rdf::Ellipse::isValid ( ) const
double rdf::Ellipse::majorAxis ( ) const

The ellipses major axis.

Returns
double rdf::Ellipse::minorAxis ( ) const

The ellipse's minor axis.

Returns
void rdf::Ellipse::move ( const Vector2D vec)
void rdf::Ellipse::pdf ( cv::Mat &  img,
const Rect box = Rect() 
) const
double rdf::Ellipse::radius ( ) const

The mean of major and minor axis.

Returns
void rdf::Ellipse::scale ( double  factor)

Scales the ellipse (center and size).

Parameters
factorThe scale factor.
void rdf::Ellipse::setAngle ( double  angle)
void rdf::Ellipse::setAxis ( const Vector2D axis)
void rdf::Ellipse::setCenter ( const Vector2D center)
cv::Mat rdf::Ellipse::toBinaryMask ( const Rect box = Rect()) const
cv::Mat rdf::Ellipse::toCov ( ) const

Converts the convidence ellipse to a covariance matrix.

Returns
The covariance matrix (2 x 2 CV_64FC1)
QString rdf::Ellipse::toString ( ) const

Friends And Related Function Documentation

DllCoreExport friend QDebug operator<< ( QDebug  d,
const Ellipse e 
)
friend

Member Data Documentation

double rdf::Ellipse::mAngle = 0.0
protected
Vector2D rdf::Ellipse::mAxis
protected
Vector2D rdf::Ellipse::mCenter
protected
bool rdf::Ellipse::mIsNull = true
protected

The documentation for this class was generated from the following files: