36 #ifndef VP_ME_ELLIPSE_H
37 #define VP_ME_ELLIPSE_H
39 #include <visp3/core/vpColVector.h>
40 #include <visp3/core/vpMatrix.h>
42 #include <visp3/core/vpImagePoint.h>
43 #include <visp3/me/vpMeSite.h>
44 #include <visp3/me/vpMeTracker.h>
46 #include <visp3/core/vpColor.h>
47 #include <visp3/core/vpImage.h>
52 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
137 const unsigned int index_0 = 0;
138 const unsigned int index_1 = 1;
139 const unsigned int index_2 = 2;
140 nij[index_0] = m_n20;
141 nij[index_1] = m_n11;
142 nij[index_2] = m_n02;
159 const unsigned int index_0 = 0;
160 const unsigned int index_1 = 1;
161 const unsigned int index_2 = 2;
177 inline double getArea()
const {
return m_m00; }
262 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
286 bool trackArc =
false);
303 const vpImagePoint *pt2 =
nullptr,
bool trackCircle =
false);
309 void printParameters()
const;
332 m_thresholdWeight = 0;
334 else if (threshold > 1) {
335 m_thresholdWeight = 1;
338 m_thresholdWeight = threshold;
365 const double &E,
const double &smallalpha,
const double &highalpha,
385 const double &E,
const double &smallalpha,
const double &highalpha,
388 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
394 const double &E,
const double &smallalpha,
const double &highalpha,
401 const double &E,
const double &smallalpha,
const double &highalpha,
485 void computeAbeFromNij();
492 double computeAngleOnEllipse(
const vpImagePoint &pt)
const;
500 void computeKiFromNij();
507 void computeNijFromAbe();
516 void computePointOnEllipse(
const double angle,
vpImagePoint &iP);
534 double computeTheta(
double u,
double v)
const;
545 void getParameters();
576 void leastSquareRobustCircle(
const double &um,
const double &vm,
unsigned int &k,
vpColVector &w);
588 void leastSquareRobustEllipse(
const double &um,
const double &vm,
unsigned int &k,
vpColVector &w);
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
static const vpColor green
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that tracks an ellipse using moving edges.
double m_n20
Second order centered and normalized moments .
double m_arcEpsilon
Epsilon value used to check if arc angles are the same.
double getHighestAngle() const
vpImagePoint m_iPc
The coordinates of the ellipse center.
double getSmallestAngle() const
double m_vc
Value of v coordinate of iPc.
unsigned int m_numberOfGoodPoints
Number of correct points tracked along the ellipse.
double m_uc
Value of u coordinate of iPc.
bool m_trackCircle
Track a circle (true) or an ellipse (false).
void setEndpoints(const vpImagePoint &pt1, const vpImagePoint &pt2)
double m_m00
Ellipse area.
vpImagePoint getSecondEndpoint() const
vpImagePoint getFirstEndpoint() const
void setThresholdRobust(double threshold)
vpColVector get_ABE() const
unsigned int getNumberOfGoodPoints() const
std::list< double > m_angleList
Stores the value in increasing order of the angle on the ellipse for each vpMeSite.
bool m_trackArc
Track an arc of ellipse/circle (true) or a complete one (false).
double m_a
is the semi major axis of the ellipse.
vpImagePoint getCenter() const
double m_b
is the semi minor axis of the ellipse.
vpColVector get_nij() const
double m_se
Value of sin(e).
double m_n02
Second order centered and normalized moments .
unsigned int getExpectedDensity() const
unsigned int m_expectedDensity
Expected number of points to track along the ellipse.
double m_n11
Second order centered and normalized moments .
double m_ce
Value of cos(e).
double m_thresholdWeight
Threshold on the weights for the robust least square.
Contains abstract elements for a Distance to Feature type feature.
void initTracking(const vpImage< unsigned char > &I)
virtual void sample(const vpImage< unsigned char > &image, bool doNotTrack=false)=0
void track(const vpImage< unsigned char > &I)
void display(const vpImage< unsigned char > &I)