Visual Servoing Platform
version 3.6.1 under development (2024-11-21)
|
#include <visp3/me/vpMeTracker.h>
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 |
Public Attributes | |
Public Attributes Inherited from vpTracker | |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Protected Attributes | |
Protected Attributes Inherited from vpMeTracker | |
std::list< vpMeSite > | m_meList |
vpMe * | m_me |
unsigned int | m_init_range |
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) |
unsigned int | getInitRange () |
vpMe * | getMe () |
std::list< vpMeSite > & | getMeList () |
std::list< vpMeSite > | getMeList () const |
int | getNbPoints () const |
void | init () |
void | initTracking (const vpImage< unsigned char > &I) |
unsigned int | numberOfSignal () |
vpMeTracker & | operator= (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) |
void | setInitRange (const unsigned int &r) |
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) |
Contains abstract elements for a Distance to Feature type feature.
2D state = list of points, 3D state = feature
Definition at line 61 of file vpMeTracker.h.
vpMeTracker::vpMeTracker | ( | ) |
vpMeTracker::vpMeTracker | ( | const vpMeTracker & | meTracker | ) |
Copy constructor.
Definition at line 62 of file vpMeTracker.cpp.
References init(), m_init_range, m_me, m_meList, m_nGoodElement, and m_selectDisplay.
|
virtual |
void vpMeTracker::display | ( | const vpImage< unsigned char > & | I | ) |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Definition at line 254 of file vpMeTracker.cpp.
References vpMeSite::display(), and m_meList.
Referenced by display(), vpMeEllipse::initTracking(), and vpMeLine::track().
void vpMeTracker::display | ( | const vpImage< unsigned char > & | I, |
vpColVector & | w, | ||
unsigned int & | index_w | ||
) |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 272 of file vpMeTracker.cpp.
References display(), vpMeSite::getState(), m_meList, vpMeSite::NO_SUPPRESSION, and vpMeSite::setWeight().
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Definition at line 263 of file vpMeTracker.cpp.
References vpMeSite::display(), and m_meList.
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 95 of file vpTracker.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 93 of file vpTracker.h.
|
inline |
|
inline |
Return the moving edges initialisation parameters.
Definition at line 153 of file vpMeTracker.h.
|
inline |
Return the list of moving edges
Definition at line 160 of file vpMeTracker.h.
|
inline |
Return the list of moving edges
Definition at line 167 of file vpMeTracker.h.
|
inline |
Return the number of points that has not been suppressed.
Definition at line 174 of file vpMeTracker.h.
BEGIN_VISP_NAMESPACE void vpMeTracker::init | ( | void | ) |
Initialize the tracker.
Definition at line 48 of file vpMeTracker.cpp.
References vpTracker::init(), m_selectDisplay, vpMeSite::NONE, vpTracker::p, and vpColVector::resize().
Referenced by vpMeTracker().
void vpMeTracker::initTracking | ( | const vpImage< unsigned char > & | I | ) |
Virtual function that is called by lower classes vpMeEllipse, vpMeLine and vpMeNurbs.
vpTrackingException::initializationError | : Moving edges not initialized. |
Definition at line 182 of file vpMeTracker.cpp.
References vpMe::getRange(), vpMeSite::getState(), vpTrackingException::initializationError, m_init_range, m_me, m_meList, m_nGoodElement, vpMeSite::NO_SUPPRESSION, vpMe::setRange(), and vpMeSite::track().
Referenced by vpMeNurbs::initTracking(), vpMeLine::initTracking(), vpMeLine::reSample(), vpMeNurbs::reSample(), and vpMeEllipse::sample().
|
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.
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. |
i | : ME coordinate along the rows. |
j | : ME coordinate along the columns. |
Definition at line 115 of file vpMeTracker.cpp.
References vpImage< Type >::getCols(), and vpImage< Type >::getRows().
Referenced by vpMeEllipse::sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().
|
static |
Test whether the pixel is inside the region of interest mask. Mask values that are set to true are considered in the tracking.
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. |
i | : Pixel coordinate along the rows. |
j | : Pixel coordinate along the columns. |
Definition at line 105 of file vpMeTracker.cpp.
References vpImage< Type >::getValue().
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMeEllipse::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and track().
unsigned int vpMeTracker::numberOfSignal | ( | ) |
Return number of moving-edges that are tracked.
Definition at line 94 of file vpMeTracker.cpp.
References m_meList.
Referenced by vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), vpMeNurbs::localReSample(), vpMeLine::reSample(), and vpMeNurbs::reSample().
vpMeTracker & vpMeTracker::operator= | ( | vpMeTracker & | meTracker | ) |
Copy operator.
Definition at line 82 of file vpMeTracker.cpp.
References m_init_range, m_me, m_meList, m_nGoodElement, and m_selectDisplay.
bool vpMeTracker::outOfImage | ( | const vpImagePoint & | iP, |
int | border, | ||
int | nrows, | ||
int | ncols | ||
) |
Check if a pixel i,j is out of the image.
[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,ncols | : Size of the image. |
Definition at line 174 of file vpMeTracker.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().
bool vpMeTracker::outOfImage | ( | int | i, |
int | j, | ||
int | border, | ||
int | nrows, | ||
int | ncols | ||
) |
Check if a pixel i,j is out of the image.
[in] | i,j | : 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,ncols | : Size of the image. |
Definition at line 166 of file vpMeTracker.cpp.
Referenced by vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and vpMeNurbs::seekExtremities().
void vpMeTracker::reset | ( | ) |
Reset the tracker by removing all the moving edges.
Definition at line 74 of file vpMeTracker.cpp.
References m_meList, and m_nGoodElement.
Referenced by ~vpMeTracker().
|
pure virtual |
Sample pixels at a given interval.
Implemented in vpMeLine, vpMeEllipse, and vpMeNurbs.
|
inline |
Set type of moving-edges display.
select | : Display type selector. |
Definition at line 232 of file vpMeTracker.h.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Set the mask of candidates points for initialization.
maskCandidates | : Pointer towards the mask of candidates points for initialization. |
Definition at line 253 of file vpMeTracker.h.
|
inline |
Set the moving edges initialisation parameters.
me | : Moving Edges. |
Definition at line 260 of file vpMeTracker.h.
|
inline |
Set the list of moving edges.
meList | : List of Moving Edges. |
Definition at line 267 of file vpMeTracker.h.
unsigned int vpMeTracker::totalNumberOfSignal | ( | ) |
Return the total number of moving-edges.
Definition at line 103 of file vpMeTracker.cpp.
References m_meList.
void vpMeTracker::track | ( | const vpImage< unsigned char > & | I | ) |
Track moving-edges.
I | : Image. |
vpTrackingException::initializationError | : Moving edges not initialized. |
Definition at line 215 of file vpMeTracker.cpp.
References vpMeSite::get_i(), vpMeSite::get_j(), vpMeSite::getState(), vpTrackingException::initializationError, inRoiMask(), m_mask, m_me, m_meList, m_nGoodElement, vpMeSite::NO_SUPPRESSION, vpTrackingException::notEnoughPointError, vpMeSite::OUTSIDE_ROI_MASK, vpMeSite::setState(), and vpMeSite::track().
Referenced by vpMeEllipse::track(), vpMeLine::track(), and vpMeNurbs::track().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 73 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), and vpPoint::set_Z().
|
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 vpTracker::init(), and vpTracker::operator=().
|
protected |
Initial range.
Definition at line 315 of file vpMeTracker.h.
Referenced by initTracking(), operator=(), and vpMeTracker().
|
protected |
Mask used to disable tracking on a part of image.
Definition at line 319 of file vpMeTracker.h.
Referenced by vpMeEllipse::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and track().
|
protected |
Mask used to determine candidate points for initialization in an image.
Definition at line 321 of file vpMeTracker.h.
Referenced by vpMeEllipse::sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().
|
protected |
Moving edges initialisation parameters.
Definition at line 313 of file vpMeTracker.h.
Referenced by initTracking(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::localReSample(), operator=(), vpMeEllipse::plugHoles(), vpMeLine::reSample(), vpMeNurbs::reSample(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeNurbs::supressNearPoints(), track(), and vpMeTracker().
|
protected |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 311 of file vpMeTracker.h.
Referenced by display(), vpMeLine::display(), initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::leastSquareRobustCircle(), vpMeEllipse::leastSquareRobustEllipse(), vpMeNurbs::localReSample(), numberOfSignal(), operator=(), vpMeEllipse::plugHoles(), reset(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), vpMeNurbs::suppressPoints(), vpMeNurbs::supressNearPoints(), totalNumberOfSignal(), vpMeNurbs::track(), track(), vpMeLine::updateDelta(), vpMeNurbs::updateDelta(), vpMeEllipse::updateTheta(), vpMeTracker(), vpMeEllipse::~vpMeEllipse(), and vpMeLine::~vpMeLine().
|
protected |
Number of good moving-edges that are tracked.
Definition at line 317 of file vpMeTracker.h.
Referenced by initTracking(), operator=(), reset(), track(), and vpMeTracker().
|
protected |
Moving-edges display type.
Definition at line 323 of file vpMeTracker.h.
Referenced by init(), vpMeNurbs::localReSample(), operator=(), vpMeEllipse::plugHoles(), vpMeNurbs::sample(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), and vpMeTracker().
|
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 vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpCircle::display(), vpCylinder::display(), vpLine::display(), vpPoint::display(), vpSphere::display(), vpProjectionDisplay::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), init(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().