Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches

#include <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)
vpMeSitegetQueryList (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
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
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)

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 probability 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 64 of file vpMeSite.h.

Member Enumeration Documentation

◆ vpMeSiteDisplayType

Type moving-edges site of display.

Enumerator
NONE 

Not displayed.

RANGE 
RESULT 
RANGE_RESULT 

Definition at line 70 of file vpMeSite.h.

◆ vpMeSiteState

Moving-edge site state

Enumerator
NO_SUPPRESSION 

Point used by the tracker.

CONTRAST 

Point removed due to a contrast problem.

CONSTRAST 

Point removed due to a contrast problem.

THRESHOLD 

Point removed due to a threshold problem.

M_ESTIMATOR 

Point removed during virtual visual-servoing because considered as an outlier.

TOO_NEAR 

Point removed because too near image borders.

UNKNOW 

Reserved.

Definition at line 81 of file vpMeSite.h.

Constructor & Destructor Documentation

◆ vpMeSite() [1/3]

vpMeSite::vpMeSite ( )

Default constructor.

Definition at line 85 of file vpMeSite.cpp.

References alpha, convlt, i, ifloat, j, jfloat, mask_sign, NO_SUPPRESSION, NONE, normGradient, suppress, and weight.

Referenced by distance(), getQueryList(), operator!=(), operator<<, operator=(), sqrDistance(), track(), and vpMeSite().

◆ vpMeSite() [2/3]

vpMeSite::vpMeSite ( double ip,
double jp )

Constructor from pixel coordinates.

Definition at line 94 of file vpMeSite.cpp.

References alpha, convlt, i, ifloat, j, jfloat, mask_sign, NO_SUPPRESSION, NONE, normGradient, vpMath::round(), suppress, and weight.

◆ vpMeSite() [3/3]

vpMeSite::vpMeSite ( const vpMeSite & mesite)

Copy constructor.

Definition at line 108 of file vpMeSite.cpp.

References alpha, convlt, i, ifloat, j, jfloat, mask_sign, NO_SUPPRESSION, NONE, normGradient, suppress, vpMeSite(), and weight.

◆ ~vpMeSite()

virtual vpMeSite::~vpMeSite ( )
inlinevirtual

Destructor.

Definition at line 157 of file vpMeSite.h.

Member Function Documentation

◆ convolution()

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

Compute convolution.

Definition at line 253 of file vpMeSite.cpp.

References alpha, vpMe::getAngleStep(), vpMe::getMask(), vpMe::getMaskSize(), vpMe::getStrip(), i, j, mask_sign, and vpMath::round().

Referenced by track().

◆ display() [1/4]

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

Display moving edges in image I.

Parameters
I: Input image.

Definition at line 415 of file vpMeSite.cpp.

References display(), ifloat, and jfloat.

Referenced by display(), display(), vpMeTracker::display(), and vpMeTracker::display().

◆ display() [2/4]

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 (contrast 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 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() [3/4]

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

Display moving edges in image I.

Parameters
I: Input image.

Definition at line 417 of file vpMeSite.cpp.

References display(), ifloat, and jfloat.

◆ display() [4/4]

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

◆ distance()

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

Compute the square root distance between two moving-edges sites $ |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.
See also
sqrDistance()

Definition at line 304 of file vpMeSite.h.

References sqrDistance(), and vpMeSite().

◆ get_i()

int vpMeSite::get_i ( ) const
inline

Get the i coordinate (integer).

Returns
value of i

Definition at line 217 of file vpMeSite.h.

References i.

◆ get_ifloat()

double vpMeSite::get_ifloat ( ) const
inline

Get the i coordinate (double).

Returns
value of i

Definition at line 231 of file vpMeSite.h.

References ifloat.

Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), and vpMbtDistanceLine::getFeaturesForDisplay().

◆ get_j()

int vpMeSite::get_j ( ) const
inline

Get the j coordinate (f).

Returns
value of j

Definition at line 224 of file vpMeSite.h.

References j.

◆ get_jfloat()

double vpMeSite::get_jfloat ( ) const
inline

Get the j coordinate (double).

Returns
value of j

Definition at line 238 of file vpMeSite.h.

References jfloat.

Referenced by vpMbtDistanceCircle::getFeaturesForDisplay(), vpMbtDistanceCylinder::getFeaturesForDisplay(), and vpMbtDistanceLine::getFeaturesForDisplay().

◆ getAlpha()

double vpMeSite::getAlpha ( ) const
inline

Get the angle of tangent at site.

Returns
value of alpha

Definition at line 205 of file vpMeSite.h.

References alpha.

◆ 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 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(), vpMeSite(), 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 228 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 275 of file vpMeSite.h.

References weight.

◆ init() [1/4]

◆ init() [2/4]

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

◆ init() [3/4]

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

Initialize moving-edge site parameters.

Definition at line 135 of file vpMeSite.cpp.

References alpha, convlt, i, ifloat, j, jfloat, mask_sign, and NONE.

◆ init() [4/4]

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

Initialize moving-edge site parameters.

Definition at line 148 of file vpMeSite.cpp.

References alpha, convlt, i, ifloat, j, jfloat, mask_sign, and NONE.

◆ operator!=()

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

Comparison operator.

Definition at line 403 of file vpMeSite.cpp.

References i, j, and vpMeSite().

◆ operator=()

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

Copy operator.

Definition at line 160 of file vpMeSite.cpp.

References alpha, convlt, i, ifloat, j, jfloat, mask_sign, normGradient, suppress, vpMeSite(), 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 198 of file vpMeSite.h.

References alpha.

◆ 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 268 of file vpMeSite.h.

References weight.

◆ sqrDistance()

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

Compute the square distance between two moving-edges sites $ |S1 - S2| = (i_1-i_2)^2+(j_1-j_2)^2 $

Parameters
S1: First site
S2: Second site
Returns
The square distance between the two sites.
See also
distance()

Definition at line 320 of file vpMeSite.h.

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

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

◆ track()

◆ operator<<

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

ostream operator.

Definition at line 405 of file vpMeSite.cpp.

References alpha, convlt, operator<<, suppress, vpMeSite(), and weight.

Referenced by operator<<.

Member Data Documentation

◆ alpha

◆ convlt

double vpMeSite::convlt

Convolution of Site in previous image.

Definition at line 108 of file vpMeSite.h.

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

◆ i

◆ ifloat

◆ j

◆ jfloat

◆ mask_sign

int vpMeSite::mask_sign

◆ normGradient

double vpMeSite::normGradient

Convolution of Site in previous image.

Definition at line 110 of file vpMeSite.h.

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

◆ 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 366 of file vpMeSite.h.

Referenced by init(), operator<<, operator=(), setState(), vpMeSite(), vpMeSite(), and vpMeSite().

◆ weight

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(), getWeight(), init(), operator<<, operator=(), setWeight(), vpMeSite(), vpMeSite(), and vpMeSite().