Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpMeTracker Class Referenceabstract

#include <vpMeTracker.h>

Inheritance diagram for vpMeTracker:

Public Member Functions

 vpMeTracker ()
 vpMeTracker (const vpMeTracker &meTracker)
virtual ~vpMeTracker () VP_OVERRIDE
Public Member Functions Inherited from vpTracker
vpColVector get_p () const
vpColVector get_cP () const

Static Public Member Functions

Deprecated functions
static VP_DEPRECATED bool inMask (const vpImage< bool > *mask, unsigned int i, unsigned int j)

Public Attributes

Public Attributes Inherited from vpTracker
vpColVector p
vpColVector cP
bool cPAvailable

Protected Attributes

Protected Attributes Inherited from vpMeTracker
std::list< vpMeSitem_meList
vpMem_me
int m_nGoodElement
const vpImage< bool > * m_mask
const vpImage< bool > * m_maskCandidates
vpMeSite::vpMeSiteDisplayType m_selectDisplay

Public Member Functions Inherited from vpMeTracker

void display (const vpImage< unsigned char > &I)
void display (const vpImage< vpRGBa > &I)
void display (const vpImage< unsigned char > &I, vpColVector &w, unsigned int &index_w)
vpMegetMe ()
std::list< vpMeSite > & getMeList ()
std::list< vpMeSitegetMeList () const
int getNbPoints () const
void init ()
void initTracking (const vpImage< unsigned char > &I)
unsigned int numberOfSignal ()
vpMeTrackeroperator= (vpMeTracker &meTracker)
bool outOfImage (int i, int j, int border, int nrows, int ncols)
bool outOfImage (const vpImagePoint &iP, int border, int nrows, int ncols)
void reset ()
virtual void sample (const vpImage< unsigned char > &image, bool doNotTrack=false)=0
void setDisplay (vpMeSite::vpMeSiteDisplayType select)
virtual void setMask (const vpImage< bool > &mask)
virtual void setMaskCandidates (const vpImage< bool > *maskCandidates)
void setMe (vpMe *me)
void setMeList (const std::list< vpMeSite > &meList)
unsigned int totalNumberOfSignal ()
void track (const vpImage< unsigned char > &I)
static bool inRoiMask (const vpImage< bool > *mask, unsigned int i, unsigned int j)
static bool inMeMaskCandidates (const vpImage< bool > *meMaskCandidates, unsigned int i, unsigned int j)

Detailed Description

Contains abstract elements for a Distance to Feature type feature.

2D state = list of points, 3D state = feature

Tutorials & Examples

Tutorials
If you are interested in using a ME tracker in your application, you may have a look at:

Definition at line 68 of file vpMeTracker.h.

Constructor & Destructor Documentation

◆ vpMeTracker() [1/2]

vpMeTracker::vpMeTracker ( )

◆ vpMeTracker() [2/2]

vpMeTracker::vpMeTracker ( const vpMeTracker & meTracker)

Copy constructor.

Definition at line 62 of file vpMeTracker.cpp.

References init(), m_mask, m_maskCandidates, m_me, m_meList, m_nGoodElement, m_selectDisplay, vpMeTracker(), and vpTracker::vpTracker().

◆ ~vpMeTracker()

vpMeTracker::~vpMeTracker ( )
virtual

Destructor.

Definition at line 79 of file vpMeTracker.cpp.

References reset().

Member Function Documentation

◆ display() [1/3]

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

Display the moving edge sites 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
[in]I: The image.

Definition at line 252 of file vpMeTracker.cpp.

References vpMeSite::display(), and m_meList.

Referenced by display(), vpMeEllipse::initTracking(), vpMeEllipse::initTracking(), and vpMeLine::track().

◆ display() [2/3]

void vpMeTracker::display ( const vpImage< unsigned char > & I,
vpColVector & w,
unsigned int & index_w )

Displays the status of moving edge sites

Parameters
[in]I: The image.
[in]w: vector
[in]index_w: index

Definition at line 270 of file vpMeTracker.cpp.

References display(), vpMeSite::getState(), m_meList, vpMeSite::NO_SUPPRESSION, and vpMeSite::setWeight().

◆ display() [3/3]

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

Display the moving edge sites 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
[in]I: The image.

Definition at line 261 of file vpMeTracker.cpp.

References vpMeSite::display(), and m_meList.

◆ get_cP()

vpColVector vpTracker::get_cP ( ) const
inlineinherited

Return object parameters expressed in the 3D camera frame.

Definition at line 95 of file vpTracker.h.

References cP.

◆ get_p()

vpColVector vpTracker::get_p ( ) const
inlineinherited

Return object parameters expressed in the 2D image plane computed by perspective projection.

Definition at line 93 of file vpTracker.h.

References p.

◆ getMe()

vpMe * vpMeTracker::getMe ( )
inline

Return the moving edges initialisation parameters.

Returns
Moving Edges.
Examples
trackMeCircle.cpp, trackMeEllipse.cpp, and trackMeLine.cpp.

Definition at line 153 of file vpMeTracker.h.

References m_me.

◆ getMeList() [1/2]

std::list< vpMeSite > & vpMeTracker::getMeList ( )
inline

Return the list of moving edges

Returns
List of Moving Edges.

Definition at line 160 of file vpMeTracker.h.

References m_meList.

◆ getMeList() [2/2]

std::list< vpMeSite > vpMeTracker::getMeList ( ) const
inline

Return the list of moving edges

Returns
List of Moving Edges.

Definition at line 167 of file vpMeTracker.h.

References m_meList.

◆ getNbPoints()

int vpMeTracker::getNbPoints ( ) const
inline

Return the number of points that has not been suppressed.

Returns
Number of good points.

Definition at line 174 of file vpMeTracker.h.

References m_nGoodElement.

◆ init()

BEGIN_VISP_NAMESPACE void vpMeTracker::init ( )

Initialize the tracker.

Definition at line 48 of file vpMeTracker.cpp.

References vpTracker::init(), m_selectDisplay, vpMeSite::NONE, and vpTracker::p.

Referenced by vpMeTracker(), and vpMeTracker().

◆ initTracking()

void vpMeTracker::initTracking ( const vpImage< unsigned char > & I)

◆ inMask()

VP_DEPRECATED bool vpMeTracker::inMask ( const vpImage< bool > * mask,
unsigned int i,
unsigned int j )
inlinestatic
Deprecated
You should rather use inRoiMask(). Test whether the pixel is inside the region of interest mask. Mask values that are set to true are considered in the tracking.
Parameters
[in]mask: Mask corresponding to the region of interest in the image or nullptr if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false.
[in]i: Pixel coordinate along the rows.
[in]j: Pixel coordinate along the columns.

Definition at line 294 of file vpMeTracker.h.

References inRoiMask().

◆ inMeMaskCandidates()

bool vpMeTracker::inMeMaskCandidates ( const vpImage< bool > * meMaskCandidates,
unsigned int i,
unsigned int j )
static

Test whether the moving-edge (ME) is inside the mask of ME candidates for the initialization. Mask values that are set to true and their 8 neighbors are considered for the initialization.

Parameters
[in]meMaskCandidates: Mask corresponding the ME location in the image or nullptr if not wanted. Mask values that are set to true are considered for the initialization. To disable a pixel, set false.
[in]i: ME coordinate along the rows.
[in]j: ME coordinate along the columns.

Definition at line 113 of file vpMeTracker.cpp.

References vpImage< Type >::getCols(), and vpImage< Type >::getRows().

Referenced by vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().

◆ inRoiMask()

bool vpMeTracker::inRoiMask ( const vpImage< bool > * mask,
unsigned int i,
unsigned int j )
static

Test whether the pixel is inside the region of interest mask. Mask values that are set to true are considered in the tracking.

Parameters
[in]mask: Mask corresponding to the region of interest in the image or nullptr if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false.
[in]i: Pixel coordinate along the rows.
[in]j: Pixel coordinate along the columns.

Definition at line 103 of file vpMeTracker.cpp.

References vpImage< Type >::getValue().

Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtDistanceKltPoints::computeNbDetectedCurrent(), vpMbtDistanceKltPoints::init(), inMask(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and track().

◆ numberOfSignal()

unsigned int vpMeTracker::numberOfSignal ( )

◆ operator=()

vpMeTracker & vpMeTracker::operator= ( vpMeTracker & meTracker)

Copy operator.

Definition at line 81 of file vpMeTracker.cpp.

References m_me, m_meList, m_nGoodElement, m_selectDisplay, and vpMeTracker().

◆ outOfImage() [1/2]

bool vpMeTracker::outOfImage ( const vpImagePoint & iP,
int border,
int nrows,
int ncols )

Check if a pixel i,j is out of the image.

Parameters
[in]iP: Pixel coordinates.
[in]border: Number of pixels along the image border to exclude. When border is set to 0, consider the complete image.
[in]nrows: Image number of rows.
[in]ncols: Image number of cols.
Returns
true when the pixel is inside the image minus the border size, false otherwise.

Definition at line 172 of file vpMeTracker.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().

◆ outOfImage() [2/2]

bool vpMeTracker::outOfImage ( int i,
int j,
int border,
int nrows,
int ncols )

Check if a pixel i,j is out of the image.

Parameters
[in]i: Pixel coordinate along the image rows.
[in]j: Pixel coordinates along the image columns.
[in]border: Number of pixels along the image border to exclude. When border is set to 0, consider the complete image.
[in]nrows: Image number of rows.
[in]ncols: Image number of cols.
Returns
true when the pixel is inside the image minus the border size, false otherwise.

Definition at line 164 of file vpMeTracker.cpp.

Referenced by vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), and vpMeNurbs::seekExtremities().

◆ reset()

void vpMeTracker::reset ( )

Reset the tracker by removing all the moving edges.

Definition at line 73 of file vpMeTracker.cpp.

References m_meList, and m_nGoodElement.

Referenced by ~vpMeTracker().

◆ sample()

virtual void vpMeTracker::sample ( const vpImage< unsigned char > & image,
bool doNotTrack = false )
pure virtual

Sample pixels at a given interval.

Implemented in vpMeEllipse, vpMeLine, and vpMeNurbs.

◆ setDisplay()

void vpMeTracker::setDisplay ( vpMeSite::vpMeSiteDisplayType select)
inline

Set type of moving-edges display.

Parameters
select: Display type selector.
Examples
servoAfma6Line2DCamVelocity.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-me-ellipse-tracker.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 234 of file vpMeTracker.h.

References m_selectDisplay.

◆ setMask()

virtual void vpMeTracker::setMask ( const vpImage< bool > & mask)
inlinevirtual

Set the mask.

Parameters
mask: Mask.

Definition at line 241 of file vpMeTracker.h.

References m_mask.

◆ setMaskCandidates()

virtual void vpMeTracker::setMaskCandidates ( const vpImage< bool > * maskCandidates)
inlinevirtual

Set the mask of candidates points for initialization.

Parameters
[in]maskCandidates: Pointer towards the mask of candidates points for initialization.

Definition at line 248 of file vpMeTracker.h.

References m_maskCandidates.

◆ setMe()

void vpMeTracker::setMe ( vpMe * me)
inline

Set the moving edges initialisation parameters.

Parameters
[in]me: Moving Edges.
Examples
servoAfma62DhalfCamVelocity.cpp, servoAfma6Line2DCamVelocity.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-me-ellipse-tracker.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 255 of file vpMeTracker.h.

References m_me.

◆ setMeList()

void vpMeTracker::setMeList ( const std::list< vpMeSite > & meList)
inline

Set the list of moving edges.

Parameters
[in]meList: List of Moving Edges.

Definition at line 262 of file vpMeTracker.h.

References m_meList.

◆ totalNumberOfSignal()

unsigned int vpMeTracker::totalNumberOfSignal ( )

Return the total number of moving-edges.

Definition at line 101 of file vpMeTracker.cpp.

References m_meList.

◆ track()

void vpMeTracker::track ( const vpImage< unsigned char > & I)

Member Data Documentation

◆ cP

◆ cPAvailable

bool vpTracker::cPAvailable
inherited

Flag used to indicate if the feature parameters cP expressed in the camera frame are available.

Definition at line 79 of file vpTracker.h.

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

◆ m_mask

const vpImage<bool>* vpMeTracker::m_mask
protected

Mask used to disable tracking on a part of image.

Definition at line 312 of file vpMeTracker.h.

Referenced by vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), setMask(), track(), vpMeTracker(), and vpMeTracker().

◆ m_maskCandidates

const vpImage<bool>* vpMeTracker::m_maskCandidates
protected

Mask used to determine candidate points for initialization in an image.

Definition at line 314 of file vpMeTracker.h.

Referenced by vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), setMaskCandidates(), vpMeTracker(), and vpMeTracker().

◆ m_me

◆ m_meList

◆ m_nGoodElement

int vpMeTracker::m_nGoodElement
protected

Number of good moving-edges that are tracked.

Definition at line 310 of file vpMeTracker.h.

Referenced by getNbPoints(), initTracking(), operator=(), reset(), track(), vpMeTracker(), and vpMeTracker().

◆ m_selectDisplay

◆ p

vpColVector vpTracker::p
inherited

Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.

Definition at line 69 of file vpTracker.h.

Referenced by vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpCircle::display(), vpCircle::display(), vpCylinder::display(), vpCylinder::display(), vpLine::display(), vpLine::display(), vpPoint::display(), vpPoint::display(), vpSphere::display(), vpSphere::display(), vpFeatureDisplay::displayEllipse(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpCircle::get_mu02(), vpSphere::get_mu02(), vpCircle::get_mu11(), vpSphere::get_mu11(), vpCircle::get_mu20(), vpSphere::get_mu20(), vpCircle::get_n02(), vpSphere::get_n02(), vpCircle::get_n11(), vpSphere::get_n11(), vpCircle::get_n20(), vpSphere::get_n20(), get_p(), vpPoint::get_w(), vpCircle::get_x(), vpPoint::get_x(), vpSphere::get_x(), vpCircle::get_y(), vpPoint::get_y(), vpSphere::get_y(), vpLine::getRho(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpLine::getTheta(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpMeTracker::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpForwardProjection::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), vpPoint::set_y(), vpLine::setRho(), vpLine::setTheta(), vpTracker(), and vpTracker().