![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpMeLine.h>
Public Member Functions | |
| vpMeLine () | |
| vpMeLine (const vpMeLine &meline) | |
| virtual | ~vpMeLine () VP_OVERRIDE |
| vpMeLine & | operator= (const vpMeLine &meline) |
| void | display (const vpImage< unsigned char > &I, const vpColor &color, unsigned int thickness=1) |
| void | display (const vpImage< vpRGBa > &I, const vpColor &color, unsigned int thickness=1) |
| vpColVector | get_ABC () const |
| void | getExtremities (vpImagePoint &ip1, vpImagePoint &ip2) const |
| double | getRho () const |
| vpColVector | getRhoTheta () const |
| double | getTheta () const |
| void | initTracking (const vpImage< unsigned char > &I) |
| void | initTracking (const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2) |
| 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 | displayLine (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static void | displayLine (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static void | displayLine (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static void | displayLine (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static bool | intersection (const vpMeLine &line1, const vpMeLine &line2, vpImagePoint &iP) |
| static void | project (double a, double b, double c, const vpMeSite &P, vpImagePoint &iP) |
Deprecated functions | |
| static VP_DEPRECATED bool | inMask (const vpImage< bool > *mask, unsigned int i, unsigned int j) |
Public Attributes | |
Public Attributes Inherited from vpTracker | |
| vpColVector | p |
| vpColVector | cP |
| bool | cPAvailable |
Protected Member Functions | |
| void | computeDelta (double &delta, double i1, double j1, double i2, double j2) |
| void | computeRhoTheta () |
| void | leastSquare (const vpImage< unsigned char > &I) |
| void | normalizeAngle (double &delta) |
| unsigned int | plugHoles (const vpImage< unsigned char > &I) |
| void | reSample (const vpImage< unsigned char > &I) |
| virtual void | sample (const vpImage< unsigned char > &I, bool doNotTrack=false) VP_OVERRIDE |
| virtual unsigned int | seekExtremities (const vpImage< unsigned char > &I) |
| void | setExtremities () |
| void | updateDelta () |
Protected Attributes | |
| vpMeSite | m_PExt [2] |
| double | m_rho |
| double | m_theta |
| double | m_delta |
| int | m_sign |
| double | m_a |
| double | m_b |
| double | m_c |
Protected Attributes Inherited from vpMeTracker | |
| std::list< vpMeSite > | m_meList |
| vpMe * | m_me |
| int | m_nGoodElement |
| const vpImage< bool > * | m_mask |
| const vpImage< bool > * | m_maskCandidates |
| vpMeSite::vpMeSiteDisplayType | m_selectDisplay |
Deprecated functions | |
| VP_DEPRECATED void | setRhoSignFromIntensity (bool unused) |
| VP_DEPRECATED void | computeRhoSignFromIntensity (bool unused) |
| VP_DEPRECATED double | getA () const |
| VP_DEPRECATED double | getB () const |
| VP_DEPRECATED double | getC () const |
| VP_DEPRECATED void | getEquationParam (double &A, double &B, double &C) const |
| static VP_DEPRECATED void | display (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static VP_DEPRECATED void | display (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static VP_DEPRECATED void | display (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| static VP_DEPRECATED void | display (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, 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) |
| vpMe * | getMe () |
| std::list< vpMeSite > & | getMeList () |
| std::list< vpMeSite > | getMeList () const |
| int | getNbPoints () const |
| void | init () |
| 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) |
| 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 in an image a line moving edges.
In this class the line is defined by its equation in the
image plane. Two kinds of parametrization are available to describe a 2D line. The first one corresponds to the following equation
where
and
are the coordinates of the points belonging to the line. The line features are
.
The second way to write the line equation is to consider polar coordinates
where
and
are still the coordinates of the points belonging to the line. But now the line features are
. The computation of
and
is easy thanks to
.
The value of
is between
and
. And the value of
can be positive or negative. The conventions to find the right values of the two features are illustrated in the following pictures.
The angle
is computed thanks to the direction of the arrow. The arrow points to the side of the line which is darker.
Tutorials
The example below available in tutorial-me-line-tracker.cpp and described in Tutorial: Moving-edges tracking shows how to use this class.
The code below shows how to use this class.
Definition at line 156 of file vpMeLine.h.
| vpMeLine::vpMeLine | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 81 of file vpMeLine.cpp.
References m_a, m_b, m_c, m_delta, m_rho, m_sign, and m_theta.
Referenced by intersection(), operator=(), and vpMeLine().
| vpMeLine::vpMeLine | ( | const vpMeLine & | meline | ) |
Copy constructor.
Definition at line 85 of file vpMeLine.cpp.
References vpMeLine(), and vpMeTracker::vpMeTracker().
|
virtual |
|
protected |
References computeRhoTheta(), and leastSquare().
|
inline |
This method allows to turn off the computation of the sign of the rho attribute based on the intensity near the middle point of the line. This is usually done to distinguish between a black/white and a white/black edge but it may be source of problem (ex. for a servoing example) when this point can be occluded.
| unused | : This parameter is unused. |
Definition at line 515 of file vpMeLine.h.
|
protected |
Compute the two parameters
of the line in the (i,j) frame using all the MEs for disambiguating.
Select (rho,theta) from contrast between (rho,theta) and (-rho,theta +/- pi)
Definition at line 653 of file vpMeLine.cpp.
References vpMeSite::getIndex(), vpMeSite::getState(), m_a, m_b, m_c, vpMeSite::m_mask_sign, vpMeTracker::m_meList, m_rho, m_theta, vpMeSite::NO_SUPPRESSION, and vpMath::rad().
Referenced by computeDelta(), and track().
| void vpMeLine::display | ( | const vpImage< unsigned char > & | I, |
| const vpColor & | color, | ||
| unsigned int | thickness = 1 ) |
Display me line.
| I | : Image in which the line appears. |
| color | : Color of the displayed line. Note that a moving edge that is considered as an outlier is displayed in green. |
| thickness | : Drawings thickness. |
Definition at line 177 of file vpMeLine.cpp.
References displayLine(), m_a, m_b, m_c, vpMeTracker::m_meList, and m_PExt.
Referenced by track().
|
static |
Display of a moving line thanks to its equation parameters and its extremities.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 752 of file vpMeLine.cpp.
References displayLine().
|
static |
Display of a moving line thanks to its equation parameters and its extremities with all the site list.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| site_list | : vpMeSite list |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 793 of file vpMeLine.cpp.
References displayLine().
| void vpMeLine::display | ( | const vpImage< vpRGBa > & | I, |
| const vpColor & | color, | ||
| unsigned int | thickness = 1 ) |
Display me line.
| I | : Image in which the line appears. |
| color | : Color of the displayed line. Note that a moving edge that is considered as an outlier is displayed in green. |
| thickness | : Drawings thickness. |
Definition at line 182 of file vpMeLine.cpp.
References displayLine(), m_a, m_b, m_c, vpMeTracker::m_meList, and m_PExt.
|
static |
Display of a moving line thanks to its equation parameters and its extremities.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 772 of file vpMeLine.cpp.
References displayLine().
|
static |
Display of a moving line thanks to its equation parameters and its extremities with all the site list.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| site_list | : vpMeSite list |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 815 of file vpMeLine.cpp.
References displayLine().
|
inherited |
Display the moving edge sites with a color corresponding to their state.
| [in] | I | : The image. |
Definition at line 252 of file vpMeTracker.cpp.
References vpMeSite::display(), and m_meList.
Referenced by display(), vpMeEllipse::initTracking(), vpMeEllipse::initTracking(), and vpMeLine::track().
|
inherited |
Displays the status of moving edge sites
| [in] | I | : The image. |
| [in] | w | : vector |
| [in] | index_w | : index |
Definition at line 270 of file vpMeTracker.cpp.
References display(), vpMeSite::getState(), m_meList, vpMeSite::NO_SUPPRESSION, and vpMeSite::setWeight().
Display the moving edge sites with a color corresponding to their state.
| [in] | I | : The image. |
Definition at line 261 of file vpMeTracker.cpp.
References vpMeSite::display(), and m_meList.
|
static |
Display of a moving line thanks to its equation parameters and its extremities.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 825 of file vpMeLine.cpp.
References vpDisplay::displayCross(), vpDisplay::displayLine(), vpColor::green, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().
Referenced by display(), display(), display(), display(), display(), and display().
|
static |
Display of a moving line thanks to its equation parameters and its extremities with all the site list.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| site_list | : vpMeSite list |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 902 of file vpMeLine.cpp.
References vpDisplay::displayCross(), vpDisplay::displayLine(), vpMeSite::getState(), vpColor::green, vpMeSite::M_ESTIMATOR, vpMeSite::m_ifloat, vpMeSite::m_jfloat, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().
|
static |
Display of a moving line thanks to its equation parameters and its extremities.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 864 of file vpMeLine.cpp.
References vpDisplay::displayCross(), vpDisplay::displayLine(), vpColor::green, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().
|
static |
Display of a moving line thanks to its equation parameters and its extremities with all the site list.
| I | : The image used as background. |
| PExt1 | : First extremity |
| PExt2 | : Second extremity |
| site_list | : vpMeSite list |
| A | : Parameter a of the line equation a*i + b*j + c = 0 |
| B | : Parameter b of the line equation a*i + b*j + c = 0 |
| C | : Parameter c of the line equation a*i + b*j + c = 0 |
| color | : Color used to display the line. |
| thickness | : Thickness of the line. |
Definition at line 955 of file vpMeLine.cpp.
References vpDisplay::displayCross(), vpDisplay::displayLine(), vpMeSite::getState(), vpColor::green, vpMeSite::M_ESTIMATOR, vpMeSite::m_ifloat, vpMeSite::m_jfloat, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().
|
inline |
Gets the parameters a,b,c of the line with equation a*x + b*y + c = 0 as a 3-dim vector.
Definition at line 209 of file vpMeLine.h.
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 95 of file vpTracker.h.
References cP.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 93 of file vpTracker.h.
References p.
|
inline |
Definition at line 524 of file vpMeLine.h.
References m_a.
|
inline |
Definition at line 530 of file vpMeLine.h.
References m_b.
|
inline |
Definition at line 536 of file vpMeLine.h.
References m_c.
|
inline |
Definition at line 542 of file vpMeLine.h.
| void vpMeLine::getExtremities | ( | vpImagePoint & | ip1, |
| vpImagePoint & | ip2 ) const |
Get the extremities of the line. These two points strictly belong to the line. They are the projection of m_Pext[2] on the line
| ip1 | : Coordinates of the first extremity. |
| ip2 | : Coordinates of the second extremity. |
Definition at line 703 of file vpMeLine.cpp.
References m_a, m_b, m_c, vpMeTracker::m_meList, and project().
Referenced by plugHoles(), and seekExtremities().
|
inlineinherited |
Return the moving edges initialisation parameters.
Definition at line 153 of file vpMeTracker.h.
References m_me.
|
inlineinherited |
Return the list of moving edges
Definition at line 160 of file vpMeTracker.h.
References m_meList.
|
inlineinherited |
Return the list of moving edges
Definition at line 167 of file vpMeTracker.h.
References m_meList.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 174 of file vpMeTracker.h.
References m_nGoodElement.
|
inline |
Returns the value of
, the distance between the origin and the point on the line that belongs to the normal to the line passing through the origin.
Depending on the convention described at the beginning of this class,
is signed.
Definition at line 236 of file vpMeLine.h.
References m_rho.
|
inline |
Returns the value of
as a 2-dim vector.
Depending on the convention described at the beginning of this class,
is signed.
Definition at line 253 of file vpMeLine.h.
|
inline |
Returns the value of the angle
between
and
.
Definition at line 266 of file vpMeLine.h.
References m_theta.
|
inherited |
Initialize the tracker.
Definition at line 48 of file vpMeTracker.cpp.
References vpTracker::init(), m_selectDisplay, vpMeSite::NONE, and vpTracker::p.
Referenced by vpMeTracker(), and vpMeTracker().
| void vpMeLine::initTracking | ( | const vpImage< unsigned char > & | I | ) |
Initialization of the tracking. Ask the user to click on two points from the line to track.
| I | : Image in which the line appears. |
Definition at line 187 of file vpMeLine.cpp.
References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), initTracking(), and vpColor::red.
Referenced by initTracking().
| void vpMeLine::initTracking | ( | const vpImage< unsigned char > & | I, |
| const vpImagePoint & | ip1, | ||
| const vpImagePoint & | ip2 ) |
Initialization of the tracking. The line is defined thanks to the coordinates of two points.
| I | : Image in which the line appears. |
| ip1 | : Coordinates of the first point. |
| ip2 | : Coordinates of the second point. |
Definition at line 332 of file vpMeLine.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), vpMeTracker::initTracking(), m_delta, m_PExt, and sample().
|
inlinestaticinherited |
| [in] | 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. |
| [in] | i | : Pixel coordinate along the rows. |
| [in] | j | : Pixel coordinate along the columns. |
Definition at line 294 of file vpMeTracker.h.
References inRoiMask().
|
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.
| [in] | 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. |
| [in] | i | : ME coordinate along the rows. |
| [in] | j | : ME coordinate along the columns. |
Definition at line 113 of file vpMeTracker.cpp.
References vpImage< Type >::getCols(), and vpImage< Type >::getRows().
Referenced by vpMeLine::plugHoles(), vpMeEllipse::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.
| [in] | 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. |
| [in] | i | : Pixel coordinate along the rows. |
| [in] | j | : Pixel coordinate along the columns. |
Definition at line 103 of file vpMeTracker.cpp.
References vpImage< Type >::getValue().
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtDistanceKltPoints::computeNbDetectedCurrent(), vpMbtDistanceKltPoints::init(), inMask(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and track().
|
static |
Computes the intersection point of two lines. The result is given in the (i,j) frame.
| line1 | : The first line. |
| line2 | : The second line. |
| iP | : The coordinates of the intersection point. |
Definition at line 714 of file vpMeLine.cpp.
References m_a, m_b, m_c, vpImagePoint::set_i(), vpImagePoint::set_j(), and vpMeLine().
|
protected |
Least squares method used to make the tracking more robust. It ensures that the points taken into account to compute the right equation belong to the line.
| I | : Image in which the line appears. |
Definition at line 207 of file vpMeLine.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpMeSite::getState(), m_a, m_b, m_c, vpMeSite::m_ifloat, vpMeSite::m_jfloat, vpMeTracker::m_meList, vpMeSite::NO_SUPPRESSION, vpTrackingException::notEnoughPointError, vpMatrix::nullSpace(), vpMeTracker::numberOfSignal(), vpMatrixException::rankDeficient, vpMath::sqr(), and vpRobust::TUKEY.
Referenced by computeDelta(), reSample(), and track().
|
protected |
References plugHoles(), reSample(), seekExtremities(), setExtremities(), and updateDelta().
|
inherited |
Return number of moving-edges that are tracked.
Definition at line 92 of file vpMeTracker.cpp.
References m_meList.
Referenced by vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), vpMeNurbs::localReSample(), 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 | : Image number of rows. |
| [in] | ncols | : Image number of cols. |
Definition at line 172 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 | : Pixel coordinate along the image rows. |
| [in] | j | : Pixel coordinates along the image columns. |
| [in] | border | : Number of pixels along the image border to exclude. When border is set to 0, consider the complete image. |
| [in] | nrows | : Image number of rows. |
| [in] | ncols | : Image number of cols. |
Definition at line 164 of file vpMeTracker.cpp.
Referenced by vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), and vpMeNurbs::seekExtremities().
|
protected |
Seek along the line defined by its equation to add points in the detected holes. Useful in case of temporary occlusion
| I | : Image in which the line appears. |
| vpTrackingException::initializationError | : Moving edges not initialized. |
Definition at line 361 of file vpMeLine.cpp.
References vpColor::blue, vpMeSite::convolution(), vpDisplay::displayCross(), vpTrackingException::fatalError, vpImagePoint::get_i(), vpImagePoint::get_j(), getExtremities(), vpMeSite::getState(), vpMeSite::init(), vpTrackingException::initializationError, vpMeTracker::inMeMaskCandidates(), vpMeTracker::inRoiMask(), m_a, m_b, m_c, m_delta, vpMeTracker::m_mask, vpMeTracker::m_maskCandidates, vpMeTracker::m_me, vpMeTracker::m_meList, m_PExt, vpMeTracker::m_selectDisplay, m_sign, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), project(), vpImagePoint::set_ij(), vpMeSite::setContrastThreshold(), vpMeSite::setDisplay(), vpMeSite::setState(), vpMath::sqr(), vpMeSite::track(), and vpDEBUG_ENABLE.
Referenced by normalizeAngle(), and track().
|
static |
Project a ME site on a straight line.
| [in] | a | : Parameters a of the line. |
| [in] | b | : Parameters b of the line. |
| [in] | c | : Parameters c of the line. |
| [in] | P | : ME site. |
| [out] | iP | : Coordinates of the ME site projected on the line. |
Definition at line 66 of file vpMeLine.cpp.
References vpMeSite::m_ifloat, vpMeSite::m_jfloat, vpImagePoint::set_i(), and vpImagePoint::set_j().
Referenced by displayLine(), displayLine(), displayLine(), displayLine(), getExtremities(), and plugHoles().
|
protected |
Resample the line if the number of sample is less than 80% of the expected value.
| I | : Image in which the line appears. |
Definition at line 561 of file vpMeLine.cpp.
References vpTrackingException::initializationError, vpMeTracker::initTracking(), leastSquare(), m_delta, vpMeTracker::m_me, vpMeTracker::m_meList, m_PExt, sample(), setExtremities(), and vpMeTracker::track().
Referenced by normalizeAngle(), and track().
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 73 of file vpMeTracker.cpp.
References m_meList, and m_nGoodElement.
Referenced by ~vpMeTracker().
|
protectedvirtual |
Construct a list of vpMeSite moving edges at a particular sampling step between the two extremities of the line.
| I | : Image in which the line appears. |
| doNotTrack | : Inherited parameter, not used. |
| vpTrackingException::initializationError | : Moving edges not initialized. |
Implements vpMeTracker.
Definition at line 112 of file vpMeLine.cpp.
References vpColor::blue, vpMeSite::convolution(), vpDisplay::displayCross(), vpTrackingException::fatalError, vpMeSite::init(), vpTrackingException::initializationError, vpMeTracker::inMeMaskCandidates(), vpMeTracker::inRoiMask(), m_delta, vpMeTracker::m_mask, vpMeTracker::m_maskCandidates, vpMeTracker::m_me, vpMeTracker::m_meList, m_PExt, vpMeTracker::m_selectDisplay, m_sign, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), vpMath::round(), vpImagePoint::set_ij(), vpMeSite::setContrastThreshold(), vpMeSite::setDisplay(), vpMeSite::setState(), vpMath::sqr(), vpDEBUG_ENABLE, vpDERROR_TRACE, and vpERROR_TRACE.
Referenced by initTracking(), and reSample().
|
protectedvirtual |
Try to add points at both extremities of the line
| I | : Image in which the line appears. |
| vpTrackingException::initializationError | : Moving edges not initialized. |
Definition at line 445 of file vpMeLine.cpp.
References vpColor::blue, vpMeSite::convolution(), vpDisplay::displayCross(), vpImagePoint::get_i(), vpImagePoint::get_j(), getExtremities(), vpMeSite::getState(), vpColor::green, vpMeSite::init(), vpMeTracker::inMeMaskCandidates(), vpMeTracker::inRoiMask(), m_delta, vpMeSite::m_i, vpMeSite::m_ifloat, vpMeSite::m_j, vpMeSite::m_jfloat, vpMeTracker::m_mask, vpMeTracker::m_maskCandidates, vpMeTracker::m_me, vpMeTracker::m_meList, vpMeTracker::m_selectDisplay, m_sign, vpMeSite::NO_SUPPRESSION, vpMeTracker::outOfImage(), vpImagePoint::set_i(), vpImagePoint::set_ij(), vpImagePoint::set_j(), vpMeSite::setContrastThreshold(), vpMeSite::setDisplay(), vpMath::sqr(), vpMeSite::track(), and vpDEBUG_ENABLE.
Referenced by normalizeAngle(), and track().
|
inlineinherited |
Set type of moving-edges display.
| select | : Display type selector. |
Definition at line 234 of file vpMeTracker.h.
References m_selectDisplay.
|
protected |
Seek in the list of good points its two extremities m_PExt[2] These extremities are not strictly on the line
Definition at line 355 of file vpMeLine.cpp.
References vpMeTracker::m_meList, and m_PExt.
Referenced by normalizeAngle(), reSample(), and track().
|
inlinevirtualinherited |
Set the mask.
| mask | : Mask. |
Definition at line 241 of file vpMeTracker.h.
References m_mask.
|
inlinevirtualinherited |
Set the mask of candidates points for initialization.
| [in] | maskCandidates | : Pointer towards the mask of candidates points for initialization. |
Definition at line 248 of file vpMeTracker.h.
References m_maskCandidates.
|
inlineinherited |
Set the moving edges initialisation parameters.
| [in] | me | : Moving Edges. |
Definition at line 255 of file vpMeTracker.h.
References m_me.
|
inlineinherited |
Set the list of moving edges.
| [in] | meList | : List of Moving Edges. |
Definition at line 262 of file vpMeTracker.h.
References m_meList.
|
inline |
This method allows to disable/enable the calculation of the sign of the rho attribute from the intensity of the central point of the line. When enabled, it allows to distinguish between a black/white edge and a white/black edge, but it can cause problems for example during a visual-servo, when this point can be occluded.
| unused | : This parameter is unused. |
Definition at line 497 of file vpMeLine.h.
|
inherited |
Return the total number of moving-edges.
Definition at line 101 of file vpMeTracker.cpp.
References m_meList.
| void vpMeLine::track | ( | const vpImage< unsigned char > & | I | ) |
Track the line in the image I.
| I | : Image in which the line appears. |
Definition at line 607 of file vpMeLine.cpp.
References computeRhoTheta(), display(), vpMeTracker::display(), vpDisplay::flush(), leastSquare(), plugHoles(), vpColor::red, reSample(), seekExtremities(), setExtremities(), vpMeTracker::track(), updateDelta(), vpCDEBUG, and vpDEBUG_ENABLE.
|
protected |
Set the alpha value of the different vpMeSite to the value of delta.
Definition at line 593 of file vpMeLine.cpp.
References m_a, m_b, m_delta, vpMeTracker::m_meList, and vpMeSite::setAlpha().
Referenced by normalizeAngle(), and track().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 73 of file vpTracker.h.
Referenced by vpCircle::changeFrame(), vpCylinder::changeFrame(), vpForwardProjection::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpFeatureBuilder::create(), get_cP(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::getA(), vpCylinder::getA(), vpCircle::getB(), vpCylinder::getB(), vpCircle::getC(), vpCylinder::getC(), vpCircle::getR(), vpCylinder::getR(), vpSphere::getR(), vpCircle::getX(), vpCylinder::getX(), vpSphere::getX(), vpCircle::getY(), vpCylinder::getY(), vpSphere::getY(), vpCircle::getZ(), vpCylinder::getZ(), vpSphere::getZ(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpForwardProjection::projection(), vpLine::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), vpPoint::set_Z(), vpTracker(), and vpTracker().
|
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 init(), operator=(), vpTracker(), and vpTracker().
|
protected |
Parameter a of the line equation a*i + b*j + c = 0.
Definition at line 474 of file vpMeLine.h.
Referenced by computeRhoTheta(), display(), display(), get_ABC(), getA(), getEquationParam(), getExtremities(), intersection(), leastSquare(), operator=(), plugHoles(), updateDelta(), and vpMeLine().
|
protected |
Parameter b of the line equation a*i + b*j + c = 0.
Definition at line 475 of file vpMeLine.h.
Referenced by computeRhoTheta(), display(), display(), get_ABC(), getB(), getEquationParam(), getExtremities(), intersection(), leastSquare(), operator=(), plugHoles(), updateDelta(), and vpMeLine().
|
protected |
Parameter c of the line equation a*i + b*j + c = 0.
Definition at line 476 of file vpMeLine.h.
Referenced by computeRhoTheta(), display(), display(), get_ABC(), getC(), getEquationParam(), getExtremities(), intersection(), leastSquare(), operator=(), plugHoles(), and vpMeLine().
|
protected |
Angle in rad between the extremities.
Definition at line 471 of file vpMeLine.h.
Referenced by initTracking(), operator=(), plugHoles(), reSample(), sample(), seekExtremities(), updateDelta(), and vpMeLine().
|
protectedinherited |
Mask used to disable tracking on a part of image.
Definition at line 312 of file vpMeTracker.h.
Referenced by vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), setMask(), track(), vpMeTracker(), and vpMeTracker().
|
protectedinherited |
Mask used to determine candidate points for initialization in an image.
Definition at line 314 of file vpMeTracker.h.
Referenced by vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), setMaskCandidates(), vpMeTracker(), and vpMeTracker().
|
protectedinherited |
Moving edges initialisation parameters.
Definition at line 308 of file vpMeTracker.h.
Referenced by getMe(), initTracking(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeLine::reSample(), vpMeNurbs::reSample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), setMe(), vpMeNurbs::supressNearPoints(), track(), vpMeTracker(), and vpMeTracker().
|
protectedinherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 306 of file vpMeTracker.h.
Referenced by vpMeLine::computeRhoTheta(), vpMeLine::display(), vpMeLine::display(), display(), display(), display(), vpMeLine::getExtremities(), getMeList(), getMeList(), initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), vpMeNurbs::localReSample(), numberOfSignal(), operator=(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeLine::reSample(), reset(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), setMeList(), vpMeNurbs::suppressPoints(), vpMeNurbs::supressNearPoints(), totalNumberOfSignal(), vpMeNurbs::track(), track(), vpMeLine::updateDelta(), vpMeNurbs::updateDelta(), vpMeEllipse::updateTheta(), vpMeTracker(), vpMeTracker(), vpMeEllipse::~vpMeEllipse(), and vpMeLine::~vpMeLine().
|
protectedinherited |
Number of good moving-edges that are tracked.
Definition at line 310 of file vpMeTracker.h.
Referenced by getNbPoints(), initTracking(), operator=(), reset(), track(), vpMeTracker(), and vpMeTracker().
|
protected |
Both extremities of good points in the list. These extremities are not strictly on the line
Definition at line 466 of file vpMeLine.h.
Referenced by display(), display(), initTracking(), operator=(), plugHoles(), reSample(), sample(), and setExtremities().
|
protected |
rho parameter of the line
Definition at line 469 of file vpMeLine.h.
Referenced by computeRhoTheta(), getRho(), getRhoTheta(), operator=(), and vpMeLine().
|
protectedinherited |
Moving-edges display type.
Definition at line 316 of file vpMeTracker.h.
Referenced by init(), vpMeNurbs::localReSample(), operator=(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), setDisplay(), vpMeTracker(), and vpMeTracker().
|
protected |
Sign.
Definition at line 472 of file vpMeLine.h.
Referenced by operator=(), plugHoles(), sample(), seekExtremities(), and vpMeLine().
|
protected |
theta parameter of the line
Definition at line 470 of file vpMeLine.h.
Referenced by computeRhoTheta(), getRhoTheta(), getTheta(), operator=(), and vpMeLine().
|
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 vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpCircle::display(), vpCircle::display(), vpCylinder::display(), vpCylinder::display(), vpLine::display(), vpLine::display(), vpPoint::display(), vpPoint::display(), vpSphere::display(), vpSphere::display(), vpFeatureDisplay::displayEllipse(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpCircle::get_mu02(), vpSphere::get_mu02(), vpCircle::get_mu11(), vpSphere::get_mu11(), vpCircle::get_mu20(), vpSphere::get_mu20(), vpCircle::get_n02(), vpSphere::get_n02(), vpCircle::get_n11(), vpSphere::get_n11(), vpCircle::get_n20(), vpSphere::get_n20(), get_p(), vpPoint::get_w(), vpCircle::get_x(), vpPoint::get_x(), vpSphere::get_x(), vpCircle::get_y(), vpPoint::get_y(), vpSphere::get_y(), vpLine::getRho(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpLine::getTheta(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpMeTracker::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpForwardProjection::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), vpPoint::set_y(), vpLine::setRho(), vpLine::setTheta(), vpTracker(), and vpTracker().