ViSP
2.9.0
|
#include <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 rows, int cols) |
int | outOfImage (vpImagePoint iP, int half, int rows, int cols) |
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 |
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 |
Deprecated functions | |
vp_deprecated void | initTracking (const vpImage< unsigned char > &I, vpList< vpImagePoint > &ptList) |
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) |
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 129 of file vpMeNurbs.h.
vpMeNurbs::vpMeNurbs | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 232 of file vpMeNurbs.cpp.
vpMeNurbs::vpMeNurbs | ( | const vpMeNurbs & | menurbs | ) |
|
virtual |
Basic destructor.
Definition at line 259 of file vpMeNurbs.cpp.
|
virtualinherited |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Reimplemented in vpMbtMeLine.
Definition at line 326 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 347 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 1112 of file vpMeNurbs.cpp.
References nurbs.
|
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 1357 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 1379 of file vpMeNurbs.cpp.
References vpNurbs::computeCurvePoint(), and vpDisplay::displayCross().
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters
Definition at line 147 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 161 of file vpMeTracker.h.
Referenced by vpMbtDistanceLine::closeToImageBorder(), vpMbtDistanceLine::computeInteractionMatrixError(), vpMbtDistanceCylinder::computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), vpMbEdgeTracker::getNbPoints(), vpMbtDistanceLine::initInteractionMatrixError(), vpMbtDistanceCylinder::initInteractionMatrixError(), vpMbEdgeKltTracker::postTrackingMbt(), vpMbEdgeTracker::testTracking(), vpMbEdgeKltTracker::trackFirstLoop(), vpMbtDistanceLine::trackMovingEdge(), vpMbtDistanceCylinder::trackMovingEdge(), vpMbtDistanceLine::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inlineinherited |
Definition at line 162 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 169 of file vpMeTracker.h.
|
inline |
Gets the nurbs;
Definition at line 206 of file vpMeNurbs.h.
|
inherited |
Definition at line 61 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 271 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 330 of file vpMeNurbs.cpp.
References vpNurbs::globalCurveInterp(), vpMeTracker::initTracking(), nurbs, sample(), and track().
vp_deprecated void vpMeNurbs::initTracking | ( | const vpImage< unsigned char > & | I, |
vpList< 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 306 of file vpMeNurbs.cpp.
References vpList< type >::front(), vpNurbs::globalCurveInterp(), vpMeTracker::initTracking(), vpList< type >::next(), nurbs, vpList< type >::outside(), sample(), track(), and vpList< type >::value().
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 902 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 118 of file vpMeTracker.cpp.
References vpMeTracker::list.
Referenced by vpMeLine::leastSquare(), localReSample(), vpMeLine::reSample(), and reSample().
|
inherited |
Definition at line 134 of file vpMeTracker.cpp.
Referenced by localReSample(), vpMeLine::sample(), sample(), seekExtremities(), and vpMeLine::seekExtremities().
|
inherited |
Definition at line 144 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 882 of file vpMeNurbs.cpp.
References vpMe::getSampleStep(), vpMeTracker::initTracking(), vpMeTracker::numberOfSignal(), and sample().
Referenced by track().
|
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 348 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 456 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 580 of file vpMeNurbs.cpp.
References vpImageConvert::convert(), vpImageTools::createSubImage(), 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, vpMath::maximum(), vpColor::orange, 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 180 of file vpMeNurbs.h.
|
inlineinherited |
Definition at line 108 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 172 of file vpMeNurbs.h.
void vpMeNurbs::setExtremities | ( | ) |
|
inlineinherited |
Set the initial range.
r | : initial range. |
Definition at line 126 of file vpMeTracker.h.
Referenced by vpMbtDistanceLine::initMovingEdge(), and vpMbtDistanceCylinder::initMovingEdge().
|
inlineinherited |
Set the moving edges initialisation parameters
p_me | : Moving Edges. |
Definition at line 140 of file vpMeTracker.h.
Referenced by vpMbtDistanceLine::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMbtDistanceLine::setMovingEdge(), and vpMbtDistanceCylinder::setMovingEdge().
|
inlineinherited |
Set the list of moving edges
l | : list of Moving Edges. |
Definition at line 154 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 165 of file vpMeNurbs.h.
void vpMeNurbs::suppressPoints | ( | ) |
Suppression of the points which:
Definition at line 390 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 1002 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 128 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 1056 of file vpMeNurbs.cpp.
References vpNurbs::computeCurvePoint(), vpImagePoint::distance(), vpNurbs::globalCurveApprox(), vpMeTracker::list, localReSample(), 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 410 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 82 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpSphere::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpFeatureBuilder::create(), vpCircle::init(), vpSphere::init(), vpLine::init(), vpPoint::init(), vpCylinder::init(), vpTracker::operator=(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpSphere::projection(), vpCircle::projection(), vpCylinder::projection(), and vpLine::projection().
|
inherited |
Flag used to indicate if the feature parameters cP expressed in the camera frame are available.
Definition at line 88 of file vpTracker.h.
Referenced by vpTracker::init(), vpTracker::operator=(), and vpPoint::operator=().
|
inherited |
Definition at line 174 of file vpMeTracker.h.
Referenced by vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 83 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), and vpMeTracker::vpMeTracker().
|
inherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 80 of file vpMeTracker.h.
Referenced by vpMeTracker::display(), vpMeLine::display(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), localReSample(), vpMeTracker::numberOfSignal(), vpMeTracker::operator=(), vpMeLine::sample(), sample(), vpMeLine::seekExtremities(), seekExtremities(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), suppressPoints(), supressNearPoints(), vpMeTracker::totalNumberOfSignal(), vpMeTracker::track(), track(), updateDelta(), vpMeLine::updateDelta(), vpMeTracker::vpMeTracker(), vpMeEllipse::~vpMeEllipse(), vpMeLine::~vpMeLine(), and vpMeTracker::~vpMeTracker().
|
inherited |
Moving edges initialisation parameters.
Definition at line 82 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::operator=(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 84 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
vpNurbs vpMeNurbs::nurbs |
The Nurbs which represents the tracked edge.
Definition at line 137 of file vpMeNurbs.h.
Referenced by display(), initTracking(), localReSample(), sample(), seekExtremities(), track(), updateDelta(), and vpMeNurbs().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 78 of file vpTracker.h.
Referenced by vpFeatureBuilder::create(), vpPoint::display(), vpSphere::display(), vpCircle::display(), vpCylinder::display(), vpProjectionDisplay::display(), vpLine::display(), vpProjectionDisplay::displayCamera(), vpDisplay::displayFrame(), vpPose::displayModel(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), vpLine::init(), vpPoint::init(), vpCylinder::init(), vpTracker::operator=(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpSphere::projection(), vpCircle::projection(), vpCylinder::projection(), and vpLine::projection().
|
inherited |
Definition at line 173 of file vpMeTracker.h.
Referenced by vpMeTracker::vpMeTracker().
|
protectedinherited |
Definition at line 87 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), localReSample(), vpMeTracker::operator=(), vpMeLine::sample(), sample(), seekExtremities(), vpMeLine::seekExtremities(), and vpMeTracker::vpMeTracker().