![]() |
Visual Servoing Platform
version 3.2.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 > &I) |
virtual void | sample (const vpImage< unsigned char > &image, const 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) |
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 () |
virtual void | setMask (const vpImage< bool > &mask) |
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) |
static bool | inMask (const vpImage< bool > *mask, const unsigned int i, const unsigned int j) |
Public Attributes | |
vpNurbs | nurbs |
std::list< vpMeSite > | list |
vpMe * | me |
unsigned int | init_range |
int | nGoodElement |
const vpImage< bool > * | m_mask |
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 129 of file vpMeNurbs.h.
vpMeNurbs::vpMeNurbs | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 214 of file vpMeNurbs.cpp.
vpMeNurbs::vpMeNurbs | ( | const vpMeNurbs & | menurbs | ) |
Copy constructor.
Definition at line 223 of file vpMeNurbs.cpp.
|
virtual |
Basic destructor.
Definition at line 239 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 325 of file vpMeTracker.cpp.
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.
|
inherited |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 345 of file vpMeTracker.cpp.
|
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.
|
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.
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters
Definition at line 150 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 164 of file vpMeTracker.h.
|
inlineinherited |
Definition at line 165 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 172 of file vpMeTracker.h.
|
inline |
Gets the nurbs;
Definition at line 209 of file vpMeNurbs.h.
|
inherited |
Definition at line 54 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 247 of file vpMeNurbs.cpp.
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 276 of file vpMeNurbs.cpp.
|
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 139 of file vpMeTracker.cpp.
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), and vpMbtFaceDepthNormal::computeDesiredFeatures().
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.
|
inherited |
Definition at line 119 of file vpMeTracker.cpp.
References vpMeTracker::list.
|
inherited |
Definition at line 154 of file vpMeTracker.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().
|
inherited |
Definition at line 149 of file vpMeTracker.cpp.
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.
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 95 of file vpMeTracker.cpp.
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 293 of file vpMeNurbs.cpp.
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.
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 515 of file vpMeNurbs.cpp.
References vpImageFilter::canny(), 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, vpMath::maximum(), vpColor::orange, vpMeSite::setDisplay(), vpMe::setRange(), vpMath::sqr(), vpMeSite::sqrDistance(), vpMeSite::track(), and vpTRACE.
|
inline |
Enables to set the two thresholds use by the canny detection.
th1 | : The first threshold; |
th2 | : The second threshold; |
Definition at line 184 of file vpMeNurbs.h.
|
inlineinherited |
Definition at line 103 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 176 of file vpMeNurbs.h.
void vpMeNurbs::setExtremities | ( | ) |
|
inlineinherited |
|
inlinevirtualinherited |
|
inlineinherited |
Set the moving edges initialisation parameters
p_me | : Moving Edges. |
Definition at line 143 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges
l | : list of Moving Edges. |
Definition at line 157 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 168 of file vpMeNurbs.h.
void vpMeNurbs::suppressPoints | ( | ) |
Suppression of the points which:
Definition at line 334 of file vpMeNurbs.cpp.
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.
|
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 971 of file vpMeNurbs.cpp.
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.
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 74 of file vpTracker.h.
Referenced by vpCircle::init(), vpSphere::init(), vpCylinder::init(), vpTracker::operator=(), vpPoint::operator=(), and vpPose::printPoint().
|
inherited |
Flag used to indicate if the feature parameters cP expressed in the camera frame are available.
Definition at line 80 of file vpTracker.h.
Referenced by vpTracker::operator=(), and vpPoint::operator=().
|
inherited |
Definition at line 177 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 76 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
inherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 73 of file vpMeTracker.h.
Referenced by vpMeTracker::numberOfSignal(), vpMeTracker::operator=(), vpMeTracker::totalNumberOfSignal(), and vpMeTracker::vpMeTracker().
|
inherited |
Mask used to disable tracking on a part of image.
Definition at line 79 of file vpMeTracker.h.
|
inherited |
Moving edges initialisation parameters.
Definition at line 75 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
inherited |
Definition at line 77 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
vpNurbs vpMeNurbs::nurbs |
The Nurbs which represents the tracked edge.
Definition at line 137 of file vpMeNurbs.h.
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 70 of file vpTracker.h.
Referenced by vpCircle::display(), vpSphere::display(), vpProjectionDisplay::display(), vpProjectionDisplay::displayCamera(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), vpCylinder::init(), vpTracker::operator=(), vpPoint::operator=(), and vpPose::printPoint().
|
inherited |
Definition at line 176 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
protectedinherited |
Definition at line 82 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().