Visual Servoing Platform  version 3.1.0

#include <visp3/me/vpMeSite.h>

Public Types

enum  vpMeSiteDisplayType { NONE, RANGE, RESULT, RANGE_RESULT }
 
enum  vpMeSiteState {
  NO_SUPPRESSION = 0, CONSTRAST = 1, 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)
 
double convolution (const vpImage< unsigned char > &ima, const vpMe *me)
 
vpMeSitegetQueryList (const vpImage< unsigned char > &I, const int range)
 
void track (const vpImage< unsigned char > &im, const vpMe *me, const bool test_contraste=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
 
vpMeSiteoperator= (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
 
int i_1
 
int j_1
 
double ifloat
 
double jfloat
 
unsigned char v
 
int mask_sign
 
double alpha
 
double convlt
 
double normGradient
 
double weight
 
int suppress
 

Friends

VISP_EXPORT std::ostream & operator<< (std::ostream &os, vpMeSite &vpMeS)
 

Detailed Description

Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'. Gives the most likely site given the probablility from an ME mask.

  • Bug fix: rewrote application of masks to use the temporal information instead of applying both temporal masks to the same image. ie: spatial -> spatio/temporal
  • Added new tracking function to choose the most similar edge amongst all edges found.
  • sample step.

Definition at line 71 of file vpMeSite.h.

Member Enumeration Documentation

◆ vpMeSiteDisplayType

Enumerator
NONE 
RANGE 
RESULT 
RANGE_RESULT 

Definition at line 74 of file vpMeSite.h.

◆ vpMeSiteState

Enumerator
NO_SUPPRESSION 
CONSTRAST 
THRESHOLD 
M_ESTIMATOR 
TOO_NEAR 
UNKNOW 

Definition at line 76 of file vpMeSite.h.

Constructor & Destructor Documentation

◆ vpMeSite() [1/3]

vpMeSite::vpMeSite ( )

Definition at line 95 of file vpMeSite.cpp.

◆ vpMeSite() [2/3]

vpMeSite::vpMeSite ( double  ip,
double  jp 
)

Definition at line 105 of file vpMeSite.cpp.

References ifloat, jfloat, and vpMath::round().

◆ vpMeSite() [3/3]

vpMeSite::vpMeSite ( const vpMeSite mesite)

Copy constructor.

Definition at line 122 of file vpMeSite.cpp.

◆ ~vpMeSite()

virtual vpMeSite::~vpMeSite ( )
inlinevirtual

Definition at line 113 of file vpMeSite.h.

Member Function Documentation

◆ convolution()

double vpMeSite::convolution ( const vpImage< unsigned char > &  ima,
const vpMe me 
)

◆ display() [1/3]

void vpMeSite::display ( const vpImage< unsigned char > &  I)

Definition at line 609 of file vpMeSite.cpp.

References ifloat, and jfloat.

Referenced by vpMeTracker::display().

◆ display() [2/3]

void vpMeSite::display ( const vpImage< unsigned char > &  I,
const double &  i,
const double &  j,
const vpMeSiteState state = NO_SUPPRESSION 
)
static

Display the moving edge site with a color corresponding to their state.

  • If green : The vpMeSite is a good point.
  • If blue : The point is removed because of the vpMeSite tracking phase (constrast problem).
  • If purple : The point is removed because of the vpMeSite tracking phase (threshold problem).
  • If red : The point is removed because of the robust method in the virtual visual servoing (M-Estimator problem).
  • If cyan : The point is removed because it's too close to another.
  • Yellow otherwise
Parameters
I: The image.
i: Pixel i of the site
j: Pixel j of the site
state: state of the site

Definition at line 631 of file vpMeSite.cpp.

References vpColor::blue, CONSTRAST, vpColor::cyan, vpDisplay::displayCross(), vpColor::green, M_ESTIMATOR, NO_SUPPRESSION, vpColor::purple, vpColor::red, THRESHOLD, TOO_NEAR, and vpColor::yellow.

◆ display() [3/3]

void vpMeSite::display ( const vpImage< vpRGBa > &  I,
const double &  i,
const double &  j,
const vpMeSiteState state = NO_SUPPRESSION 
)
static

Display the moving edge site with a color corresponding to their state.

  • If green : The vpMeSite is a good point.
  • If blue : The point is removed because of the vpMeSite tracking phase (constrast problem).
  • If purple : The point is removed because of the vpMeSite tracking phase (threshold problem).
  • If red : The point is removed because of the robust method in the virtual visual servoing (M-Estimator problem).
  • If cyan : The point is removed because it's too close to another.
  • Yellow otherwise
Parameters
I: The image.
i: Pixel i of the site
j: Pixel j of the site
state: state of the site

Definition at line 677 of file vpMeSite.cpp.

References vpColor::blue, CONSTRAST, vpColor::cyan, vpDisplay::displayCross(), vpColor::green, M_ESTIMATOR, NO_SUPPRESSION, vpColor::purple, vpColor::red, THRESHOLD, TOO_NEAR, and vpColor::yellow.

◆ distance()

static double vpMeSite::distance ( const vpMeSite S1,
const vpMeSite S2 
)
inlinestatic

Compute the distance $ |S1 - S2| = \sqrt{(i_1-i_2)^2+(j_1-j_2)^2} $

Parameters
S1: First site
S2: Second site
Returns
the distance between the two sites.

Definition at line 219 of file vpMeSite.h.

References ifloat, jfloat, and vpMath::sqr().

◆ get_i()

int vpMeSite::get_i ( ) const
inline

Get the i coordinate (integer)

Returns
value of i

Definition at line 144 of file vpMeSite.h.

◆ get_ifloat()

double vpMeSite::get_ifloat ( ) const
inline

Get the i coordinate (double)

Returns
value of i

Definition at line 158 of file vpMeSite.h.

◆ get_j()

int vpMeSite::get_j ( ) const
inline

Get the j coordinate (f)

Returns
value of j

Definition at line 151 of file vpMeSite.h.

◆ get_jfloat()

double vpMeSite::get_jfloat ( ) const
inline

Get the j coordinate (double)

Returns
value of j

Definition at line 165 of file vpMeSite.h.

◆ getAlpha()

double vpMeSite::getAlpha ( ) const
inline

Get the angle of tangent at site

Returns
value of alpha

Definition at line 135 of file vpMeSite.h.

◆ getQueryList()

vpMeSite * vpMeSite::getQueryList ( const vpImage< unsigned char > &  I,
const int  range 
)

Construct and return the list of vpMeSite along the normal to the contour, in the given range.

Precondition
: ifloat, jfloat, and the direction of the normal (alpha) have to be set.
Parameters
I: Image in which the display is performed.
range: +/- the range within which the pixel's correspondent will be sought
Returns
Pointer to the list of query sites

Definition at line 219 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().

◆ getSign()

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).

Precondition
: ifloat, jfloat, and the direction of the normal (alpha) have to be set.
Parameters
I: Image in which the sign is computed.
range: +/- the range within which the pixel's correspondent is sought
Postcondition
: mask_sign is computed

Definition at line 274 of file vpMeSite.cpp.

References alpha, ifloat, jfloat, mask_sign, and vpMath::round().

◆ getState()

◆ getWeight()

double vpMeSite::getWeight ( ) const
inline

Get the weight of the site

Returns
value of weight

Definition at line 202 of file vpMeSite.h.

◆ init() [1/4]

◆ init() [2/4]

void vpMeSite::init ( double  ip,
double  jp,
double  alphap 
)

Definition at line 135 of file vpMeSite.cpp.

References alpha, i_1, ifloat, j_1, jfloat, mask_sign, NONE, vpMath::round(), and v.

◆ init() [3/4]

void vpMeSite::init ( double  ip,
double  jp,
double  alphap,
double  convltp 
)

Definition at line 153 of file vpMeSite.cpp.

References alpha, convlt, i_1, ifloat, j_1, jfloat, mask_sign, NONE, and v.

◆ init() [4/4]

void vpMeSite::init ( double  ip,
double  jp,
double  alphap,
double  convltp,
int  sign 
)

Definition at line 169 of file vpMeSite.cpp.

References alpha, convlt, i_1, ifloat, j_1, jfloat, mask_sign, NONE, and v.

◆ operator!=()

int vpMeSite::operator!= ( const vpMeSite m)

Definition at line 597 of file vpMeSite.cpp.

References i, and j.

◆ operator=()

vpMeSite & vpMeSite::operator= ( const vpMeSite m)

Definition at line 185 of file vpMeSite.cpp.

References alpha, convlt, i, i_1, ifloat, j, j_1, jfloat, mask_sign, normGradient, suppress, v, and weight.

◆ setAlpha()

void vpMeSite::setAlpha ( const double &  a)
inline

Set the angle of tangent at site

Parameters
a: new value of alpha

Definition at line 128 of file vpMeSite.h.

◆ setDisplay()

◆ setState()

void vpMeSite::setState ( const vpMeSiteState flag)
inline

◆ setWeight()

void vpMeSite::setWeight ( const double &  w)
inline

Set the weight of the site

Parameters
w: new value of weight

Definition at line 195 of file vpMeSite.h.

◆ sqrDistance()

static double vpMeSite::sqrDistance ( const vpMeSite S1,
const vpMeSite S2 
)
inlinestatic

Compute the distance $ |S1 - S2| = (i_1-i_2)^2+(j_1-j_2)^2 $

Parameters
S1: First site
S2: Second site
Returns
the distance between the two sites.

Definition at line 232 of file vpMeSite.h.

References ifloat, jfloat, and vpMath::sqr().

Referenced by vpMeNurbs::localReSample(), vpMeNurbs::seekExtremitiesCanny(), and vpMeNurbs::supressNearPoints().

◆ track()

Friends And Related Function Documentation

◆ operator<<

VISP_EXPORT std::ostream& operator<< ( std::ostream &  os,
vpMeSite vpMeS 
)
friend

Definition at line 599 of file vpMeSite.cpp.

Member Data Documentation

◆ alpha

◆ convlt

double vpMeSite::convlt

Definition at line 94 of file vpMeSite.h.

Referenced by getQueryList(), init(), operator=(), and track().

◆ i

◆ i_1

int vpMeSite::i_1

Definition at line 87 of file vpMeSite.h.

Referenced by init(), vpMeTracker::initTracking(), operator=(), vpMeTracker::track(), and track().

◆ ifloat

◆ j

◆ j_1

int vpMeSite::j_1

Definition at line 87 of file vpMeSite.h.

Referenced by init(), vpMeTracker::initTracking(), operator=(), vpMeTracker::track(), and track().

◆ jfloat

◆ mask_sign

int vpMeSite::mask_sign

Definition at line 90 of file vpMeSite.h.

Referenced by convolution(), getQueryList(), getSign(), init(), operator=(), and vpMeLine::updateDelta().

◆ normGradient

double vpMeSite::normGradient

Definition at line 96 of file vpMeSite.h.

Referenced by init(), operator=(), and track().

◆ suppress

int vpMeSite::suppress

Flag to indicate whether point is rejected or not 1 = contrast, 2 = threshold, 3 = M-estimator, 0 = nosupp

Definition at line 247 of file vpMeSite.h.

Referenced by init(), and operator=().

◆ v

unsigned char vpMeSite::v

Definition at line 89 of file vpMeSite.h.

Referenced by init(), and operator=().

◆ weight

double vpMeSite::weight

Definition at line 98 of file vpMeSite.h.

Referenced by vpMeTracker::display(), init(), and operator=().