![]() |
Visual Servoing Platform
version 3.6.1 under development (2024-07-27)
|
#include <visp3/me/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) |
void | display (const vpImage< unsigned char > &I) |
void | display (const vpImage< vpRGBa > &I) |
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 |
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 | 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 |
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.
Definition at line 67 of file vpMeSite.h.
Type moving-edges site of display.
Enumerator | |
---|---|
NONE | Not displayed. |
RANGE | |
RESULT | |
RANGE_RESULT |
Definition at line 73 of file vpMeSite.h.
Moving-edge site state
Definition at line 84 of file vpMeSite.h.
vpMeSite::vpMeSite | ( | ) |
Default constructor.
Definition at line 80 of file vpMeSite.cpp.
vpMeSite::vpMeSite | ( | const double & | ip, |
const double & | jp | ||
) |
Constructor from pixel coordinates.
Definition at line 85 of file vpMeSite.cpp.
References m_i, m_ifloat, m_j, m_jfloat, and vpMath::round().
vpMeSite::vpMeSite | ( | const vpMeSite & | mesite | ) |
Copy constructor.
Definition at line 95 of file vpMeSite.cpp.
|
inlinevirtual |
Destructor.
Definition at line 138 of file vpMeSite.h.
Compute convolution.
Definition at line 214 of file vpMeSite.cpp.
References vpMe::getAngleStep(), vpImage< Type >::getHeight(), vpMe::getMask(), vpMe::getMaskSize(), vpMe::getStrip(), vpImage< Type >::getWidth(), m_alpha, m_i, m_j, m_mask_sign, and vpMath::round().
Referenced by vpMeEllipse::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), and track().
void vpMeSite::display | ( | const vpImage< unsigned char > & | I | ) |
Display moving edges in image I.
I | : Input image. |
Definition at line 383 of file vpMeSite.cpp.
References m_ifloat, and m_jfloat.
Referenced by vpMeTracker::display(), and 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 389 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 385 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 418 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 336 of file vpMeSite.h.
|
inline |
Return integer coordinate along i (rows).
Definition at line 183 of file vpMeSite.h.
Referenced by vpMeNurbs::seekExtremities(), vpMeTracker::track(), and vpMeNurbs::updateDelta().
|
inline |
Return subpixel coordinate along i (rows).
Definition at line 195 of file vpMeSite.h.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), and vpMeEllipse::plugHoles().
|
inline |
Return integer coordinate along j (columns).
Definition at line 189 of file vpMeSite.h.
Referenced by vpMeNurbs::seekExtremities(), vpMeTracker::track(), and vpMeNurbs::updateDelta().
|
inline |
Return subpixel coordinate along j (columns).
Definition at line 201 of file vpMeSite.h.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), and vpMeEllipse::plugHoles().
|
inline |
|
inline |
Get the contrast threshold of the site.
Definition at line 307 of file vpMeSite.h.
Referenced by track().
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 175 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(), and vpColor::yellow.
Referenced by track().
|
inline |
Get the state of the site.
Definition at line 269 of file vpMeSite.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMeTracker::display(), vpMeLine::displayLine(), vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeLine::suppressPoints(), vpMeNurbs::suppressPoints(), vpMbEdgeTracker::testTracking(), vpMeTracker::track(), and vpMbEdgeKltTracker::trackFirstLoop().
|
inline |
Return site weight or uncertainty as a probability between 0 and 1.
Definition at line 167 of file vpMeSite.h.
BEGIN_VISP_NAMESPACE void vpMeSite::init | ( | void | ) |
Initialize moving-edge site with default parameters.
Definition at line 57 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(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::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 104 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 118 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 131 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 144 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 | ) |
Copy operator.
Definition at line 157 of file vpMeSite.cpp.
References m_alpha, m_contrastThreshold, m_convlt, m_i, m_ifloat, m_j, m_jfloat, m_mask_sign, m_normGradient, and m_weight.
|
inline |
Set the angle of tangent at site.
a | : new value of alpha |
Definition at line 245 of file vpMeSite.h.
Referenced by vpMeLine::updateDelta(), and vpMeNurbs::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().
thresh | : new value of contrast threshold |
me | moving-edge parameters |
Definition at line 289 of file vpMeSite.h.
References vpMe::getMinThreshold(), vpMe::getThreshold(), and vpMe::getUseAutomaticThreshold().
Referenced by vpMeEllipse::plugHoles(), vpMeEllipse::sample(), and vpMeLine::sample().
|
inline |
Display selector.
Definition at line 250 of file vpMeSite.h.
Referenced by getQueryList(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), and vpMeNurbs::seekExtremitiesCanny().
|
inline |
Set the state of the site.
flag | : flag corresponding to vpMeSiteState |
Definition at line 259 of file vpMeSite.h.
Referenced by vpMeLine::leastSquare(), vpMeEllipse::plugHoles(), vpMbEdgeKltTracker::postTrackingMbt(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::supressNearPoints(), vpMeTracker::track(), and vpMbEdgeTracker::updateMovingEdgeWeights().
|
inline |
Set the weight or uncertainty of the site.
weight | : New value of weight as a probability between 0 and 1. |
Definition at line 276 of file vpMeSite.h.
Referenced by vpMeTracker::display().
Compute the square distance between two moving-edges sites
S1 | : First site |
S2 | : Second site |
Definition at line 352 of file vpMeSite.h.
References m_ifloat, m_jfloat, and vpMath::sqr().
Referenced by 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 269 of file vpMeSite.cpp.
References CONTRAST, convolution(), vpDisplay::displayPoint(), getContrastThreshold(), vpMe::getLikelihoodThresholdType(), vpMe::getMaskSize(), vpMe::getMu1(), vpMe::getMu2(), getQueryList(), vpMe::getRange(), vpColor::green, m_convlt, m_i, m_j, m_normGradient, vpMe::NORMALIZED_THRESHOLD, RANGE_RESULT, vpColor::red, RESULT, vpImagePoint::set_i(), vpImagePoint::set_j(), vpMath::sqr(), and THRESHOLD.
Referenced by vpMeTracker::initTracking(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), and vpMeTracker::track().
|
friend |
ostream operator.
Definition at line 447 of file vpMeSite.cpp.
double vpMeSite::m_alpha |
Angle of tangent at site.
Definition at line 109 of file vpMeSite.h.
Referenced by convolution(), getQueryList(), init(), operator=(), and vpMeEllipse::updateTheta().
double vpMeSite::m_contrastThreshold |
Old likelihood ratio threshold (to be avoided) or easy-to-use normalized threshold: minimal contrast.
Definition at line 117 of file vpMeSite.h.
Referenced by getQueryList(), init(), and operator=().
double vpMeSite::m_convlt |
Convolution of Site in previous image.
Definition at line 111 of file vpMeSite.h.
Referenced by getQueryList(), init(), operator=(), and track().
int vpMeSite::m_i |
Integer coordinate along i of a site.
Definition at line 99 of file vpMeSite.h.
Referenced by convolution(), init(), operator!=(), operator=(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), track(), and vpMeSite().
double vpMeSite::m_ifloat |
Subpixel coordinates along i of a site.
Definition at line 103 of file vpMeSite.h.
Referenced by display(), vpMeLine::displayLine(), getQueryList(), init(), vpMeLine::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), sqrDistance(), vpMeEllipse::updateTheta(), and vpMeSite().
int vpMeSite::m_j |
Integer coordinates along j of a site.
Definition at line 101 of file vpMeSite.h.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), convolution(), init(), operator!=(), operator=(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), track(), and vpMeSite().
double vpMeSite::m_jfloat |
Subpixel coordinates along j of a site.
Definition at line 105 of file vpMeSite.h.
Referenced by display(), vpMeLine::displayLine(), getQueryList(), init(), vpMeLine::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), sqrDistance(), vpMeEllipse::updateTheta(), and vpMeSite().
int vpMeSite::m_mask_sign |
Mask sign.
Definition at line 107 of file vpMeSite.h.
Referenced by convolution(), getQueryList(), init(), operator=(), and vpMeLine::updateDelta().
double vpMeSite::m_normGradient |
Convolution of Site in previous image.
Definition at line 113 of file vpMeSite.h.
Referenced by init(), operator=(), and track().
double vpMeSite::m_weight |
Uncertainty of point given as a probability between 0 and 1.
Definition at line 115 of file vpMeSite.h.
Referenced by init(), and operator=().