Visual Servoing Platform
version 3.6.1 under development (2024-11-21)
|
#include <visp3/me/vpMeEllipse.h>
Public Member Functions | |
vpMeEllipse () | |
vpMeEllipse (const vpMeEllipse &me_ellipse) | |
virtual | ~vpMeEllipse () VP_OVERRIDE |
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, std::optional< std::vector< vpImagePoint >> &opt_ips, 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=nullptr, const vpImagePoint *pt2=nullptr, 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 |
Static Public Member Functions | |
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) |
Public Attributes | |
Public Attributes Inherited from vpTracker | |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Protected Member Functions | |
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) |
void | leastSquareRobustCircle (const double &um, const double &vm, unsigned int &k, vpColVector &w) |
void | leastSquareRobustEllipse (const double &um, const double &vm, unsigned int &k, vpColVector &w) |
unsigned int | plugHoles (const vpImage< unsigned char > &I) |
virtual void | sample (const vpImage< unsigned char > &I, bool doNotTrack=false) VP_OVERRIDE |
void | updateTheta () |
Protected Attributes | |
vpColVector | m_K |
vpImagePoint | m_iPc |
double | m_a |
double | m_b |
double | m_e |
vpImagePoint | m_iP1 |
vpImagePoint | m_iP2 |
double | m_alpha1 |
double | m_alpha2 |
double | m_ce |
double | m_se |
std::list< double > | m_angleList |
double | m_m00 |
double | m_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 |
Protected Attributes Inherited from vpMeTracker | |
std::list< vpMeSite > | m_meList |
vpMe * | m_me |
unsigned int | m_init_range |
int | m_nGoodElement |
const vpImage< bool > * | m_mask |
const vpImage< bool > * | m_maskCandidates |
vpMeSite::vpMeSiteDisplayType | m_selectDisplay |
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 () |
bool | outOfImage (int i, int j, int border, int nrows, int ncols) |
bool | outOfImage (const vpImagePoint &iP, int border, int nrows, int ncols) |
void | reset () |
void | setDisplay (vpMeSite::vpMeSiteDisplayType select) |
void | setInitRange (const unsigned int &r) |
virtual void | setMask (const vpImage< bool > &mask) |
virtual void | setMaskCandidates (const vpImage< bool > *maskCandidates) |
void | setMe (vpMe *me) |
void | setMeList (const std::list< vpMeSite > &meList) |
unsigned int | totalNumberOfSignal () |
static bool | inRoiMask (const vpImage< bool > *mask, unsigned int i, unsigned int j) |
static bool | inMeMaskCandidates (const vpImage< bool > *meMaskCandidates, 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 95 of file vpMeEllipse.h.
BEGIN_VISP_NAMESPACE vpMeEllipse::vpMeEllipse | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 47 of file vpMeEllipse.cpp.
References m_alpha2, m_iP1, m_iP2, m_K, vpColVector::resize(), and vpImagePoint::set_ij().
vpMeEllipse::vpMeEllipse | ( | const vpMeEllipse & | me_ellipse | ) |
Copy constructor.
Definition at line 62 of file vpMeEllipse.cpp.
|
virtual |
Destructor.
Definition at line 73 of file vpMeEllipse.cpp.
References m_angleList, and vpMeTracker::m_meList.
|
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 m_a, m_b, m_ce, m_e, m_n02, m_n11, m_n20, and m_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 145 of file vpMeEllipse.cpp.
References vpImagePoint::get_u(), vpImagePoint::get_v(), m_a, m_b, m_ce, m_e, m_se, m_uc, and m_vc.
Referenced by initTracking(), leastSquareRobust(), leastSquareRobustCircle(), leastSquareRobustEllipse(), 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 m_K, m_n02, m_n11, m_n20, m_uc, and m_vc.
Referenced by initTracking().
|
protected |
|
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 113 of file vpMeEllipse.cpp.
References m_a, m_b, m_ce, m_se, m_uc, m_vc, vpImagePoint::set_u(), vpImagePoint::set_uv(), and vpImagePoint::set_v().
Referenced by initTracking(), leastSquareRobustCircle(), leastSquareRobustEllipse(), 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 79 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 87 of file vpMeEllipse.cpp.
References m_K.
|
inherited |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Definition at line 254 of file vpMeTracker.cpp.
References vpMeSite::display(), and vpMeTracker::m_meList.
Referenced by vpMeTracker::display(), initTracking(), 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 563 of file vpMeEllipse.cpp.
References displayEllipse(), m_a, m_alpha1, m_alpha2, m_b, m_e, and m_iPc.
|
inherited |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 272 of file vpMeTracker.cpp.
References vpMeTracker::display(), vpMeSite::getState(), vpMeTracker::m_meList, vpMeSite::NO_SUPPRESSION, and vpMeSite::setWeight().
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Definition at line 263 of file vpMeTracker.cpp.
References vpMeSite::display(), and vpMeTracker::m_meList.
|
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 (in rad). |
smallalpha | : Smallest angle in rad (0 for a complete ellipse). |
highalpha | : Highest angle in rad (2 for a complete ellipse). |
color | : Color used to display the ellipse. |
thickness | : Thickness of the drawings. |
Definition at line 869 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 | : 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 (in rad) |
smallalpha | : Smallest angle in rad (0 for a complete ellipse) |
highalpha | : Highest angle in rad ( for a complete ellipse) |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 876 of file vpMeEllipse.cpp.
References vpDisplay::displayEllipse().
|
inline |
Gets the ellipse parameters as a 3-dim vector containing .
Definition at line 156 of file vpMeEllipse.h.
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 95 of file vpTracker.h.
|
inline |
Gets the second order normalized centered moment as a 3-dim vector containing such as
Definition at line 134 of file vpMeEllipse.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 93 of file vpTracker.h.
|
inline |
Gets the area of the ellipse corresponding also to the zero order moment of the ellipse.
Definition at line 177 of file vpMeEllipse.h.
|
inline |
Gets the center of the ellipse.
Definition at line 184 of file vpMeEllipse.h.
|
inline |
Definition at line 189 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 202 of file vpMeEllipse.h.
|
inline |
Gets the highest angle of the moving edges tracked .
Definition at line 210 of file vpMeEllipse.h.
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters.
Definition at line 153 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 160 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 167 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 174 of file vpMeTracker.h.
|
inline |
Definition at line 194 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 232 of file vpMeEllipse.cpp.
References computeAbeFromNij(), vpTrackingException::fatalError, m_iPc, m_K, m_n02, m_n11, m_n20, m_uc, m_vc, vpImagePoint::set_uv(), and vpArray2D< Type >::size().
Referenced by leastSquare(), leastSquareRobustCircle(), and leastSquareRobustEllipse().
|
inline |
Gets the second endpoint of the ellipse arc (corresponding to alpha2, not alphamax) when an arc is tracked.
Definition at line 218 of file vpMeEllipse.h.
|
inline |
Gets the smallest angle of the moving edges tracked .
Definition at line 226 of file vpMeEllipse.h.
|
inherited |
Initialize the tracker.
Definition at line 48 of file vpMeTracker.cpp.
References vpTracker::init(), vpMeTracker::m_selectDisplay, vpMeSite::NONE, vpTracker::p, and vpColVector::resize().
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 182 of file vpMeTracker.cpp.
References vpMe::getRange(), vpMeSite::getState(), vpTrackingException::initializationError, vpMeTracker::m_init_range, vpMeTracker::m_me, vpMeTracker::m_meList, vpMeTracker::m_nGoodElement, vpMeSite::NO_SUPPRESSION, vpMe::setRange(), and vpMeSite::track().
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 568 of file vpMeEllipse.cpp.
References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), m_trackArc, m_trackCircle, and vpColor::red.
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 671 of file vpMeEllipse.cpp.
References computeAngleOnEllipse(), computePointOnEllipse(), vpMeTracker::display(), vpDisplay::flush(), leastSquare(), m_alpha1, m_alpha2, m_arcEpsilon, m_iP1, m_iP2, m_trackArc, m_trackCircle, sample(), and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const vpColVector & | param, | ||
vpImagePoint * | pt1 = nullptr , |
||
const vpImagePoint * | pt2 = nullptr , |
||
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 defining the ellipse (expressed in pixels). |
pt1 | : Image point defining the first extremity of the arc or nullptr to track a complete ellipse. |
pt2 | : Image point defining the second extremity of the arc or nullptr to track a complete ellipse. |
trackCircle | : When true enable tracking of a circle, when false the tracking of an ellipse. |
Definition at line 704 of file vpMeEllipse.cpp.
References computeAbeFromNij(), computeAngleOnEllipse(), computeKiFromNij(), computePointOnEllipse(), vpMeTracker::display(), vpDisplay::flush(), m_alpha1, m_alpha2, m_arcEpsilon, m_iP1, m_iP2, m_iPc, 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, |
std::optional< std::vector< vpImagePoint >> & | opt_ips, | ||
bool | trackCircle = false , |
||
bool | trackArc = false |
||
) |
Initialize the tracking of an ellipse or an arc of an ellipse when trackArc is set to true. If ips is set, use the contained points to initialize the ME if there are some, or initialize by clicks the ME and ips will contained the clicked points. If ips is not set, call the method vpMeEllipse::initTracking(const vpImage<unsigned char>&, bool, bool).
I | : Image in which the ellipse appears. |
opt_ips | If set, either a vector that contains the vpImagePoint to use or will be filled with the clicked points. |
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 611 of file vpMeEllipse.cpp.
References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), and vpColor::red.
|
staticinherited |
Test whether the moving-edge (ME) is inside the mask of ME candidates for the initialization. Mask values that are set to true and their 8 neighbors are considered for the initialization.
meMaskCandidates | Mask corresponding the ME location in the image or nullptr if not wanted. Mask values that are set to true are considered for the initialization. To disable a pixel, set false. |
i | : ME coordinate along the rows. |
j | : ME coordinate along the columns. |
Definition at line 115 of file vpMeTracker.cpp.
References vpImage< Type >::getCols(), and vpImage< Type >::getRows().
Referenced by sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().
|
staticinherited |
Test whether the pixel is inside the region of interest mask. Mask values that are set to true are considered in the tracking.
mask | Mask corresponding to the region of interest in the image or nullptr 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 105 of file vpMeTracker.cpp.
References vpImage< Type >::getValue().
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), plugHoles(), sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), 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 39 of file vpMeEllipse_least_square.cpp.
References vpException::dimensionError, vpImage< Type >::getHeight(), getParameters(), vpArray2D< Type >::getRows(), vpImage< Type >::getWidth(), m_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 358 of file vpMeEllipse_least_square.cpp.
References computeAngleOnEllipse(), vpTrackingException::fatalError, vpImage< Type >::getHeight(), vpMe::getSampleStep(), vpMeSite::getState(), vpImage< Type >::getWidth(), leastSquareRobustCircle(), leastSquareRobustEllipse(), m_a, m_alpha1, m_alpha2, m_alphamax, m_alphamin, m_angleList, m_b, m_expectedDensity, vpMeSite::m_ifloat, vpMeSite::m_jfloat, vpMeTracker::m_me, vpMeTracker::m_meList, m_thresholdWeight, m_trackArc, m_trackCircle, vpMeSite::NO_SUPPRESSION, vpMeTracker::numberOfSignal(), and vpImagePoint::set_ij().
Referenced by track().
|
protected |
Robust least squares method to compute the ellipse to which the vpMeSite belong, when we track a circle. Manage also the lists of vpMeSite and corresponding angles, and update the expected density of points.
um | Half width of the image. |
vm | Half height of the image. |
k | Count the number of tracked MEs. |
w | Weights computed by robust estimation. |
Definition at line 132 of file vpMeEllipse_least_square.cpp.
References computeAngleOnEllipse(), computePointOnEllipse(), vpException::dimensionError, vpImagePoint::distance(), vpMeSite::get_ifloat(), vpMeSite::get_jfloat(), vpArray2D< Type >::getCols(), getParameters(), vpMeSite::getState(), m_K, vpMeTracker::m_meList, m_uc, m_vc, vpRobust::MEstimator(), vpMeSite::NO_SUPPRESSION, vpMeTracker::numberOfSignal(), vpImagePoint::set_uv(), vpRobust::setMinMedianAbsoluteDeviation(), vpMatrix::solveBySVD(), and vpRobust::TUKEY.
Referenced by leastSquareRobust().
|
protected |
Robust least squares method to compute the ellipse to which the vpMeSite belong, when we track an ellipse. Manage also the lists of vpMeSite and corresponding angles, and update the expected density of points.
um | Half width of the image. |
vm | Half height of the image. |
k | Count the number of tracked MEs. |
w | Weights computed by robust estimation. |
Definition at line 241 of file vpMeEllipse_least_square.cpp.
References computeAngleOnEllipse(), computePointOnEllipse(), vpException::dimensionError, vpImagePoint::distance(), vpMeSite::get_ifloat(), vpMeSite::get_jfloat(), vpArray2D< Type >::getCols(), getParameters(), vpMeSite::getState(), m_K, vpMeTracker::m_meList, m_uc, m_vc, vpRobust::MEstimator(), vpMeSite::NO_SUPPRESSION, vpMatrix::nullSpace(), vpMeTracker::numberOfSignal(), vpMatrixException::rankDeficient, vpImagePoint::set_uv(), vpRobust::setMinMedianAbsoluteDeviation(), and vpRobust::TUKEY.
Referenced by leastSquareRobust().
|
inherited |
Return number of moving-edges that are tracked.
Definition at line 94 of file vpMeTracker.cpp.
References vpMeTracker::m_meList.
Referenced by vpMeLine::leastSquare(), leastSquareRobust(), leastSquareRobustCircle(), leastSquareRobustEllipse(), vpMeNurbs::localReSample(), vpMeLine::reSample(), and vpMeNurbs::reSample().
|
inherited |
Check if a pixel i,j is out of the image.
[in] | iP | : Pixel coordinates. |
[in] | border | : Number of pixels along the image border to exclude. When border is set to 0, consider the complete image. |
[in] | nrows,ncols | : Size of the image. |
Definition at line 174 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.
[in] | i,j | : Pixel coordinates. |
[in] | border | : Number of pixels along the image border to exclude. When border is set to 0, consider the complete image. |
[in] | nrows,ncols | : Size of the image. |
Definition at line 166 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 343 of file vpMeEllipse.cpp.
References computeAngleOnEllipse(), computePointOnEllipse(), computeTheta(), vpMeSite::convolution(), vpTrackingException::fatalError, vpImagePoint::get_i(), vpMeSite::get_ifloat(), vpImagePoint::get_j(), vpMeSite::get_jfloat(), vpImage< Type >::getHeight(), vpMe::getRange(), vpMe::getSampleStep(), vpMeSite::getState(), vpMe::getThresholdMarginRatio(), vpImage< Type >::getWidth(), vpMeSite::init(), vpMeTracker::inRoiMask(), m_a, m_alpha1, m_alpha2, m_alphamax, m_alphamin, m_angleList, m_b, vpMeTracker::m_mask, vpMeTracker::m_me, vpMeTracker::m_meList, vpMeTracker::m_selectDisplay, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), vpImagePoint::set_ij(), vpMeSite::setContrastThreshold(), vpMeSite::setDisplay(), vpMe::setRange(), vpMeSite::setState(), and vpMeSite::track().
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 265 of file vpMeEllipse.cpp.
References vpMath::deg(), m_a, m_b, m_e, m_K, m_n02, m_n11, m_n20, m_uc, m_vc, and vpColVector::t().
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 74 of file vpMeTracker.cpp.
References vpMeTracker::m_meList, and vpMeTracker::m_nGoodElement.
Referenced by vpMeTracker::~vpMeTracker().
|
protectedvirtual |
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 273 of file vpMeEllipse.cpp.
References computePointOnEllipse(), computeTheta(), vpMeSite::convolution(), vpDisplay::displayCross(), vpTrackingException::fatalError, vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpMe::getSampleStep(), vpMe::getThresholdMarginRatio(), vpImage< Type >::getWidth(), vpMeSite::init(), vpMeTracker::initTracking(), vpMeTracker::inMeMaskCandidates(), vpMeTracker::inRoiMask(), m_a, m_alpha1, m_alpha2, m_angleList, m_b, m_expectedDensity, vpMeTracker::m_mask, vpMeTracker::m_maskCandidates, vpMeTracker::m_me, vpMeTracker::m_meList, vpMeTracker::m_selectDisplay, m_trackArc, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), vpColor::red, vpMeSite::setContrastThreshold(), 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 232 of file vpMeTracker.h.
|
inline |
Set the two endpoints of the ellipse arc when an arc is tracked.
Definition at line 314 of file vpMeEllipse.h.
|
inlineinherited |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Set the mask of candidates points for initialization.
maskCandidates | : Pointer towards the mask of candidates points for initialization. |
Definition at line 253 of file vpMeTracker.h.
|
inlineinherited |
Set the moving edges initialisation parameters.
me | : Moving Edges. |
Definition at line 260 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges.
meList | : List of Moving Edges. |
Definition at line 267 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 329 of file vpMeEllipse.h.
|
inherited |
Return the total number of moving-edges.
Definition at line 103 of file vpMeTracker.cpp.
References vpMeTracker::m_meList.
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 758 of file vpMeEllipse.cpp.
References computeAngleOnEllipse(), computePointOnEllipse(), leastSquareRobust(), m_a, m_alpha1, m_alpha2, m_arcEpsilon, m_b, m_iP1, m_iP2, m_m00, m_numberOfGoodPoints, m_trackArc, vpTrackingException::notEnoughPointError, plugHoles(), sample(), vpMeTracker::track(), and updateTheta().
Referenced by initTracking().
|
protected |
Compute the angle for each vpMeSite.
Definition at line 99 of file vpMeEllipse.cpp.
References computeTheta(), vpMeSite::m_alpha, vpMeSite::m_ifloat, vpMeSite::m_jfloat, vpMeTracker::m_meList, and vpImagePoint::set_ij().
Referenced by track().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 73 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 79 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
protected |
is the semi major axis of the ellipse.
Definition at line 413 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), computePointOnEllipse(), display(), 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 432 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 437 of file vpMeEllipse.h.
Referenced by display(), initTracking(), leastSquareRobust(), plugHoles(), sample(), track(), and vpMeEllipse().
|
protected |
The highest angle of the current moving edge list
Definition at line 457 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), and plugHoles().
|
protected |
The smallest angle of the current moving edge list
Definition at line 453 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), and plugHoles().
|
protected |
Stores the value in increasing order of the angle on the ellipse for each vpMeSite.
Definition at line 443 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), plugHoles(), sample(), and ~vpMeEllipse().
|
protected |
Epsilon value used to check if arc angles are the same.
Definition at line 477 of file vpMeEllipse.h.
Referenced by initTracking(), and track().
|
protected |
is the semi minor axis of the ellipse.
Definition at line 415 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), computePointOnEllipse(), display(), leastSquareRobust(), plugHoles(), printParameters(), sample(), and track().
|
protected |
Value of cos(e).
Definition at line 439 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), and computePointOnEllipse().
|
protected |
is the angle made by the major axis and the u axis of the image frame .
Definition at line 419 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), display(), and printParameters().
|
protected |
Expected number of points to track along the ellipse.
Definition at line 469 of file vpMeEllipse.h.
Referenced by leastSquareRobust(), and sample().
|
protectedinherited |
Initial range.
Definition at line 315 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 424 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 428 of file vpMeEllipse.h.
Referenced by initTracking(), track(), and vpMeEllipse().
|
protected |
The coordinates of the ellipse center.
Definition at line 411 of file vpMeEllipse.h.
Referenced by display(), getParameters(), and initTracking().
|
protected |
Parameters of the ellipse satisfying the homogeneous equation :
Definition at line 409 of file vpMeEllipse.h.
Referenced by computeKiFromNij(), computeTheta(), getParameters(), leastSquare(), leastSquareRobustCircle(), leastSquareRobustEllipse(), printParameters(), and vpMeEllipse().
|
protected |
|
protectedinherited |
Mask used to disable tracking on a part of image.
Definition at line 319 of file vpMeTracker.h.
Referenced by plugHoles(), sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and vpMeTracker::track().
|
protectedinherited |
Mask used to determine candidate points for initialization in an image.
Definition at line 321 of file vpMeTracker.h.
Referenced by sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().
|
protectedinherited |
Moving edges initialisation parameters.
Definition at line 313 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().
|
protectedinherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 311 of file vpMeTracker.h.
Referenced by vpMeTracker::display(), vpMeLine::display(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), leastSquareRobust(), leastSquareRobustCircle(), leastSquareRobustEllipse(), 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 |
Second order centered and normalized moments .
Definition at line 467 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeKiFromNij(), computeNijFromAbe(), getParameters(), initTracking(), and printParameters().
|
protected |
Second order centered and normalized moments .
Definition at line 465 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeKiFromNij(), computeNijFromAbe(), getParameters(), initTracking(), and printParameters().
|
protected |
Second order centered and normalized moments .
Definition at line 463 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeKiFromNij(), computeNijFromAbe(), getParameters(), initTracking(), and printParameters().
|
protectedinherited |
Number of good moving-edges that are tracked.
Definition at line 317 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::operator=(), vpMeTracker::reset(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
protected |
Number of correct points tracked along the ellipse.
Definition at line 471 of file vpMeEllipse.h.
Referenced by track().
|
protected |
Value of sin(e).
Definition at line 441 of file vpMeEllipse.h.
Referenced by computeAbeFromNij(), computeAngleOnEllipse(), computeNijFromAbe(), and computePointOnEllipse().
|
protectedinherited |
Moving-edges display type.
Definition at line 323 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 448 of file vpMeEllipse.h.
Referenced by leastSquareRobust().
|
protected |
Track an arc of ellipse/circle (true) or a complete one (false).
Definition at line 475 of file vpMeEllipse.h.
Referenced by initTracking(), leastSquareRobust(), sample(), and track().
|
protected |
Track a circle (true) or an ellipse (false).
Definition at line 473 of file vpMeEllipse.h.
Referenced by initTracking(), leastSquare(), and leastSquareRobust().
|
protected |
Value of u coordinate of iPc.
Definition at line 459 of file vpMeEllipse.h.
Referenced by computeAngleOnEllipse(), computeKiFromNij(), computePointOnEllipse(), getParameters(), initTracking(), leastSquareRobustCircle(), leastSquareRobustEllipse(), and printParameters().
|
protected |
Value of v coordinate of iPc.
Definition at line 461 of file vpMeEllipse.h.
Referenced by computeAngleOnEllipse(), computeKiFromNij(), computePointOnEllipse(), getParameters(), initTracking(), leastSquareRobustCircle(), leastSquareRobustEllipse(), and printParameters().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 69 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(), vpMeTracker::init(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::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().