![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpMeSite.h>
Public Types | |
| enum | vpMeSiteDisplayType { NONE , RANGE , RESULT , RANGE_RESULT } |
| enum | vpMeSiteState { NO_SUPPRESSION = 0 , CONTRAST = 1 , CONSTRAST = CONTRAST , THRESHOLD = 2 , M_ESTIMATOR = 3 , TOO_NEAR = 4 , UNKNOW = 5 , OUTSIDE_ROI_MASK = 6 } |
Public Member Functions | |
| vpMeSite () | |
| vpMeSite (const double &ip, const double &jp) | |
| vpMeSite (const vpMeSite &mesite) | |
| virtual | ~vpMeSite () |
| double | convolution (const vpImage< unsigned char > &ima, const vpMe *me) |
| double | convolution (const vpImage< unsigned char > &ima, const vpMe &me, const unsigned int mask_index) |
| unsigned int | computeMaskIndex (const double alpha, const vpMe &me) |
| void | display (const vpImage< unsigned char > &I) const |
| void | display (const vpImage< vpRGBa > &I) const |
| double | getAlpha () const |
| double | getWeight () const |
| vpMeSite * | getQueryList (const vpImage< unsigned char > &I, const int &range) const |
| int | get_i () const |
| int | get_j () const |
| double | get_ifloat () const |
| double | get_jfloat () const |
| unsigned int | getIndex () const |
| void | init () |
| void | init (const double &ip, const double &jp, const double &alphap) |
| void | init (const double &ip, const double &jp, const double &alphap, const double &convltp) |
| void | init (const double &ip, const double &jp, const double &alphap, const double &convltp, const int &sign) |
| void | init (const double &ip, const double &jp, const double &alphap, const double &convltp, const int &sign, const double &contrastThreshold) |
| void | track (const vpImage< unsigned char > &I, const vpMe *me, const bool &test_contrast=true) |
| void | trackMultipleHypotheses (const vpImage< unsigned char > &I, const vpMe &me, const bool &test_contrast, std::vector< vpMeSite > &outputHypotheses, const unsigned numCandidates) |
| void | setAlpha (const double &a) |
| void | setDisplay (vpMeSiteDisplayType select) |
| void | setState (const vpMeSiteState &flag) |
| vpMeSiteState | getState () const |
| void | setWeight (const double &weight) |
| void | setContrastThreshold (const double &thresh, const vpMe &me) |
| double | getContrastThreshold () const |
| double | computeFinalThreshold (const vpMe &me) const |
| vpMeSite & | operator= (const vpMeSite &m) |
| int | operator!= (const vpMeSite &m) |
Static Public Member Functions | |
| static double | distance (const vpMeSite &S1, const vpMeSite &S2) |
| static double | sqrDistance (const vpMeSite &S1, const vpMeSite &S2) |
| static void | display (const vpImage< unsigned char > &I, const double &i, const double &j, const vpMeSiteState &state=NO_SUPPRESSION) |
| static void | display (const vpImage< vpRGBa > &I, const double &i, const double &j, const vpMeSiteState &state=NO_SUPPRESSION) |
Public Attributes | |
| int | m_i |
| int | m_j |
| double | m_ifloat |
| double | m_jfloat |
| int | m_mask_sign |
| double | m_alpha |
| double | m_convlt |
| double | m_normGradient |
| double | m_weight |
| double | m_contrastThreshold |
Friends | |
| VISP_EXPORT std::ostream & | operator<< (std::ostream &os, vpMeSite &vpMeS) |
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'. Gives the most likely site given the probability from an ME mask.
Tutorials
If you are interested in using a ME tracker in your application, you may have a look at:
Definition at line 74 of file vpMeSite.h.
Type moving-edges site of display.
| Enumerator | |
|---|---|
| NONE | Not displayed. |
| RANGE | |
| RESULT | |
| RANGE_RESULT | |
Definition at line 80 of file vpMeSite.h.
Moving-edge site state
Definition at line 91 of file vpMeSite.h.
| vpMeSite::vpMeSite | ( | ) |
Default constructor.
Definition at line 95 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, m_normGradient, m_weight, NO_SUPPRESSION, and NONE.
Referenced by distance(), getQueryList(), operator!=(), operator<<, operator=(), sqrDistance(), track(), trackMultipleHypotheses(), and vpMeSite().
| vpMeSite::vpMeSite | ( | const double & | ip, |
| const double & | jp ) |
Constructor from pixel coordinates.
Definition at line 100 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, m_normGradient, m_weight, NO_SUPPRESSION, NONE, and vpMath::round().
| vpMeSite::vpMeSite | ( | const vpMeSite & | mesite | ) |
Copy constructor.
Definition at line 110 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, m_normGradient, m_weight, NO_SUPPRESSION, NONE, and vpMeSite().
|
inlinevirtual |
Destructor.
Definition at line 145 of file vpMeSite.h.
|
inline |
Get the final computed likelihood threshold value, depending on the likelihood threshold type and ME settings.
Definition at line 352 of file vpMeSite.h.
References getContrastThreshold(), vpMe::getLikelihoodThresholdType(), vpMe::getMaskSize(), and vpMe::NORMALIZED_THRESHOLD.
Referenced by track(), and trackMultipleHypotheses().
| unsigned int vpMeSite::computeMaskIndex | ( | const double | alpha, |
| const vpMe & | me ) |
Compute the index mask in [0:179] for convolution.
Specific function for ME. Compute the mask index in [0:179] for convolution
Definition at line 236 of file vpMeSite.cpp.
References vpMath::deg(), vpMe::getAngleStep(), and vpMath::round().
Referenced by convolution(), track(), and trackMultipleHypotheses().
| double vpMeSite::convolution | ( | const vpImage< unsigned char > & | I, |
| const vpMe & | me, | ||
| const unsigned int | mask_index ) |
Compute convolution for a given mask_index.
Specific function for ME.
Definition at line 297 of file vpMeSite.cpp.
References vpMe::getMask(), vpMe::getMaskSize(), vpMe::getStrip(), m_i, m_j, and m_mask_sign.
Compute convolution.
Definition at line 259 of file vpMeSite.cpp.
References computeMaskIndex(), vpMe::getMask(), vpMe::getMaskSize(), vpMe::getStrip(), m_alpha, m_i, m_j, and m_mask_sign.
Referenced by vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), track(), and trackMultipleHypotheses().
| void vpMeSite::display | ( | const vpImage< unsigned char > & | I | ) | const |
Display moving edges in image I.
| I | : Input image. |
Definition at line 547 of file vpMeSite.cpp.
References display(), m_ifloat, and m_jfloat.
Referenced by display(), display(), vpMeTracker::display(), and vpMeTracker::display().
|
static |
Display the moving edge site with a color corresponding to their state.
| I | : The image. |
| i | : Pixel i of the site. |
| j | : Pixel j of the site. |
| state | : State of the site. |
Definition at line 553 of file vpMeSite.cpp.
References vpColor::blue, CONTRAST, vpColor::cyan, vpDisplay::displayCross(), vpColor::green, M_ESTIMATOR, NO_SUPPRESSION, OUTSIDE_ROI_MASK, vpColor::purple, vpColor::red, THRESHOLD, and vpColor::yellow.
Display moving edges in image I.
| I | : Input image. |
Definition at line 549 of file vpMeSite.cpp.
|
static |
Display the moving edge site with a color corresponding to their state.
| I | : The image. |
| i | : Pixel i of the site. |
| j | : Pixel j of the site. |
| state | : State of the site. |
Definition at line 582 of file vpMeSite.cpp.
References vpColor::blue, CONTRAST, vpColor::cyan, vpDisplay::displayCross(), vpColor::green, M_ESTIMATOR, NO_SUPPRESSION, OUTSIDE_ROI_MASK, vpColor::purple, vpColor::red, THRESHOLD, and vpColor::yellow.
Compute the square root distance between two moving-edges sites ![]()
| S1 | : First site |
| S2 | : Second site |
Definition at line 391 of file vpMeSite.h.
References sqrDistance(), and vpMeSite().
|
inline |
Return integer coordinate along i (rows).
Definition at line 200 of file vpMeSite.h.
References m_i.
Referenced by vpMeNurbs::seekExtremities().
|
inline |
Return subpixel coordinate along i (rows).
Definition at line 212 of file vpMeSite.h.
References m_ifloat.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), and vpMeEllipse::plugHoles().
|
inline |
Return integer coordinate along j (columns).
Definition at line 206 of file vpMeSite.h.
References m_j.
Referenced by vpMeNurbs::seekExtremities().
|
inline |
Return subpixel coordinate along j (columns).
Definition at line 218 of file vpMeSite.h.
References m_jfloat.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), and vpMeEllipse::plugHoles().
|
inline |
Get the angle of tangent at site.
Definition at line 179 of file vpMeSite.h.
References m_alpha.
|
inline |
Get the contrast threshold of the site.
Definition at line 344 of file vpMeSite.h.
References m_contrastThreshold.
Referenced by computeFinalThreshold().
|
inline |
Return the convolution index in [0:179].
Definition at line 224 of file vpMeSite.h.
Referenced by vpMeLine::computeRhoTheta().
Construct and return the list of vpMeSite along the normal to the contour, in the given range.
| I | : Image in which the display is performed. |
| range | : +/- the range within which the pixel's correspondent will be sought. |
Definition at line 194 of file vpMeSite.cpp.
References vpDisplay::displayCross(), init(), m_alpha, m_contrastThreshold, m_convlt, m_ifloat, m_jfloat, m_mask_sign, RANGE, RANGE_RESULT, vpImagePoint::set_i(), vpImagePoint::set_j(), setDisplay(), vpMeSite(), and vpColor::yellow.
Referenced by track(), and trackMultipleHypotheses().
|
inline |
Get the state of the site.
Definition at line 306 of file vpMeSite.h.
Referenced by vpRBSilhouetteControlPoint::computeMeInteractionMatrixErrorMH(), vpMeLine::computeRhoTheta(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMeTracker::display(), vpMeLine::displayLine(), vpMeLine::displayLine(), vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMbEdgeTracker::testTracking(), and vpMbEdgeKltTracker::trackFirstLoop().
|
inline |
Return site weight or uncertainty as a probability between 0 and 1.
Definition at line 184 of file vpMeSite.h.
References m_weight.
| BEGIN_VISP_NAMESPACE void vpMeSite::init | ( | ) |
Initialize moving-edge site with default parameters.
Definition at line 70 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, m_normGradient, m_weight, NO_SUPPRESSION, and NONE.
Referenced by getQueryList(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), and vpMeNurbs::seekExtremitiesCanny().
| void vpMeSite::init | ( | const double & | ip, |
| const double & | jp, | ||
| const double & | alphap ) |
Initialize moving-edge site parameters.
Definition at line 119 of file vpMeSite.cpp.
References m_alpha, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, NONE, and vpMath::round().
| void vpMeSite::init | ( | const double & | ip, |
| const double & | jp, | ||
| const double & | alphap, | ||
| const double & | convltp ) |
Initialize moving-edge site parameters.
Definition at line 134 of file vpMeSite.cpp.
References m_alpha, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, and NONE.
| void vpMeSite::init | ( | const double & | ip, |
| const double & | jp, | ||
| const double & | alphap, | ||
| const double & | convltp, | ||
| const int & | sign ) |
Initialize moving-edge site parameters.
Definition at line 148 of file vpMeSite.cpp.
References m_alpha, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, and NONE.
| void vpMeSite::init | ( | const double & | ip, |
| const double & | jp, | ||
| const double & | alphap, | ||
| const double & | convltp, | ||
| const int & | sign, | ||
| const double & | contrastThreshold ) |
Initialize moving-edge site parameters.
Definition at line 162 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, and NONE.
| int vpMeSite::operator!= | ( | const vpMeSite & | m | ) |
Comparison operator.
Definition at line 545 of file vpMeSite.cpp.
References m_i, m_j, and vpMeSite().
Copy operator.
Definition at line 176 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, m_normGradient, m_weight, and vpMeSite().
|
inline |
Set the angle of tangent at site.
| a | : new value of alpha |
Definition at line 282 of file vpMeSite.h.
References m_alpha.
Referenced by vpMeLine::updateDelta().
|
inline |
Set the contrast threshold of the site. If the vpMe::m_useAutomaticThreshold is set to false, the contrast threshold is set to the global value retrieved using vpMe::getThreshold(). This value can be set using vpMe::setThreshold(). Otherwise, the contrast threshold will be set to the highest value between thresh and the minimum value set by vpMe::setMinThreshold() that could be retrieved using vpMe::getMinThreshold().
| [in] | thresh | : new value of contrast threshold |
| [in] | me | : moving-edge parameters |
Definition at line 326 of file vpMeSite.h.
References vpMe::getMinThreshold(), vpMe::getThreshold(), vpMe::getUseAutomaticThreshold(), and m_contrastThreshold.
Referenced by vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().
|
inline |
Display selector.
Definition at line 287 of file vpMeSite.h.
Referenced by getQueryList(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), and vpMeNurbs::seekExtremitiesCanny().
|
inline |
Set the state of the site.
| flag | : flag corresponding to vpMeSiteState |
Definition at line 296 of file vpMeSite.h.
Referenced by vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), and vpMeNurbs::supressNearPoints().
|
inline |
Set the weight or uncertainty of the site.
| weight | : New value of weight as a probability between 0 and 1. |
Definition at line 313 of file vpMeSite.h.
References m_weight.
Referenced by vpMeTracker::display().
Compute the square distance between two moving-edges sites ![]()
| S1 | : First site |
| S2 | : Second site |
Definition at line 407 of file vpMeSite.h.
References m_ifloat, m_jfloat, vpMath::sqr(), and vpMeSite().
Referenced by distance(), vpMeNurbs::localReSample(), vpMeNurbs::seekExtremitiesCanny(), and vpMeNurbs::supressNearPoints().
| void vpMeSite::track | ( | const vpImage< unsigned char > & | I, |
| const vpMe * | me, | ||
| const bool & | test_contrast = true ) |
Specific function for moving-edges.
| [in] | I | : Input image. |
| [in] | me | : Pointer to the moving-edges settings. |
| [in] | test_contrast | : When true tracking is based on contrast. The retained moving-edge is the one with similar contrast. When false, the tracking is based on the likelihood. The retained moving-edge is the one with the maximum likelihood. |
Definition at line 330 of file vpMeSite.cpp.
References vpMath::abs(), computeFinalThreshold(), computeMaskIndex(), CONTRAST, convolution(), vpDisplay::displayPoint(), vpMe::getMu1(), vpMe::getMu2(), getQueryList(), vpMe::getRange(), vpColor::green, m_alpha, m_convlt, m_i, m_j, m_mask_sign, m_normGradient, RANGE_RESULT, vpColor::red, RESULT, vpImagePoint::set_i(), vpImagePoint::set_j(), vpMath::sqr(), THRESHOLD, and vpMeSite().
Referenced by vpMeTracker::initTracking(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), and vpMeNurbs::seekExtremitiesCanny().
| void vpMeSite::trackMultipleHypotheses | ( | const vpImage< unsigned char > & | I, |
| const vpMe & | me, | ||
| const bool & | test_contrast, | ||
| std::vector< vpMeSite > & | outputHypotheses, | ||
| const unsigned | numCandidates ) |
Similar to the track() function, but stores the best numCandidates hypotheses in outputHypotheses. The best matching hypotheses (if it is not suppressed) is assigned to this and is stored as the first element of outputHypotheses. The hypotheses are sorted from best to worst match in the vector. A match may be in the vector but mark as suppressed. If this is undesired, you should filter them afterwards.
| If | numCandidates is superior to me.getRange() * 2 + 1. |
Definition at line 429 of file vpMeSite.cpp.
References vpMath::abs(), vpException::badValue, computeFinalThreshold(), computeMaskIndex(), CONTRAST, convolution(), vpDisplay::displayPoint(), vpMe::getMu1(), vpMe::getMu2(), getQueryList(), vpMe::getRange(), vpColor::green, m_alpha, m_convlt, m_i, m_j, m_mask_sign, m_normGradient, NO_SUPPRESSION, RANGE_RESULT, vpColor::red, RESULT, vpMath::sqr(), THRESHOLD, and vpMeSite().
|
friend |
ostream operator.
Definition at line 611 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_weight, operator<<, and vpMeSite().
Referenced by operator<<.
| double vpMeSite::m_alpha |
Angle of tangent at site.
Definition at line 116 of file vpMeSite.h.
Referenced by convolution(), getAlpha(), getQueryList(), init(), init(), init(), init(), init(), operator<<, operator=(), setAlpha(), track(), trackMultipleHypotheses(), vpMeEllipse::updateTheta(), vpMeSite(), vpMeSite(), and vpMeSite().
| double vpMeSite::m_contrastThreshold |
Old likelihood ratio threshold (to be avoided) or easy-to-use normalized threshold: minimal contrast.
Definition at line 124 of file vpMeSite.h.
Referenced by getContrastThreshold(), getQueryList(), init(), init(), operator<<, operator=(), setContrastThreshold(), vpMeSite(), vpMeSite(), and vpMeSite().
| double vpMeSite::m_convlt |
Convolution of Site in previous image.
Definition at line 118 of file vpMeSite.h.
Referenced by getQueryList(), init(), init(), init(), init(), operator<<, operator=(), track(), trackMultipleHypotheses(), vpMeSite(), vpMeSite(), and vpMeSite().
| int vpMeSite::m_i |
Integer coordinate along i of a site.
Definition at line 106 of file vpMeSite.h.
Referenced by vpRBSilhouetteControlPoint::computeMeInteractionMatrixErrorMH(), convolution(), convolution(), get_i(), init(), init(), init(), init(), init(), operator!=(), operator=(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), track(), trackMultipleHypotheses(), vpMeSite(), vpMeSite(), and vpMeSite().
| double vpMeSite::m_ifloat |
Subpixel coordinates along i of a site.
Definition at line 110 of file vpMeSite.h.
Referenced by display(), display(), vpMeLine::displayLine(), vpMeLine::displayLine(), get_ifloat(), getQueryList(), init(), init(), init(), init(), init(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeLine::project(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), sqrDistance(), vpMeEllipse::updateTheta(), vpMeSite(), vpMeSite(), and vpMeSite().
| int vpMeSite::m_j |
Integer coordinates along j of a site.
Definition at line 108 of file vpMeSite.h.
Referenced by vpRBSilhouetteControlPoint::computeMeInteractionMatrixErrorMH(), convolution(), convolution(), get_j(), init(), init(), init(), init(), init(), operator!=(), operator=(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), track(), trackMultipleHypotheses(), vpMeSite(), vpMeSite(), and vpMeSite().
| double vpMeSite::m_jfloat |
Subpixel coordinates along j of a site.
Definition at line 112 of file vpMeSite.h.
Referenced by display(), display(), vpMeLine::displayLine(), vpMeLine::displayLine(), get_jfloat(), getQueryList(), init(), init(), init(), init(), init(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeLine::project(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), sqrDistance(), vpMeEllipse::updateTheta(), vpMeSite(), vpMeSite(), and vpMeSite().
| int vpMeSite::m_mask_sign |
Mask sign.
Definition at line 114 of file vpMeSite.h.
Referenced by vpMeLine::computeRhoTheta(), convolution(), convolution(), getQueryList(), init(), init(), init(), init(), init(), operator=(), track(), trackMultipleHypotheses(), vpMeSite(), vpMeSite(), and vpMeSite().
| double vpMeSite::m_normGradient |
Convolution of Site in previous image.
Definition at line 120 of file vpMeSite.h.
Referenced by init(), operator=(), track(), trackMultipleHypotheses(), vpMeSite(), vpMeSite(), and vpMeSite().
| double vpMeSite::m_weight |
Uncertainty of point given as a probability between 0 and 1.
Definition at line 122 of file vpMeSite.h.
Referenced by getWeight(), init(), operator<<, operator=(), setWeight(), vpMeSite(), vpMeSite(), and vpMeSite().