Visual Servoing Platform  version 3.2.0 under development (2019-01-22)

#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

Enumerator
NONE 
RANGE 
RESULT 
RANGE_RESULT 

Definition at line 74 of file vpMeSite.h.

Enumerator
NO_SUPPRESSION 
CONSTRAST 
THRESHOLD 
M_ESTIMATOR 
TOO_NEAR 
UNKNOW 

Definition at line 76 of file vpMeSite.h.

Constructor & Destructor Documentation

vpMeSite::vpMeSite ( )

Definition at line 95 of file vpMeSite.cpp.

vpMeSite::vpMeSite ( double  ip,
double  jp 
)

Definition at line 105 of file vpMeSite.cpp.

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

vpMeSite::vpMeSite ( const vpMeSite mesite)

Copy constructor.

Definition at line 122 of file vpMeSite.cpp.

virtual vpMeSite::~vpMeSite ( )
inlinevirtual

Definition at line 113 of file vpMeSite.h.

Member Function Documentation

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

Definition at line 601 of file vpMeSite.cpp.

References ifloat, and jfloat.

Referenced by vpMeTracker::display().

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

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

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

int vpMeSite::get_i ( ) const
inline

Get the i coordinate (integer)

Returns
value of i

Definition at line 144 of file vpMeSite.h.

double vpMeSite::get_ifloat ( ) const
inline

Get the i coordinate (double)

Returns
value of i

Definition at line 158 of file vpMeSite.h.

int vpMeSite::get_j ( ) const
inline

Get the j coordinate (f)

Returns
value of j

Definition at line 151 of file vpMeSite.h.

double vpMeSite::get_jfloat ( ) const
inline

Get the j coordinate (double)

Returns
value of j

Definition at line 165 of file vpMeSite.h.

double vpMeSite::getAlpha ( ) const
inline

Get the angle of tangent at site

Returns
value of alpha

Definition at line 135 of file vpMeSite.h.

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

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 267 of file vpMeSite.cpp.

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

double vpMeSite::getWeight ( ) const
inline

Get the weight of the site

Returns
value of weight

Definition at line 202 of file vpMeSite.h.

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.

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.

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.

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

Definition at line 589 of file vpMeSite.cpp.

References i, and j.

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.

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.

void vpMeSite::setState ( const vpMeSiteState flag)
inline
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.

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

Friends And Related Function Documentation

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

Definition at line 591 of file vpMeSite.cpp.

Member Data Documentation

double vpMeSite::convlt

Definition at line 94 of file vpMeSite.h.

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

int vpMeSite::i_1

Definition at line 87 of file vpMeSite.h.

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

int vpMeSite::j_1

Definition at line 87 of file vpMeSite.h.

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

int vpMeSite::mask_sign

Definition at line 90 of file vpMeSite.h.

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

double vpMeSite::normGradient

Definition at line 96 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 247 of file vpMeSite.h.

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

unsigned char vpMeSite::v

Definition at line 89 of file vpMeSite.h.

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

double vpMeSite::weight

Definition at line 98 of file vpMeSite.h.

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