Visual Servoing Platform
version 3.5.1 under development (2023-09-22)
|
#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 } |
Public Member Functions | |
void | init () |
void | init (double ip, double jp, double alphap) |
void | init (double ip, double jp, double alphap, double convltp) |
void | init (double ip, double jp, double alphap, double convltp, int sign) |
vpMeSite () | |
vpMeSite (double ip, double jp) | |
vpMeSite (const vpMeSite &mesite) | |
virtual | ~vpMeSite () |
void | display (const vpImage< unsigned char > &I) |
void | display (const vpImage< vpRGBa > &I) |
double | convolution (const vpImage< unsigned char > &ima, const vpMe *me) |
vpMeSite * | getQueryList (const vpImage< unsigned char > &I, const int range) |
void | track (const vpImage< unsigned char > &im, const vpMe *me, bool test_likelihood=true) |
void | setAlpha (const double &a) |
double | getAlpha () const |
void | setDisplay (vpMeSiteDisplayType select) |
int | get_i () const |
int | get_j () const |
double | get_ifloat () const |
double | get_jfloat () const |
void | setState (const vpMeSiteState &flag) |
vpMeSiteState | getState () const |
void | setWeight (const double &w) |
double | getWeight () const |
vpMeSite & | operator= (const vpMeSite &m) |
int | operator!= (const vpMeSite &m) |
vp_deprecated void | getSign (const vpImage< unsigned char > &I, const int range) |
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 | i |
int | j |
double | ifloat |
double | jfloat |
int | mask_sign |
double | alpha |
double | convlt |
double | normGradient |
double | weight |
int | suppress |
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 85 of file vpMeSite.cpp.
vpMeSite::vpMeSite | ( | double | ip, |
double | jp | ||
) |
Constructor from pixel coordinates.
Definition at line 94 of file vpMeSite.cpp.
References i, ifloat, j, jfloat, and vpMath::round().
vpMeSite::vpMeSite | ( | const vpMeSite & | mesite | ) |
Copy constructor.
Definition at line 108 of file vpMeSite.cpp.
|
inlinevirtual |
Destructor.
Definition at line 157 of file vpMeSite.h.
Compute convolution.
Definition at line 253 of file vpMeSite.cpp.
References alpha, vpMe::getAngleStep(), vpImage< Type >::getHeight(), vpMe::getMask(), vpMe::getMaskSize(), vpMe::getStrip(), vpImage< Type >::getWidth(), i, j, mask_sign, and vpMath::round().
Referenced by track().
void vpMeSite::display | ( | const vpImage< unsigned char > & | I | ) |
Display moving edges in image I.
I | : Input image. |
Definition at line 415 of file vpMeSite.cpp.
References ifloat, and 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 421 of file vpMeSite.cpp.
References vpColor::blue, CONTRAST, vpColor::cyan, vpDisplay::displayCross(), vpColor::green, i, j, M_ESTIMATOR, NO_SUPPRESSION, vpColor::purple, vpColor::red, THRESHOLD, TOO_NEAR, and vpColor::yellow.
Display moving edges in image I.
I | : Input image. |
Definition at line 417 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 449 of file vpMeSite.cpp.
References vpColor::blue, CONTRAST, vpColor::cyan, vpDisplay::displayCross(), vpColor::green, i, j, M_ESTIMATOR, NO_SUPPRESSION, vpColor::purple, vpColor::red, THRESHOLD, TOO_NEAR, and vpColor::yellow.
Compute the square root distance between two moving-edges sites
S1 | : First site |
S2 | : Second site |
Definition at line 304 of file vpMeSite.h.
|
inline |
|
inline |
Get the i coordinate (double).
Definition at line 231 of file vpMeSite.h.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), and vpMbtDistanceLine::getFeaturesForDisplay().
|
inline |
|
inline |
Get the j coordinate (double).
Definition at line 238 of file vpMeSite.h.
Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), and vpMbtDistanceLine::getFeaturesForDisplay().
|
inline |
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 181 of file vpMeSite.cpp.
References alpha, convlt, vpDisplay::displayCross(), ifloat, init(), jfloat, mask_sign, RANGE, RANGE_RESULT, vpImagePoint::set_i(), vpImagePoint::set_j(), setDisplay(), and vpColor::yellow.
Referenced by track().
void vpMeSite::getSign | ( | const vpImage< unsigned char > & | I, |
const int | range | ||
) |
Get the sign (according to the difference of values of the intensities of the extremities).
I | : Image in which the sign is computed. |
range | : +/- the range within which the pixel's correspondent is sought. |
Definition at line 228 of file vpMeSite.cpp.
References alpha, ifloat, jfloat, mask_sign, and vpMath::round().
|
inline |
Get the state of the site.
Definition at line 261 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 |
void vpMeSite::init | ( | void | ) |
Initialize moving-edge site with default parameters.
Definition at line 59 of file vpMeSite.cpp.
References alpha, convlt, i, ifloat, j, jfloat, mask_sign, NO_SUPPRESSION, NONE, normGradient, suppress, and weight.
Referenced by getQueryList(), vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), and vpMeNurbs::seekExtremitiesCanny().
void vpMeSite::init | ( | double | ip, |
double | jp, | ||
double | alphap | ||
) |
Initialize moving-edge site parameters.
Definition at line 121 of file vpMeSite.cpp.
References alpha, i, ifloat, j, jfloat, mask_sign, NONE, and vpMath::round().
void vpMeSite::init | ( | double | ip, |
double | jp, | ||
double | alphap, | ||
double | convltp | ||
) |
void vpMeSite::init | ( | double | ip, |
double | jp, | ||
double | alphap, | ||
double | convltp, | ||
int | sign | ||
) |
int vpMeSite::operator!= | ( | const vpMeSite & | m | ) |
|
inline |
Set the angle of tangent at site.
a | : new value of alpha |
Definition at line 198 of file vpMeSite.h.
|
inline |
Display selector.
Definition at line 210 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 247 of file vpMeSite.h.
Referenced by vpMeLine::leastSquare(), vpMeEllipse::plugHoles(), vpMbEdgeKltTracker::postTrackingMbt(), vpMeEllipse::sample(), vpMeNurbs::supressNearPoints(), vpMeTracker::track(), and vpMbEdgeTracker::updateMovingEdgeWeights().
|
inline |
Set the weight of the site.
w | : new value of weight |
Definition at line 268 of file vpMeSite.h.
Compute the square distance between two moving-edges sites
S1 | : First site |
S2 | : Second site |
Definition at line 320 of file vpMeSite.h.
References ifloat, jfloat, and vpMath::sqr().
Referenced by vpMeNurbs::localReSample(), vpMeNurbs::seekExtremitiesCanny(), and vpMeNurbs::supressNearPoints().
void vpMeSite::track | ( | const vpImage< unsigned char > & | im, |
const vpMe * | me, | ||
bool | test_likelihood = true |
||
) |
Specific function for moving-edges.
Definition at line 305 of file vpMeSite.cpp.
References CONTRAST, convlt, convolution(), vpDisplay::displayPoint(), vpMe::getLikelihoodThresholdType(), vpMe::getMaskSize(), vpMe::getMu1(), vpMe::getMu2(), getQueryList(), vpMe::getRange(), vpMe::getThreshold(), vpColor::green, i, j, vpMe::NORMALIZED_THRESHOLD, normGradient, 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 405 of file vpMeSite.cpp.
double vpMeSite::alpha |
Angle of tangent at site.
Definition at line 106 of file vpMeSite.h.
Referenced by convolution(), getQueryList(), getSign(), init(), operator=(), vpMeLine::updateDelta(), vpMeNurbs::updateDelta(), and vpMeEllipse::updateTheta().
double vpMeSite::convlt |
Convolution of Site in previous image.
Definition at line 108 of file vpMeSite.h.
Referenced by getQueryList(), init(), operator=(), and track().
int vpMeSite::i |
Coordinate along i of a site.
Definition at line 96 of file vpMeSite.h.
Referenced by convolution(), display(), init(), operator!=(), operator=(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeTracker::track(), track(), vpMeNurbs::updateDelta(), and vpMeSite().
double vpMeSite::ifloat |
Floating coordinates along i of a site.
Definition at line 100 of file vpMeSite.h.
Referenced by display(), vpMeLine::displayLine(), getQueryList(), getSign(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), init(), vpMeLine::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeEllipse::plugHoles(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), sqrDistance(), vpMeEllipse::updateTheta(), and vpMeSite().
int vpMeSite::j |
Coordinates along j of a site.
Definition at line 98 of file vpMeSite.h.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), convolution(), display(), init(), operator!=(), operator=(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeTracker::track(), track(), vpMeNurbs::updateDelta(), and vpMeSite().
double vpMeSite::jfloat |
Floating coordinates along j of a site.
Definition at line 102 of file vpMeSite.h.
Referenced by display(), vpMeLine::displayLine(), getQueryList(), getSign(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), init(), vpMeLine::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeEllipse::plugHoles(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), sqrDistance(), vpMeEllipse::updateTheta(), and vpMeSite().
int vpMeSite::mask_sign |
Mask sign.
Definition at line 104 of file vpMeSite.h.
Referenced by convolution(), getQueryList(), getSign(), init(), operator=(), and vpMeLine::updateDelta().
double vpMeSite::normGradient |
Convolution of Site in previous image.
Definition at line 110 of file vpMeSite.h.
Referenced by init(), operator=(), and track().
int vpMeSite::suppress |
Flag to indicate whether point is rejected or not 1 = contrast, 2 = threshold, 3 = M-estimator, 0 = nosupp
Definition at line 366 of file vpMeSite.h.
Referenced by init(), and operator=().
double vpMeSite::weight |
Uncertainty of point given as a probability between 0 and 1.
Definition at line 112 of file vpMeSite.h.
Referenced by vpMeTracker::display(), init(), and operator=().