Visual Servoing Platform
version 3.1.0
|
#include <visp3/me/vpMeNurbs.h>
Public Member Functions | |
vpMeNurbs () | |
vpMeNurbs (const vpMeNurbs &menurbs) | |
virtual | ~vpMeNurbs () |
void | setNbControlPoints (const unsigned int nb_point) |
void | setEnableCannyDetection (const bool enable_canny) |
void | setCannyThreshold (const double th1, const double th2) |
void | initTracking (const vpImage< unsigned char > &I) |
void | initTracking (const vpImage< unsigned char > &I, const std::list< vpImagePoint > &ptList) |
void | track (const vpImage< unsigned char > &Im) |
void | sample (const vpImage< unsigned char > &image) |
void | reSample (const vpImage< unsigned char > &I) |
void | updateDelta () |
void | setExtremities () |
void | seekExtremities (const vpImage< unsigned char > &I) |
void | seekExtremitiesCanny (const vpImage< unsigned char > &I) |
void | suppressPoints () |
void | supressNearPoints () |
void | localReSample (const vpImage< unsigned char > &I) |
vpNurbs | getNurbs () const |
void | display (const vpImage< unsigned char > &I, vpColor col) |
void | init () |
unsigned int | numberOfSignal () |
unsigned int | totalNumberOfSignal () |
virtual void | display (const vpImage< unsigned char > &I) |
void | display (const vpImage< unsigned char > &I, vpColVector &w, unsigned int &index_w) |
void | setDisplay (vpMeSite::vpMeSiteDisplayType select) |
int | outOfImage (int i, int j, int half, int row, int cols) |
int | outOfImage (const vpImagePoint &iP, int half, int rows, int cols) |
void | reset () |
void | setInitRange (const unsigned int &r) |
unsigned int | getInitRange () |
void | setMe (vpMe *p_me) |
vpMe * | getMe () |
void | setMeList (const std::list< vpMeSite > &l) |
std::list< vpMeSite > & | getMeList () |
std::list< vpMeSite > | getMeList () const |
int | getNbPoints () const |
Static Public Member Functions | |
static void | display (const vpImage< unsigned char > &I, vpNurbs &n, vpColor color=vpColor::green) |
static void | display (const vpImage< vpRGBa > &I, vpNurbs &n, vpColor color=vpColor::green) |
Public Attributes | |
vpNurbs | nurbs |
std::list< vpMeSite > | list |
vpMe * | me |
unsigned int | init_range |
int | nGoodElement |
int | query_range |
bool | display_point |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Protected Attributes | |
vpMeSite::vpMeSiteDisplayType | selectDisplay |
Class that tracks in an image a edge defined by a Nurbs.
The advantage of this class is that it enables to track an edge whose equation is not known in advance. At each iteration, the Nurbs corresponding to the edge is computed.
It is possible to have a direct access to the nurbs. It is indeed a public parameter.
The code below shows how to use this class.
Definition at line 130 of file vpMeNurbs.h.
vpMeNurbs::vpMeNurbs | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 215 of file vpMeNurbs.cpp.
vpMeNurbs::vpMeNurbs | ( | const vpMeNurbs & | menurbs | ) |
Copy constructor.
Definition at line 224 of file vpMeNurbs.cpp.
|
virtual |
Basic destructor.
Definition at line 240 of file vpMeNurbs.cpp.
|
virtualinherited |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Reimplemented in vpMeEllipse.
Definition at line 301 of file vpMeTracker.cpp.
References vpMeSite::display(), and vpMeTracker::list.
|
inherited |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 321 of file vpMeTracker.cpp.
References vpMeTracker::display(), vpMeSite::getState(), vpMeTracker::list, vpMeSite::NO_SUPPRESSION, and vpMeSite::weight.
Display edge.
I | : Image in which the edge appears. |
col | : Color of the displayed line. |
Implements vpMeTracker.
Definition at line 1027 of file vpMeNurbs.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), nurbs, vpMath::round(), and vpImagePoint::set_ij().
|
static |
Display of a moving nurbs.
I | : The image used as background. |
n | : Nurbs to display |
color | : Color used to display the nurbs. |
Definition at line 1243 of file vpMeNurbs.cpp.
References vpNurbs::computeCurvePoint(), and vpDisplay::displayCross().
|
static |
Display of a moving nurbs.
I | : The image used as background. |
n | : Nurbs to display |
color | : Color used to display the nurbs. |
Definition at line 1264 of file vpMeNurbs.cpp.
References vpNurbs::computeCurvePoint(), and vpDisplay::displayCross().
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters
Definition at line 140 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 154 of file vpMeTracker.h.
|
inlineinherited |
Definition at line 155 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 162 of file vpMeTracker.h.
|
inline |
Gets the nurbs;
Definition at line 210 of file vpMeNurbs.h.
References vpMeTracker::display(), and vpColor::green.
|
inherited |
Definition at line 55 of file vpMeTracker.cpp.
References vpTracker::init(), vpMeSite::NONE, vpTracker::p, vpColVector::resize(), and vpMeTracker::selectDisplay.
Referenced by vpMeTracker::vpMeTracker().
void vpMeNurbs::initTracking | ( | const vpImage< unsigned char > & | I | ) |
Initialization of the tracking. Ask the user to click left on several points along the edge to track and click right at the end.
I | : Image in which the edge appears. |
Definition at line 248 of file vpMeNurbs.cpp.
References vpMouseButton::button1, vpMouseButton::button3, vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), vpColor::green, and vpException::notInitialized.
void vpMeNurbs::initTracking | ( | const vpImage< unsigned char > & | I, |
const std::list< vpImagePoint > & | ptList | ||
) |
Initialization of the tracking. The Nurbs is initialized thanks to the list of vpImagePoint.
I | : Image in which the edge appears. |
ptList | : List of point to initialize the Nurbs. |
Definition at line 277 of file vpMeNurbs.cpp.
References vpNurbs::globalCurveInterp(), vpMeTracker::initTracking(), nurbs, sample(), and track().
void vpMeNurbs::localReSample | ( | const vpImage< unsigned char > & | I | ) |
Resample a part of the edge if two vpMeSite are too far from eachother. In this case the method try to initialize any vpMeSite between the two points.
I | : Image in which the edge appears. |
Definition at line 830 of file vpMeNurbs.cpp.
References vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpImage< Type >::getHeight(), vpMe::getPointsToTrack(), vpMe::getRange(), vpMe::getSampleStep(), vpMeSite::getState(), vpImage< Type >::getWidth(), vpMeSite::ifloat, vpMeSite::init(), vpMeSite::jfloat, vpMeTracker::list, vpMath::maximum(), vpMeSite::NO_SUPPRESSION, vpMeTracker::numberOfSignal(), nurbs, vpMeTracker::outOfImage(), vpMeTracker::selectDisplay, vpMeSite::setDisplay(), vpMe::setRange(), vpMath::sqr(), vpMeSite::sqrDistance(), vpImagePoint::sqrDistance(), and vpMeSite::track().
Referenced by track().
|
inherited |
Definition at line 120 of file vpMeTracker.cpp.
References vpMeTracker::list.
Referenced by vpMeLine::leastSquare(), localReSample(), vpMeEllipse::printParameters(), vpMeLine::reSample(), reSample(), and vpMeEllipse::~vpMeEllipse().
|
inherited |
Definition at line 131 of file vpMeTracker.cpp.
Referenced by localReSample(), vpMeEllipse::printParameters(), vpMeLine::sample(), sample(), vpMeLine::seekExtremities(), seekExtremities(), and vpMeEllipse::~vpMeEllipse().
|
inherited |
Definition at line 136 of file vpMeTracker.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().
void vpMeNurbs::reSample | ( | const vpImage< unsigned char > & | I | ) |
Resample the edge if the number of sample is less than 70% of the expected value.
I | : Image in which the edge appears. |
Definition at line 812 of file vpMeNurbs.cpp.
References vpMe::getSampleStep(), vpMeTracker::initTracking(), vpMeTracker::numberOfSignal(), and sample().
Referenced by track().
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 96 of file vpMeTracker.cpp.
References vpMeTracker::list, and vpMeTracker::nGoodElement.
Referenced by vpMeTracker::~vpMeTracker().
|
virtual |
Construct a list of vpMeSite moving edges at a particular sampling step between the two extremities of the nurbs.
I | : Image in which the edge appears. |
Implements vpMeTracker.
Definition at line 293 of file vpMeNurbs.cpp.
References vpNurbs::computeCurveDersPoint(), vpImage< Type >::getHeight(), vpMe::getPointsToTrack(), vpMe::getSampleStep(), vpImage< Type >::getWidth(), vpMeSite::init(), vpMeTracker::list, nurbs, vpMeTracker::outOfImage(), vpMeTracker::selectDisplay, vpMeSite::setDisplay(), vpMath::sqr(), and vpImagePoint::sqrDistance().
Referenced by initTracking(), and reSample().
void vpMeNurbs::seekExtremities | ( | const vpImage< unsigned char > & | I | ) |
Seek along the edge defined by the nurbs, the two extremities of the edge. This function is useful in case of translation of the edge.
I | : Image in which the edge appears. |
Definition at line 394 of file vpMeNurbs.cpp.
References vpMath::abs(), vpColor::blue, vpNurbs::computeCurveDersPoint(), vpDisplay::displayCross(), vpImagePoint::distance(), vpImage< Type >::getHeight(), vpMe::getRange(), vpMe::getSampleStep(), vpMeSite::getState(), vpImage< Type >::getWidth(), vpMeSite::i, vpMeSite::ifloat, vpMeSite::init(), vpMeSite::j, vpMeSite::jfloat, vpMeTracker::list, vpMeSite::NO_SUPPRESSION, nurbs, vpMeTracker::outOfImage(), vpMeTracker::selectDisplay, vpImagePoint::set_ij(), vpMeSite::setDisplay(), vpMe::setRange(), vpMath::sign(), vpMeSite::track(), and vpDEBUG_ENABLE.
Referenced by track().
void vpMeNurbs::seekExtremitiesCanny | ( | const vpImage< unsigned char > & | I | ) |
Seek the extremities of the edge thanks to a canny edge detection. The edge detection enable to find the points belonging to the edge. The any vpMesite are initialize at this points.
This method is practicle when the edge is not smooth.
I | : Image in which the edge appears. |
Definition at line 513 of file vpMeNurbs.cpp.
References vpImageFilter::canny(), vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpImageConvert::convert(), vpImageTools::crop(), vpDisplay::displayPoint(), vpDisplay::displayRectangle(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpMe::getRange(), vpMe::getSampleStep(), vpImage< Type >::getWidth(), vpColor::green, vpMeSite::ifloat, vpMeSite::init(), vpMeSite::jfloat, vpMeTracker::list, vpMath::maximum(), nurbs, vpColor::orange, vpMeTracker::selectDisplay, vpMeSite::setDisplay(), vpMe::setRange(), vpMath::sqr(), vpMeSite::sqrDistance(), vpMeSite::track(), and vpTRACE.
Referenced by track().
|
inline |
Enables to set the two thresholds use by the canny detection.
th1 | : The first threshold; |
th2 | : The second threshold; |
Definition at line 185 of file vpMeNurbs.h.
References vpMeTracker::initTracking(), vpMeTracker::sample(), and vpMeTracker::track().
|
inlineinherited |
Definition at line 102 of file vpMeTracker.h.
References vpTracker::operator=().
|
inline |
Enables or disables the canny detection used during the extremities search.
enable_canny | : if true it enables the canny detection. |
Definition at line 177 of file vpMeNurbs.h.
void vpMeNurbs::setExtremities | ( | ) |
|
inlineinherited |
|
inlineinherited |
Set the moving edges initialisation parameters
p_me | : Moving Edges. |
Definition at line 133 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges
l | : list of Moving Edges. |
Definition at line 147 of file vpMeTracker.h.
|
inline |
Sets the number of control points used to compute the Nurbs.
nb_point | : The number of control points used to compute the Nurbs. |
Definition at line 169 of file vpMeNurbs.h.
void vpMeNurbs::suppressPoints | ( | ) |
Suppression of the points which:
Definition at line 334 of file vpMeNurbs.cpp.
References vpMeSite::getState(), vpMeTracker::list, and vpMeSite::NO_SUPPRESSION.
Referenced by track().
void vpMeNurbs::supressNearPoints | ( | ) |
Suppress vpMeSites if they are too close to each other.
The goal is to keep the order of the vpMeSites in the list.
Definition at line 920 of file vpMeNurbs.cpp.
References vpMe::getSampleStep(), vpMeTracker::list, vpMeSite::setState(), vpMath::sqr(), vpMeSite::sqrDistance(), and vpMeSite::TOO_NEAR.
Referenced by track().
|
inherited |
Definition at line 129 of file vpMeTracker.cpp.
References vpMeTracker::list.
void vpMeNurbs::track | ( | const vpImage< unsigned char > & | I | ) |
Track the edge in the image I.
I | : Image in which the edge appears. |
Definition at line 971 of file vpMeNurbs.cpp.
References vpNurbs::computeCurvePoint(), vpImagePoint::distance(), vpNurbs::globalCurveApprox(), vpMeTracker::list, localReSample(), vpTrackingException::notEnoughPointError, nurbs, reSample(), seekExtremities(), seekExtremitiesCanny(), suppressPoints(), supressNearPoints(), vpMeTracker::track(), and updateDelta().
Referenced by initTracking().
void vpMeNurbs::updateDelta | ( | ) |
Set the alpha value (normal to the edge at this point) of the different vpMeSite to a value computed thanks to the nurbs.
Definition at line 350 of file vpMeNurbs.cpp.
References vpMeSite::alpha, vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpImagePoint::distance(), vpMeSite::i, vpMeSite::j, vpMeTracker::list, and nurbs.
Referenced by track().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 75 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpPoint::changeFrame(), vpCircle::changeFrame(), vpSphere::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), vpSphere::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpSphere::projection(), vpPoint::projection(), vpLine::projection(), vpCylinder::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 81 of file vpTracker.h.
Referenced by vpTracker::init(), vpTracker::operator=(), and vpPoint::operator=().
|
inherited |
Definition at line 167 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 77 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
inherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 74 of file vpMeTracker.h.
Referenced by vpMeTracker::display(), vpMeLine::display(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), localReSample(), vpMeTracker::numberOfSignal(), vpMeTracker::operator=(), vpMeEllipse::printParameters(), vpMeTracker::reset(), vpMeLine::sample(), sample(), vpMeLine::seekExtremities(), seekExtremities(), seekExtremitiesCanny(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), suppressPoints(), supressNearPoints(), vpMeTracker::totalNumberOfSignal(), vpMeTracker::track(), track(), vpMeLine::updateDelta(), updateDelta(), vpMeTracker::vpMeTracker(), vpMeEllipse::~vpMeEllipse(), and vpMeLine::~vpMeLine().
|
inherited |
Moving edges initialisation parameters.
Definition at line 76 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeEllipse::initTracking(), vpMeTracker::operator=(), vpMeEllipse::printParameters(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeTracker::track(), vpMeTracker::vpMeTracker(), and vpMeEllipse::~vpMeEllipse().
|
inherited |
Definition at line 78 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::operator=(), vpMeTracker::reset(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
vpNurbs vpMeNurbs::nurbs |
The Nurbs which represents the tracked edge.
Definition at line 138 of file vpMeNurbs.h.
Referenced by display(), initTracking(), localReSample(), sample(), seekExtremities(), seekExtremitiesCanny(), track(), and updateDelta().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 71 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpPoint::display(), vpCircle::display(), vpSphere::display(), vpCylinder::display(), vpProjectionDisplay::display(), vpLine::display(), vpProjectionDisplay::displayCamera(), vpPose::displayModel(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpTracker::operator=(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpSphere::projection(), vpPoint::projection(), vpLine::projection(), vpCylinder::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().
|
inherited |
Definition at line 166 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
protectedinherited |
Definition at line 81 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), localReSample(), vpMeTracker::operator=(), vpMeLine::sample(), sample(), vpMeLine::seekExtremities(), seekExtremities(), seekExtremitiesCanny(), vpMeTracker::vpMeTracker(), and vpMeEllipse::~vpMeEllipse().