ViSP  2.9.0

#include <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 76 of file vpMeSite.h.

Member Enumeration Documentation

Enumerator
NONE 
RANGE 
RESULT 
RANGE_RESULT 

Definition at line 79 of file vpMeSite.h.

Enumerator
NO_SUPPRESSION 
CONSTRAST 
THRESHOLD 
M_ESTIMATOR 
TOO_NEAR 
UNKNOW 

Definition at line 87 of file vpMeSite.h.

Constructor & Destructor Documentation

vpMeSite::vpMeSite ( )

Definition at line 102 of file vpMeSite.cpp.

vpMeSite::vpMeSite ( double  ip,
double  jp 
)

Definition at line 111 of file vpMeSite.cpp.

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

vpMeSite::vpMeSite ( const vpMeSite mesite)

Copy constructor.

Definition at line 127 of file vpMeSite.cpp.

virtual vpMeSite::~vpMeSite ( )
inlinevirtual

Definition at line 125 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 645 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 667 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 711 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 233 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 159 of file vpMeSite.h.

double vpMeSite::get_ifloat ( ) const
inline

Get the i coordinate (double)

Returns
value of i

Definition at line 173 of file vpMeSite.h.

int vpMeSite::get_j ( ) const
inline

Get the j coordinate (f)

Returns
value of j

Definition at line 166 of file vpMeSite.h.

double vpMeSite::get_jfloat ( ) const
inline

Get the j coordinate (double)

Returns
value of j

Definition at line 180 of file vpMeSite.h.

double vpMeSite::getAlpha ( ) const
inline

Get the angle of tangent at site

Returns
value of alpha

Definition at line 149 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 229 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 287 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 216 of file vpMeSite.h.

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

Definition at line 140 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 160 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 177 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 625 of file vpMeSite.cpp.

References i, and j.

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

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

void vpMeSite::setState ( const vpMeSiteState flag)
inline

Set the state of the site

Parameters
flag: flag corresponding to vpMeSiteState
See also
vpMeSiteState

Definition at line 189 of file vpMeSite.h.

Referenced by vpMbEdgeTracker::computeVVS(), vpMeLine::leastSquare(), vpMbEdgeKltTracker::postTrackingMbt(), vpMeNurbs::supressNearPoints(), and vpMeTracker::track().

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

Set the weight of the site

Parameters
w: new value of weight

Definition at line 209 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 244 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 > &  I,
const vpMe me,
const bool  test_contraste = true 
)

Friends And Related Function Documentation

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

Definition at line 631 of file vpMeSite.cpp.

Member Data Documentation

double vpMeSite::alpha
double vpMeSite::convlt

Definition at line 106 of file vpMeSite.h.

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

int vpMeSite::i_1

Definition at line 99 of file vpMeSite.h.

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

int vpMeSite::j_1

Definition at line 99 of file vpMeSite.h.

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

int vpMeSite::mask_sign

Definition at line 102 of file vpMeSite.h.

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

double vpMeSite::normGradient

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

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

unsigned char vpMeSite::v

Definition at line 101 of file vpMeSite.h.

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

double vpMeSite::weight

Definition at line 110 of file vpMeSite.h.

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