Visual Servoing Platform
version 3.4.0
|
#include <vpMeNurbs.h>
Public Member Functions | |
vpMeNurbs () | |
vpMeNurbs (const vpMeNurbs &menurbs) | |
virtual | ~vpMeNurbs () |
void | setNbControlPoints (unsigned int nb_point) |
void | setEnableCannyDetection (const bool enable_canny) |
void | setCannyThreshold (double th1, 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 > &I) |
virtual void | sample (const vpImage< unsigned char > &image, bool doNotTrack=false) |
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) |
Public Member Functions Inherited from vpTracker | |
vpColVector | get_p () const |
vpColVector | get_cP () 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 |
Public Attributes Inherited from vpMeTracker | |
std::list< vpMeSite > | list |
vpMe * | me |
unsigned int | init_range |
int | nGoodElement |
const vpImage< bool > * | m_mask |
int | query_range |
bool | display_point |
Public Attributes Inherited from vpTracker | |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Protected Attributes | |
Protected Attributes Inherited from vpMeTracker | |
vpMeSite::vpMeSiteDisplayType | selectDisplay |
Public Member Functions Inherited from vpMeTracker | |
virtual void | display (const vpImage< unsigned char > &I) |
virtual 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 () |
unsigned int | numberOfSignal () |
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 | setDisplay (vpMeSite::vpMeSiteDisplayType select) |
void | setInitRange (const unsigned int &r) |
virtual void | setMask (const vpImage< bool > &mask) |
void | setMe (vpMe *p_me) |
void | setMeList (const std::list< vpMeSite > &l) |
unsigned int | totalNumberOfSignal () |
static bool | inMask (const vpImage< bool > *mask, unsigned int i, unsigned int j) |
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. |
Definition at line 326 of file vpMeTracker.cpp.
References vpMeSite::display(), and vpMeTracker::list.
Definition at line 340 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 354 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 1028 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 1244 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 1265 of file vpMeNurbs.cpp.
References vpNurbs::computeCurvePoint(), and vpDisplay::displayCross().
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 99 of file vpTracker.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 97 of file vpTracker.h.
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters
Definition at line 120 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 127 of file vpMeTracker.h.
|
inlineinherited |
Definition at line 128 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 135 of file vpMeTracker.h.
References vpTracker::init(), and vpTracker::operator=().
|
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().
|
staticinherited |
Test whether the pixel is inside the mask. Mask values that are set to true are considered in the tracking.
mask | Mask image or NULL 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 140 of file vpMeTracker.cpp.
References vpImage< Type >::getValue().
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtDistanceKltPoints::computeNbDetectedCurrent(), vpMbtDistanceKltPoints::init(), and vpMeTracker::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 831 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(), vpMeEllipse::leastSquareRobust(), localReSample(), vpMeLine::reSample(), and reSample().
|
inherited |
Definition at line 150 of file vpMeTracker.cpp.
Referenced by localReSample(), vpMeEllipse::plugHoles(), vpMeLine::sample(), sample(), vpMeEllipse::sample(), vpMeLine::seekExtremities(), and seekExtremities().
|
inherited |
Definition at line 155 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 813 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. |
doNotTrack | : Inherited parameter, not used. |
Implements vpMeTracker.
Definition at line 294 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 395 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(), seekExtremitiesCanny(), 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 516 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 seekExtremities(), and 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 152 of file vpMeTracker.h.
|
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 |
|
inlinevirtualinherited |
|
inlineinherited |
Set the moving edges initialisation parameters
p_me | : Moving Edges. |
Definition at line 173 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges
l | : list of Moving Edges. |
Definition at line 180 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 335 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 921 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 972 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 351 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 77 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpSphere::changeFrame(), vpPoint::changeFrame(), vpCircle::changeFrame(), vpLine::changeFrame(), vpCylinder::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpSphere::init(), vpCircle::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpSphere::projection(), vpCircle::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 83 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Definition at line 193 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 81 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 78 of file vpMeTracker.h.
Referenced by vpMeTracker::display(), vpMeLine::display(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), vpMeEllipse::leastSquareRobust(), localReSample(), vpMeTracker::numberOfSignal(), vpMeTracker::operator=(), vpMeEllipse::plugHoles(), vpMeTracker::reset(), vpMeLine::sample(), sample(), vpMeEllipse::sample(), vpMeLine::seekExtremities(), seekExtremities(), seekExtremitiesCanny(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), suppressPoints(), supressNearPoints(), vpMeTracker::totalNumberOfSignal(), vpMeTracker::track(), track(), vpMeLine::updateDelta(), updateDelta(), vpMeEllipse::updateTheta(), vpMeTracker::vpMeTracker(), vpMeEllipse::~vpMeEllipse(), and vpMeLine::~vpMeLine().
|
inherited |
Mask used to disable tracking on a part of image.
Definition at line 84 of file vpMeTracker.h.
Referenced by vpMeTracker::track().
|
inherited |
Moving edges initialisation parameters.
Definition at line 80 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeEllipse::leastSquareRobust(), vpMeTracker::operator=(), vpMeEllipse::plugHoles(), vpMeLine::reSample(), vpMeLine::sample(), vpMeEllipse::sample(), vpMeLine::seekExtremities(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 82 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 73 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpSphere::display(), vpPoint::display(), vpCircle::display(), vpLine::display(), vpProjectionDisplay::display(), vpCylinder::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpSphere::init(), vpMeTracker::init(), vpCircle::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpSphere::projection(), vpCircle::projection(), vpPoint::projection(), vpLine::projection(), vpCylinder::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().
|
inherited |
Definition at line 192 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
protectedinherited |
Definition at line 90 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), localReSample(), vpMeTracker::operator=(), vpMeEllipse::plugHoles(), vpMeLine::sample(), sample(), vpMeEllipse::sample(), vpMeLine::seekExtremities(), seekExtremities(), seekExtremitiesCanny(), and vpMeTracker::vpMeTracker().