Visual Servoing Platform
version 3.6.1 under development (2024-03-28)
|
#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 64 of file vpMeSite.h.
Type moving-edges site of display.
Enumerator | |
---|---|
NONE | Not displayed. |
RANGE | |
RESULT | |
RANGE_RESULT |
Definition at line 70 of file vpMeSite.h.
Moving-edge site state
Definition at line 81 of file vpMeSite.h.
vpMeSite::vpMeSite | ( | ) |
Default constructor.
Definition at line 78 of file vpMeSite.cpp.
vpMeSite::vpMeSite | ( | const double & | ip, |
const double & | jp | ||
) |
Constructor from pixel coordinates.
Definition at line 83 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 93 of file vpMeSite.cpp.
|
inlinevirtual |
Destructor.
Definition at line 135 of file vpMeSite.h.
Compute convolution.
Definition at line 212 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 385 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 391 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 387 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 420 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 333 of file vpMeSite.h.
|
inline |
Return integer coordinate along i (rows).
Definition at line 180 of file vpMeSite.h.
Referenced by vpMeNurbs::seekExtremities(), vpMeTracker::track(), and vpMeNurbs::updateDelta().
|
inline |
Return subpixel coordinate along i (rows).
Definition at line 192 of file vpMeSite.h.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMeEllipse::leastSquareRobust(), and vpMeEllipse::plugHoles().
|
inline |
Return integer coordinate along j (columns).
Definition at line 186 of file vpMeSite.h.
Referenced by vpMeNurbs::seekExtremities(), vpMeTracker::track(), and vpMeNurbs::updateDelta().
|
inline |
Return subpixel coordinate along j (columns).
Definition at line 198 of file vpMeSite.h.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), vpMbtDistanceLine::getFeaturesForDisplay(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMeEllipse::leastSquareRobust(), and vpMeEllipse::plugHoles().
|
inline |
|
inline |
Get the contrast threshold of the site.
Definition at line 304 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 173 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 266 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(), 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 164 of file vpMeSite.h.
void vpMeSite::init | ( | void | ) |
Initialize moving-edge site with default parameters.
Definition at line 55 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 102 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 116 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 129 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 142 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 155 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 242 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 286 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 247 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 256 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 273 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 349 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 267 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 380 of file vpMeSite.cpp.
double vpMeSite::m_alpha |
Angle of tangent at site.
Definition at line 106 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 114 of file vpMeSite.h.
Referenced by getQueryList(), init(), and operator=().
double vpMeSite::m_convlt |
Convolution of Site in previous image.
Definition at line 108 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 96 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 100 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 98 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 102 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 104 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 110 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 112 of file vpMeSite.h.
Referenced by init(), and operator=().