![]() |
Visual Servoing Platform
version 3.6.1 under development (2023-10-03)
|
#include <visp3/me/vpMeEllipse.h>
Public Member Functions | |
vpMeEllipse () | |
vpMeEllipse (const vpMeEllipse &me_ellipse) | |
virtual | ~vpMeEllipse () |
void | display (const vpImage< unsigned char > &I, const vpColor &col, unsigned int thickness=1) |
vpColVector | get_nij () const |
vpColVector | get_ABE () const |
double | getArea () const |
vpImagePoint | getCenter () const |
unsigned int | getExpectedDensity () const |
unsigned int | getNumberOfGoodPoints () const |
vpImagePoint | getFirstEndpoint () const |
double | getHighestAngle () const |
vpImagePoint | getSecondEndpoint () const |
double | getSmallestAngle () const |
void | initTracking (const vpImage< unsigned char > &I, bool trackCircle=false, bool trackArc=false) |
void | initTracking (const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &iP, bool trackCircle=false, bool trackArc=false) |
void | initTracking (const vpImage< unsigned char > &I, const vpColVector ¶m, vpImagePoint *pt1=NULL, const vpImagePoint *pt2=NULL, bool trackCircle=false) |
void | printParameters () const |
void | setEndpoints (const vpImagePoint &pt1, const vpImagePoint &pt2) |
void | setThresholdRobust (double threshold) |
void | track (const vpImage< unsigned char > &I) |
Public Member Functions Inherited from vpTracker | |
vpColVector | get_p () const |
vpColVector | get_cP () const |
Public Attributes | |
Public Attributes Inherited from vpMeTracker | |
std::list< vpMeSite > | list |
vpMe * | me |
unsigned int | init_range |
int | nGoodElement |
const vpImage< bool > * | m_mask |
int | query_range |
bool | display_point |
Public Attributes Inherited from vpTracker | |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Protected Attributes | |
Protected Attributes Inherited from vpMeTracker | |
vpMeSite::vpMeSiteDisplayType | selectDisplay |
Deprecated functions | |
vpColVector | K |
vpImagePoint | iPc |
double | a |
double | b |
double | e |
vpImagePoint | iP1 |
vpImagePoint | iP2 |
double | alpha1 |
double | alpha2 |
double | ce |
double | se |
std::list< double > | angle |
double | m00 |
double | mu11 |
double | mu20 |
double | mu02 |
double | m10 |
double | m01 |
double | m11 |
double | m02 |
double | m20 |
double | thresholdWeight |
double | m_alphamin |
double | m_alphamax |
double | m_uc |
double | m_vc |
double | m_n20 |
double | m_n11 |
double | m_n02 |
unsigned int | m_expectedDensity |
unsigned int | m_numberOfGoodPoints |
bool | m_trackCircle |
bool | m_trackArc |
double | m_arcEpsilon |
vp_deprecated double | getA () const |
vp_deprecated double | getB () const |
vp_deprecated double | getE () const |
vp_deprecated double | get_m00 () const |
vp_deprecated double | get_m10 () const |
vp_deprecated double | get_m01 () const |
vp_deprecated double | get_m11 () const |
vp_deprecated double | get_m20 () const |
vp_deprecated double | get_m02 () const |
vp_deprecated double | get_mu11 () const |
vp_deprecated double | get_mu02 () const |
vp_deprecated double | get_mu20 () const |
vp_deprecated void | getEquationParam (double &A, double &B, double &E) |
vp_deprecated void | initTracking (const vpImage< unsigned char > &I, const vpImagePoint ¢er_p, double a_p, double b_p, double e_p, double low_alpha, double high_alpha) |
vp_deprecated void | initTracking (const vpImage< unsigned char > &I, unsigned int n, vpImagePoint *iP) |
vp_deprecated void | initTracking (const vpImage< unsigned char > &I, unsigned int n, unsigned *i, unsigned *j) |
void | computeAbeFromNij () |
double | computeAngleOnEllipse (const vpImagePoint &pt) const |
void | computeKiFromNij () |
void | computeNijFromAbe () |
void | computePointOnEllipse (const double angle, vpImagePoint &iP) |
double | computeTheta (const vpImagePoint &iP) const |
double | computeTheta (double u, double v) const |
void | getParameters () |
void | leastSquare (const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &iP) |
unsigned int | leastSquareRobust (const vpImage< unsigned char > &I) |
unsigned int | plugHoles (const vpImage< unsigned char > &I) |
virtual void | sample (const vpImage< unsigned char > &I, bool doNotTrack=false) override |
void | updateTheta () |
static void | displayEllipse (const vpImage< unsigned char > &I, const vpImagePoint ¢er, const double &A, const double &B, const double &E, const double &smallalpha, const double &highalpha, const vpColor &color=vpColor::green, unsigned int thickness=1) |
static void | displayEllipse (const vpImage< vpRGBa > &I, const vpImagePoint ¢er, const double &A, const double &B, const double &E, const double &smallalpha, const double &highalpha, const vpColor &color=vpColor::green, unsigned int thickness=1) |
static vp_deprecated void | display (const vpImage< unsigned char > &I, const vpImagePoint ¢er, const double &A, const double &B, const double &E, const double &smallalpha, const double &highalpha, const vpColor &color=vpColor::green, unsigned int thickness=1) |
static vp_deprecated void | display (const vpImage< vpRGBa > &I, const vpImagePoint ¢er, const double &A, const double &B, const double &E, const double &smallalpha, const double &highalpha, const vpColor &color=vpColor::green, unsigned int thickness=1) |
Public Member Functions Inherited from vpMeTracker | |
void | display (const vpImage< unsigned char > &I) |
void | display (const vpImage< vpRGBa > &I) |
void | display (const vpImage< unsigned char > &I, vpColVector &w, unsigned int &index_w) |
unsigned int | getInitRange () |
vpMe * | getMe () |
std::list< vpMeSite > & | getMeList () |
std::list< vpMeSite > | getMeList () const |
int | getNbPoints () const |
void | init () |
void | initTracking (const vpImage< unsigned char > &I) |
unsigned int | numberOfSignal () |
int | outOfImage (int i, int j, int half, int row, int cols) |
int | outOfImage (const vpImagePoint &iP, int half, int rows, int cols) |
void | reset () |
void | setDisplay (vpMeSite::vpMeSiteDisplayType select) |
void | setInitRange (const unsigned int &r) |
virtual void | setMask (const vpImage< bool > &mask) |
void | setMe (vpMe *p_me) |
void | setMeList (const std::list< vpMeSite > &l) |
unsigned int | totalNumberOfSignal () |
static bool | inMask (const vpImage< bool > *mask, unsigned int i, unsigned int j) |
Class that tracks an ellipse using moving edges.
In this class, an ellipse is defined as the set of image points (for more information about the image frame see the vpImagePoint documentation) that satisfy the homogeneous equation:
with ,
,
, etc. (see Eq. (25) of Chaumette TRO 2004 paper [6])
If and
, the ellipse is a circle.
The six parameters are stored in the private attribute K.
An ellipse is also represented thanks to five parameters that are the center of the ellipse and either:
For more details, see [6]. The following figure illustrates these parameters.
The example below available in tutorial-me-ellipse-tracker.cpp and described in Tutorial: Moving-edges tracking, section Ellipse tracking shows how to use this class.
Definition at line 89 of file vpMeEllipse.h.
vpMeEllipse::vpMeEllipse | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 44 of file vpMeEllipse.cpp.
References iP1, iP2, K, vpColVector::resize(), and vpImagePoint::set_ij().
vpMeEllipse::vpMeEllipse | ( | const vpMeEllipse & | me_ellipse | ) |
Copy constructor.
Definition at line 59 of file vpMeEllipse.cpp.
|
virtual |
|
protected |
Computes the length of the semi major axis , the length of the semi minor axis
, and
that is the angle made by the major axis and the u axis of the image frame
. They are computed from the normalized moments $
.
Definition at line 187 of file vpMeEllipse.cpp.
References a, b, ce, e, m_n02, m_n11, m_n20, and se.
Referenced by getParameters(), and initTracking().
|
protected |
Compute the angle of a point on the ellipse wrt the ellipse major axis.
pt | : Image point on the ellipse. |
Definition at line 147 of file vpMeEllipse.cpp.
References a, angle, b, ce, vpImagePoint::get_u(), vpImagePoint::get_v(), m_uc, m_vc, and se.
Referenced by initTracking(), leastSquareRobust(), plugHoles(), and track().
|
protected |
Computes the parameters from the center of the ellipse and the normalized moments
. The parameters
are such that
, etc. as in Eq (25) of Chaumette 2004 TRO paper.
Definition at line 209 of file vpMeEllipse.cpp.
References K, m_n02, m_n11, m_n20, m_uc, and m_vc.
Referenced by initTracking().
|
protected |
Computes the normalized moments from the
parameters as in Eq (24) of Chaumette 2004 TRO paper after simplifications to deal with the case cos(e) = 0.0
Definition at line 219 of file vpMeEllipse.cpp.
References a, b, ce, m_n02, m_n11, m_n20, and se.
Referenced by initTracking().
|
protected |
Compute the coordinates of a point on an ellipse from its angle with respect to the main orientation of the ellipse.
angle | : Angle on the ellipse with respect to its major axis. |
iP | : Image point on the ellipse. |
Definition at line 114 of file vpMeEllipse.cpp.
References a, angle, b, ce, m_uc, m_vc, se, and vpImagePoint::set_uv().
Referenced by initTracking(), leastSquareRobust(), plugHoles(), sample(), and track().
|
protected |
Computes the angle that represents the angle between the tangent to the curve and the u axis. This angle is used for tracking the vpMeSite.
iP | : The point belonging to the ellipse where the angle is computed. |
Definition at line 81 of file vpMeEllipse.cpp.
References vpImagePoint::get_u(), and vpImagePoint::get_v().
Referenced by plugHoles(), sample(), and updateTheta().
|
protected |
Computes the angle that represents the angle between the tangent to the curve and the u axis. This angle is used for tracking the vpMeSite.
u,v | : The point belonging to the ellipse where the angle is computed. |
Definition at line 89 of file vpMeEllipse.cpp.
References K.
|
inherited |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Definition at line 229 of file vpMeTracker.cpp.
References vpMeSite::display(), and vpMeTracker::list.
Referenced by vpMeTracker::display(), initTracking(), track(), and vpMeLine::track().
void vpMeEllipse::display | ( | const vpImage< unsigned char > & | I, |
const vpColor & | col, | ||
unsigned int | thickness = 1 |
||
) |
Display the ellipse or arc of ellipse
I | : Image in which the ellipse appears. |
col | : Color of the displayed ellipse. |
thickness | : Thickness of the drawing. |
Definition at line 1000 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, displayEllipse(), e, and iPc.
Referenced by track().
|
static |
Display the ellipse or the arc of ellipse thanks to the ellipse parameters.
I | : The image used as background. |
center | : Center of the ellipse. |
A | : Semi major axis of the ellipse. |
B | : Semi minor axis of the ellipse. |
E | : Angle made by the major axis and the u axis of the image frame ![]() |
smallalpha | : Smallest ![]() |
highalpha | : Highest ![]() ![]() |
color | : Color used to display the ellipse. |
thickness | : Thickness of the drawings. |
Definition at line 1328 of file vpMeEllipse.cpp.
References displayEllipse().
|
inherited |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 245 of file vpMeTracker.cpp.
References vpMeTracker::display(), vpMeSite::getState(), vpMeTracker::list, vpMeSite::NO_SUPPRESSION, and vpMeSite::weight.
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Definition at line 237 of file vpMeTracker.cpp.
References vpMeSite::display(), and vpMeTracker::list.
|
static |
Display the ellipse or the arc of ellipse thanks to the ellipse parameters.
I | : The image used as background. |
center | : Center of the ellipse |
A | : Semi major axis of the ellipse. |
B | : Semi minor axis of the ellipse. |
E | : Angle made by the major axis and the u axis of the image frame ![]() |
smallalpha | : Smallest ![]() |
highalpha | : Highest ![]() ![]() |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 1362 of file vpMeEllipse.cpp.
References displayEllipse().
|
static |
Display the ellipse or the arc of ellipse thanks to the ellipse parameters.
I | : The image used as background. |
center | : Center of the ellipse. |
A | : Semi major axis of the ellipse. |
B | : Semi minor axis of the ellipse. |
E | : Angle made by the major axis and the u axis of the image frame ![]() |
smallalpha | : Smallest ![]() |
highalpha | : Highest ![]() ![]() |
color | : Color used to display the ellipse. |
thickness | : Thickness of the drawings. |
Definition at line 1371 of file vpMeEllipse.cpp.
References vpDisplay::displayEllipse().
Referenced by display().
|
static |
Display the ellipse or the arc of ellipse thanks to the ellipse parameters.
I | : The image used as background. |
center | : Center of the ellipse |
A | : Semimajor axis of the ellipse. |
B | : Semiminor axis of the ellipse. |
E | : Angle made by the major axis and the u axis of the image frame ![]() |
smallalpha | : Smallest ![]() |
highalpha | : Highest ![]() ![]() |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 1378 of file vpMeEllipse.cpp.
References vpDisplay::displayEllipse().
|
inline |
Gets the ellipse parameters as a 3-dim vector containing .
Definition at line 144 of file vpMeEllipse.h.
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 94 of file vpTracker.h.
|
inline |
Gets the zero order moment which represents the area of the ellipse.
Definition at line 348 of file vpMeEllipse.h.
|
inline |
Definition at line 364 of file vpMeEllipse.h.
|
inline |
Definition at line 388 of file vpMeEllipse.h.
|
inline |
Definition at line 356 of file vpMeEllipse.h.
|
inline |
Definition at line 372 of file vpMeEllipse.h.
|
inline |
Definition at line 380 of file vpMeEllipse.h.
|
inline |
Definition at line 402 of file vpMeEllipse.h.
|
inline |
Definition at line 395 of file vpMeEllipse.h.
|
inline |
Definition at line 409 of file vpMeEllipse.h.
|
inline |
Gets the second order normalized centered moment as a 3-dim vector containing
such as
Definition at line 125 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 92 of file vpTracker.h.
|
inline |
Definition at line 319 of file vpMeEllipse.h.
|
inline |
Gets the area of the ellipse corresponding also to the zero order moment of the ellipse.
Definition at line 162 of file vpMeEllipse.h.
|
inline |
Definition at line 327 of file vpMeEllipse.h.
|
inline |
Gets the center of the ellipse.
Definition at line 169 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Definition at line 336 of file vpMeEllipse.h.
|
inline |
Definition at line 414 of file vpMeEllipse.h.
|
inline |
Definition at line 174 of file vpMeEllipse.h.
|
inline |
Gets the first endpoint of the ellipse arc (corresponding to alpha1, not alphamin) when an arc is tracked.
Definition at line 187 of file vpMeEllipse.h.
|
inline |
Gets the highest angle of the moving edges tracked
.
Definition at line 195 of file vpMeEllipse.h.
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters.
Definition at line 168 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 175 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 182 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 189 of file vpMeTracker.h.
|
inline |
Definition at line 179 of file vpMeEllipse.h.
|
protected |
Computes the coordinates of the ellipse center, the normalized moments , the length of the semi major axis
, the length of the semi minor axis
, and
that is the angle made by the major axis and the u axis of the image frame
.
All those computations are made from the parameters so that
.
Definition at line 226 of file vpMeEllipse.cpp.
References computeAbeFromNij(), vpException::fatalError, iPc, K, m_n02, m_n11, m_n20, m_uc, m_vc, printParameters(), vpImagePoint::set_uv(), and vpDEBUG_ENABLE.
Referenced by leastSquare(), and leastSquareRobust().
|
inline |
Gets the second endpoint of the ellipse arc (corresponding to alpha2, not alphamax) when an arc is tracked.
Definition at line 203 of file vpMeEllipse.h.
|
inline |
Gets the smallest angle of the moving edges tracked
.
Definition at line 211 of file vpMeEllipse.h.
|
inherited |
Initialize the tracker.
Definition at line 50 of file vpMeTracker.cpp.
References vpTracker::init(), vpMeSite::NONE, vpTracker::p, vpColVector::resize(), and vpMeTracker::selectDisplay.
Referenced by vpMeTracker::vpMeTracker().
|
inherited |
Virtual function that is called by lower classes vpMeEllipse, vpMeLine and vpMeNurbs.
vpTrackingException::initializationError | : Moving edges not initialized. |
Definition at line 145 of file vpMeTracker.cpp.
References vpMe::getRange(), vpMeSite::getState(), vpMeTracker::init_range, vpTrackingException::initializationError, vpMeTracker::list, vpMeTracker::me, vpMeTracker::nGoodElement, vpMeSite::NO_SUPPRESSION, vpMe::setRange(), vpMeSite::track(), vpDERROR_TRACE, and vpERROR_TRACE.
Referenced by vpMeNurbs::initTracking(), vpMeLine::initTracking(), vpMeLine::reSample(), vpMeNurbs::reSample(), and sample().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
bool | trackCircle = false , |
||
bool | trackArc = false |
||
) |
Initialize the tracking of an ellipse or an arc of an ellipse when trackArc is set to true. Ask the user to click on five points located on the ellipse to be tracked.
I | : Image in which the ellipse appears. |
trackCircle | : When true, track a circle, when false track an ellipse. |
trackArc | : When true track an arc of the ellipse/circle. In that case, first and last points specify the extremities of the arc (clockwise). When false track the complete ellipse/circle. |
Definition at line 1005 of file vpMeEllipse.cpp.
References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), m_trackArc, m_trackCircle, and vpColor::red.
Referenced by initTracking().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const std::vector< vpImagePoint > & | iP, | ||
bool | trackCircle = false , |
||
bool | trackArc = false |
||
) |
Initialize the tracking of an ellipse/circle or an arc of an ellipse/circle when trackArc is set to true. The ellipse/circle is defined thanks to a vector of image points.
I | : Image in which the ellipse/circle appears. |
iP | : A vector of image points belonging to the ellipse/circle edge used to initialize the tracking. |
trackCircle | : When true, track a circle, when false track an ellipse. |
trackArc | : When true track an arc of the ellipse/circle. In that case, first and last points specify the extremities of the arc (clockwise). When false track the complete ellipse/circle. |
Definition at line 1043 of file vpMeEllipse.cpp.
References alpha1, alpha2, computeAngleOnEllipse(), computePointOnEllipse(), vpMeTracker::display(), vpDisplay::flush(), iP1, iP2, leastSquare(), m_arcEpsilon, m_trackArc, m_trackCircle, sample(), and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const vpColVector & | param, | ||
vpImagePoint * | pt1 = NULL , |
||
const vpImagePoint * | pt2 = NULL , |
||
bool | trackCircle = false |
||
) |
Initialize the tracking of an ellipse/circle or an arc of an ellipse/circle when arc extremities are given. The ellipse/circle is defined by the vector containing the coordinates of its center and the three second order centered normalized moments . Without setting the arc extremities with parameters pt1 and pt2, the complete ellipse/circle is considered. When extremities are set, we consider an ellipse/circle arc defined clockwise from first extremity to second extremity.
I | : Image in which the ellipse appears. |
param | : Vector with the five parameters ![]() |
pt1 | : Image point defining the first extremity of the arc or NULL to track a complete ellipse. |
pt2 | : Image point defining the second extremity of the arc or NULL to track a complete ellipse. |
trackCircle | : When true enable tracking of a circle, when false the tracking of an ellipse. |
Definition at line 1076 of file vpMeEllipse.cpp.
References alpha1, alpha2, computeAbeFromNij(), computeAngleOnEllipse(), computeKiFromNij(), computePointOnEllipse(), vpMeTracker::display(), vpDisplay::flush(), iP1, iP2, iPc, m_arcEpsilon, m_n02, m_n11, m_n20, m_trackArc, m_trackCircle, m_uc, m_vc, sample(), vpImagePoint::set_uv(), and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const vpImagePoint & | center_p, | ||
double | a_p, | ||
double | b_p, | ||
double | e_p, | ||
double | alpha1_p, | ||
double | alpha2_p | ||
) |
I | : Image in which the ellipse appears. |
center_p | : Ellipse center. |
a_p | : Semi major axis. |
b_p | : Semi minor axis. |
e_p | : Orientation in rad. |
alpha1_p | : Angle in rad defining the first extremity of the arc. |
alpha2_p | : Angle in rad defining the second extremity of the arc. |
Definition at line 1233 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, ce, computeKiFromNij(), computeNijFromAbe(), computePointOnEllipse(), vpMeTracker::display(), e, vpDisplay::flush(), vpImagePoint::get_u(), vpImagePoint::get_v(), iP1, iP2, iPc, m_trackArc, m_uc, m_vc, sample(), se, and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
unsigned int | n, | ||
unsigned * | i, | ||
unsigned * | j | ||
) |
Definition at line 1294 of file vpMeEllipse.cpp.
References initTracking().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
unsigned int | n, | ||
vpImagePoint * | iP | ||
) |
I | : Image in which the ellipse appears. |
n | : The number of points in the list. |
iP | : A pointer to a list of points belonging to the ellipse edge. |
Definition at line 1281 of file vpMeEllipse.cpp.
References initTracking().
|
staticinherited |
Test whether the pixel is inside the mask. Mask values that are set to true are considered in the tracking.
mask | Mask image or NULL if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false. |
i | : Pixel coordinate along the rows. |
j | : Pixel coordinate along the columns. |
Definition at line 123 of file vpMeTracker.cpp.
References vpImage< Type >::getValue().
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtDistanceKltPoints::computeNbDetectedCurrent(), vpMbtDistanceKltPoints::init(), and vpMeTracker::track().
|
protected |
Least squares method to compute the circle/ ellipse to which the points belong.
I | : Image in which the circle/ellipse appears (useful just to get its number of rows and columns... |
iP | : A vector of points belonging to the circle/ellipse. |
Definition at line 541 of file vpMeEllipse.cpp.
References b, vpException::dimensionError, vpImage< Type >::getHeight(), getParameters(), vpImage< Type >::getWidth(), K, m_trackCircle, vpMatrix::nullSpace(), vpMatrixException::rankDeficient, and vpMatrix::solveBySVD().
Referenced by initTracking().
|
protected |
Robust least squares method to compute the ellipse to which the vpMeSite belong. Manage also the lists of vpMeSite and corresponding angles, and update the expected density of points.
I | : Image where tracking is done (useful just to get its number of rows and columns... |
Definition at line 623 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, angle, b, vpColor::blue, computeAngleOnEllipse(), computePointOnEllipse(), vpColor::cyan, vpMath::deg(), vpException::dimensionError, vpDisplay::displayCross(), vpImagePoint::distance(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), getParameters(), vpMe::getSampleStep(), vpMeSite::getState(), vpImage< Type >::getWidth(), vpColor::green, vpMeSite::ifloat, vpMeSite::jfloat, K, vpMeTracker::list, m_alphamax, m_alphamin, m_expectedDensity, m_trackArc, m_trackCircle, m_uc, m_vc, vpMeTracker::me, vpRobust::MEstimator(), vpMeSite::NO_SUPPRESSION, vpMatrix::nullSpace(), vpMeTracker::numberOfSignal(), vpColor::orange, vpMatrixException::rankDeficient, vpColor::red, vpImagePoint::set_ij(), vpImagePoint::set_uv(), vpRobust::setMinMedianAbsoluteDeviation(), vpMatrix::solveBySVD(), thresholdWeight, vpRobust::TUKEY, and vpDEBUG_ENABLE.
Referenced by track().
|
inherited |
Return number of moving-edges that are tracked.
Definition at line 112 of file vpMeTracker.cpp.
References vpMeTracker::list.
Referenced by vpMeLine::leastSquare(), leastSquareRobust(), vpMeNurbs::localReSample(), vpMeLine::reSample(), and vpMeNurbs::reSample().
|
inherited |
Check if a pixel i,j is out of the image.
Definition at line 138 of file vpMeTracker.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().
|
inherited |
Check if a pixel i,j is out of the image.
Definition at line 133 of file vpMeTracker.cpp.
Referenced by vpMeNurbs::localReSample(), plugHoles(), vpMeNurbs::sample(), sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and vpMeNurbs::seekExtremities().
|
protected |
Seek along the ellipse or arc of ellipse its two extremities to try recovering lost points. Try also to complete the parts with no tracked points.
I | : Image in which the ellipse appears. |
vpTrackingException::initializationError | : Moving edges not initialized. |
Definition at line 324 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, angle, b, vpColor::blue, computeAngleOnEllipse(), computePointOnEllipse(), computeTheta(), vpMath::deg(), vpDisplay::displayCross(), vpException::fatalError, vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpMe::getRange(), vpMe::getSampleStep(), vpMeSite::getState(), vpImage< Type >::getWidth(), vpMeSite::ifloat, vpMeSite::init(), vpMeSite::jfloat, vpMeTracker::list, m_alphamax, m_alphamin, vpMeTracker::me, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), vpMath::round(), vpMeTracker::selectDisplay, vpImagePoint::set_ij(), vpMeSite::setDisplay(), vpMe::setRange(), vpMeSite::setState(), vpMeSite::track(), and vpDEBUG_ENABLE.
Referenced by track().
void vpMeEllipse::printParameters | ( | ) | const |
Print the parameters , the coordinates of the ellipse center, the normalized moments, and the A, B, E parameters.
Definition at line 255 of file vpMeEllipse.cpp.
References a, b, vpMath::deg(), e, K, m_n02, m_n11, m_n20, m_uc, m_vc, and vpColVector::t().
Referenced by getParameters(), and track().
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 88 of file vpMeTracker.cpp.
References vpMeTracker::list, and vpMeTracker::nGoodElement.
Referenced by vpMeTracker::~vpMeTracker().
|
overrideprotectedvirtual |
Construct a list of vpMeSite moving edges at a particular sampling step between the two extremities. The two extremities are defined by the points with the smallest and the biggest angle.
I | : Image in which the ellipse appears. |
doNotTrack | : If true, moving-edges are not tracked. |
vpTrackingException::initializationError | : Moving edges not initialized. |
Implements vpMeTracker.
Definition at line 263 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, angle, b, computePointOnEllipse(), computeTheta(), vpDisplay::displayCross(), vpException::fatalError, vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpMe::getSampleStep(), vpImage< Type >::getWidth(), vpMeSite::init(), vpMeTracker::initTracking(), vpMeTracker::list, m_expectedDensity, m_trackArc, vpMeTracker::me, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), vpColor::red, vpMath::round(), vpMeTracker::selectDisplay, vpMeSite::setDisplay(), vpMe::setSampleStep(), and vpMeSite::setState().
Referenced by initTracking(), and track().
|
inlineinherited |
Set type of moving-edges display.
select | : Display type selector. |
Definition at line 238 of file vpMeTracker.h.
|
inline |
Set the two endpoints of the ellipse arc when an arc is tracked.
Definition at line 274 of file vpMeEllipse.h.
|
inlineinherited |
|
inlinevirtualinherited |
|
inlineinherited |
Set the moving edges initialisation parameters.
p_me | : Moving Edges. |
Definition at line 259 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges.
l | : list of Moving Edges. |
Definition at line 266 of file vpMeTracker.h.
|
inline |
Set the threshold for the weights in the robust estimation of the ellipse parameters. If the weight of a point is below this threshold, this one is removed from the list of tracked meSite. Value must be between 0 (never rejected) and 1 (always rejected).
threshold | : The new value of the threshold. |
Definition at line 289 of file vpMeEllipse.h.
|
inherited |
Return the total number of moving-edges.
Definition at line 121 of file vpMeTracker.cpp.
References vpMeTracker::list.
void vpMeEllipse::track | ( | const vpImage< unsigned char > & | I | ) |
Track a set of MEs along an ellipse or a circle. The number of valid tracked MEs is obtained from getNumberOfGoodPoints().
Track the ellipse in the image I.
I | : Image in which the ellipse appears. |
Definition at line 1124 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, computeAngleOnEllipse(), computePointOnEllipse(), vpMath::deg(), vpDisplay::display(), vpMeTracker::display(), display(), vpDisplay::flush(), vpDisplay::getClick(), iP1, iP2, leastSquareRobust(), m00, m_alphamax, m_alphamin, m_arcEpsilon, m_expectedDensity, m_numberOfGoodPoints, m_trackArc, vpTrackingException::notEnoughPointError, plugHoles(), printParameters(), vpColor::red, sample(), vpMeTracker::track(), updateTheta(), and vpDEBUG_ENABLE.
Referenced by initTracking().
|
protected |
Compute the angle for each vpMeSite.
Definition at line 101 of file vpMeEllipse.cpp.
References vpMeSite::alpha, computeTheta(), vpMeSite::ifloat, vpMeSite::jfloat, vpMeTracker::list, and vpImagePoint::set_ij().
Referenced by track().
double vpMeEllipse::a |
is the semi major axis of the ellipse.
Definition at line 439 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), computePointOnEllipse(), display(), initTracking(), leastSquareRobust(), plugHoles(), printParameters(), sample(), and track().
|
protected |
The angle on the ellipse corresponding to the first endpoint. Its value is 0 for tracking a complete ellipse
Definition at line 459 of file vpMeEllipse.h.
Referenced by display(), initTracking(), leastSquareRobust(), plugHoles(), sample(), and track().
|
protected |
The angle on the ellipse corresponding to the second endpoint. Its value is
for tracking a complete ellipse
Definition at line 464 of file vpMeEllipse.h.
Referenced by display(), initTracking(), leastSquareRobust(), plugHoles(), sample(), and track().
|
protected |
Stores the value in increasing order of the angle on the ellipse for each vpMeSite.
Definition at line 470 of file vpMeEllipse.h.
Referenced by computeAngleOnEllipse(), computePointOnEllipse(), leastSquareRobust(), plugHoles(), sample(), and ~vpMeEllipse().
double vpMeEllipse::b |
is the semi minor axis of the ellipse.
Definition at line 441 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), computePointOnEllipse(), display(), initTracking(), leastSquare(), leastSquareRobust(), plugHoles(), printParameters(), sample(), and track().
|
protected |
Value of cos(e).
Definition at line 466 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), computePointOnEllipse(), and initTracking().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 72 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), and vpPoint::set_Z().
|
inherited |
Flag used to indicate if the feature parameters cP expressed in the camera frame are available.
Definition at line 78 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Definition at line 288 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
double vpMeEllipse::e |
is the angle made by the major axis and the u axis of the image frame
.
Definition at line 445 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), display(), initTracking(), and printParameters().
|
inherited |
Initial range.
Definition at line 76 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
protected |
The coordinates of the first endpoint of the ellipse arc corresponding to angle
Definition at line 451 of file vpMeEllipse.h.
Referenced by initTracking(), track(), and vpMeEllipse().
|
protected |
The coordinates of the second endpoint of the ellipse arc corresponding to angle
Definition at line 455 of file vpMeEllipse.h.
Referenced by initTracking(), track(), and vpMeEllipse().
vpImagePoint vpMeEllipse::iPc |
The coordinates of the ellipse center.
Definition at line 437 of file vpMeEllipse.h.
Referenced by display(), getParameters(), and initTracking().
vpColVector vpMeEllipse::K |
Parameters of the ellipse satisfying the homogeneous equation :
Definition at line 435 of file vpMeEllipse.h.
Referenced by computeKiFromNij(), computeTheta(), getParameters(), leastSquare(), leastSquareRobust(), printParameters(), and vpMeEllipse().
|
inherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 72 of file vpMeTracker.h.
Referenced by vpMeTracker::display(), vpMeLine::display(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), leastSquareRobust(), vpMeNurbs::localReSample(), vpMeTracker::numberOfSignal(), vpMeTracker::operator=(), plugHoles(), vpMeTracker::reset(), vpMeNurbs::sample(), sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), vpMeNurbs::suppressPoints(), vpMeNurbs::supressNearPoints(), vpMeTracker::totalNumberOfSignal(), vpMeNurbs::track(), vpMeTracker::track(), vpMeLine::updateDelta(), vpMeNurbs::updateDelta(), updateTheta(), vpMeTracker::vpMeTracker(), ~vpMeEllipse(), and vpMeLine::~vpMeLine().
|
protected |
|
protected |
Definition at line 477 of file vpMeEllipse.h.
|
protected |
Definition at line 479 of file vpMeEllipse.h.
|
protected |
First order raw moments.
Definition at line 477 of file vpMeEllipse.h.
|
protected |
Second order raw moments.
Definition at line 479 of file vpMeEllipse.h.
|
protected |
Definition at line 479 of file vpMeEllipse.h.
|
protected |
The highest angle of the current moving edge list
Definition at line 492 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), plugHoles(), and track().
|
protected |
The smallest angle of the current moving edge list
Definition at line 488 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), plugHoles(), and track().
|
protected |
Epsilon value used to check if arc angles are the same.
Definition at line 512 of file vpMeEllipse.h.
Referenced by initTracking(), and track().
|
protected |
Expected number of points to track along the ellipse.
Definition at line 504 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), sample(), and track().
|
inherited |
Mask used to disable tracking on a part of image.
Definition at line 80 of file vpMeTracker.h.
Referenced by vpMeTracker::track().
|
protected |
Second order centered and normalized moments .
Definition at line 502 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeKiFromNij(), computeNijFromAbe(), getParameters(), initTracking(), and printParameters().
|
protected |
Second order centered and normalized moments .
Definition at line 500 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeKiFromNij(), computeNijFromAbe(), getParameters(), initTracking(), and printParameters().
|
protected |
Second order centered and normalized moments .
Definition at line 498 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeKiFromNij(), computeNijFromAbe(), getParameters(), initTracking(), and printParameters().
|
protected |
Number of correct points tracked along the ellipse.
Definition at line 506 of file vpMeEllipse.h.
Referenced by track().
|
protected |
Track an arc of ellipse/circle (true) or a complete one (false).
Definition at line 510 of file vpMeEllipse.h.
Referenced by initTracking(), leastSquareRobust(), sample(), and track().
|
protected |
Track a circle (true) or an ellipse (false).
Definition at line 508 of file vpMeEllipse.h.
Referenced by initTracking(), leastSquare(), and leastSquareRobust().
|
protected |
Value of u coordinate of iPc.
Definition at line 494 of file vpMeEllipse.h.
Referenced by computeAngleOnEllipse(), computeKiFromNij(), computePointOnEllipse(), getParameters(), initTracking(), leastSquareRobust(), and printParameters().
|
protected |
Value of v coordinate of iPc.
Definition at line 496 of file vpMeEllipse.h.
Referenced by computeAngleOnEllipse(), computeKiFromNij(), computePointOnEllipse(), getParameters(), initTracking(), leastSquareRobust(), and printParameters().
|
inherited |
Moving edges initialisation parameters.
Definition at line 74 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), leastSquareRobust(), vpMeNurbs::localReSample(), vpMeTracker::operator=(), plugHoles(), vpMeLine::reSample(), vpMeNurbs::reSample(), vpMeNurbs::sample(), sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeNurbs::supressNearPoints(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
protected |
Definition at line 475 of file vpMeEllipse.h.
|
protected |
Second order centered moments.
Definition at line 475 of file vpMeEllipse.h.
|
protected |
Definition at line 475 of file vpMeEllipse.h.
|
inherited |
Number of good moving-edges that are tracked.
Definition at line 78 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::operator=(), vpMeTracker::reset(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 68 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpCircle::display(), vpCylinder::display(), vpLine::display(), vpPoint::display(), vpSphere::display(), vpProjectionDisplay::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpMeTracker::init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().
|
inherited |
Definition at line 287 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
protected |
Value of sin(e).
Definition at line 468 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), computePointOnEllipse(), and initTracking().
|
protectedinherited |
Definition at line 86 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), vpMeNurbs::localReSample(), vpMeTracker::operator=(), plugHoles(), vpMeNurbs::sample(), sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), and vpMeTracker::vpMeTracker().
|
protected |
Threshold on the weights for the robust least square.
Definition at line 483 of file vpMeEllipse.h.
Referenced by leastSquareRobust().