Visual Servoing Platform
version 3.0.1
|
#include <visp3/me/vpMeEllipse.h>
Public Member Functions | |
vpMeEllipse () | |
vpMeEllipse (const vpMeEllipse &meellipse) | |
virtual | ~vpMeEllipse () |
int | getExpectedDensity () |
void | track (const vpImage< unsigned char > &Im) |
void | initTracking (const vpImage< unsigned char > &I) |
void | initTracking (const vpImage< unsigned char > &I, const unsigned int n, vpImagePoint *iP) |
void | initTracking (const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &iP) |
void | initTracking (const vpImage< unsigned char > &I, const vpImagePoint &ic, double a_p, double b_p, double e_p, double low_alpha, double high_alpha) |
void | display (const vpImage< unsigned char > &I, vpColor col) |
void | display (const vpImage< unsigned char > &I) |
void | printParameters () |
double | get_m00 () const |
double | get_m10 () const |
double | get_m01 () const |
double | get_m11 () const |
double | get_m20 () const |
double | get_m02 () const |
double | get_mu11 () const |
double | get_mu02 () const |
double | get_mu20 () const |
vpImagePoint | getCenter () const |
double | getA () const |
double | getB () const |
double | getE () const |
void | getEquationParam (double &A, double &B, double &E) |
double | getSmallestAngle () |
double | getHighestAngle () |
void | setThresholdRobust (const double threshold) |
void | init () |
unsigned int | numberOfSignal () |
unsigned int | totalNumberOfSignal () |
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 | 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, const vpImagePoint ¢er, const double &A, const double &B, const double &E, const double &smallalpha, const double &highalpha, const vpColor &color=vpColor::green, unsigned int thickness=1) |
static void | display (const vpImage< vpRGBa > &I, const vpImagePoint ¢er, const double &A, const double &B, const double &E, const double &smallalpha, const double &highalpha, const vpColor &color=vpColor::green, unsigned int thickness=1) |
Public Attributes | |
vpColVector | K |
vpImagePoint | iPc |
double | a |
double | b |
double | e |
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 | |
vpImagePoint | iP1 |
vpImagePoint | iP2 |
double | alpha1 |
double | alpha2 |
double | ce |
double | se |
std::list< double > | angle |
double | m00 |
double | mu11 |
double | mu20 |
double | mu02 |
double | m10 |
double | m01 |
double | m11 |
double | m02 |
double | m20 |
double | thresholdWeight |
double | expecteddensity |
vpMeSite::vpMeSiteDisplayType | selectDisplay |
Deprecated functions | |
void | initTracking (const vpImage< unsigned char > &I, const unsigned int n, unsigned *i, unsigned *j) |
Class that tracks an ellipse moving edges.
In this class, an ellipse is defined as the set of points of the image frame (For more information about the image frame see the vpImagePoint documentation) that satisfy the implicit equation :
If is equal to 1 and is equal to 0 the the set of points represents a circle.
The five parameters are stored in the public attribute K.
An ellipse is also defined thanks to three other parameter which are , and . represents the semiminor axis and is the semimajor axis. Here is the angle made by the major axis and the i axis of the image frame . The following figure shows better meaning of those parameters.
It is possible to compute the coordinates of a point which belongs to the ellipse thanks to the following equations :
Here the coordinates are the coordinates of the ellipse center in the image frame and is an angle beetween and which enables to describe all the points of the ellipse.
The example below available in tutorial-me-ellipse-tracker.cpp and described in Tutorial: Moving-edges tracking, section Ellipse tracking shows how to use this class.
Definition at line 95 of file vpMeEllipse.h.
vpMeEllipse::vpMeEllipse | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 80 of file vpMeEllipse.cpp.
References iP1, iP2, vpImagePoint::set_i(), and vpImagePoint::set_j().
vpMeEllipse::vpMeEllipse | ( | const vpMeEllipse & | meellipse | ) |
|
virtual |
Basic destructor.
Definition at line 139 of file vpMeEllipse.cpp.
References angle, and vpMeTracker::list.
|
inherited |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 352 of file vpMeTracker.cpp.
References vpMeTracker::display(), vpMeSite::getState(), vpMeTracker::list, vpMeSite::NO_SUPPRESSION, and vpMeSite::weight.
Display the ellipse.
I | : Image in which the ellipse appears. |
col | : Color of the displayed ellipse. |
Implements vpMeTracker.
Definition at line 692 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, e, and iPc.
Referenced by initTracking(), and track().
|
inlinevirtual |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Reimplemented from vpMeTracker.
Definition at line 113 of file vpMeEllipse.h.
References vpMeTracker::display().
|
static |
Display of the ellipse thanks to the equation parameters.
I | : The image used as background. |
center | : Center of the ellipse |
A | : Semiminor axis of the ellipse. |
B | : Semimajor axis of the ellipse. |
E | : Angle made by the major axis and the i axis of the image frame |
smallalpha | : Smallest angle in rad. |
highalpha | : Highest angle in rad. |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 1102 of file vpMeEllipse.cpp.
References vpColor::blue, vpDisplay::displayCross(), vpDisplay::displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMath::rad(), vpColor::red, vpImagePoint::set_i(), and vpImagePoint::set_j().
|
static |
Display of the ellipse thanks to the equation parameters.
I | : The image used as background. |
center | : Center of the ellipse |
A | : Semiminor axis of the ellipse. |
B | : Semimajor axis of the ellipse. |
E | : Angle made by the major axis and the i axis of the image frame |
smallalpha | : Smallest angle in rad. |
highalpha | : Highest angle in rad. |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 1181 of file vpMeEllipse.cpp.
References vpColor::blue, vpDisplay::displayCross(), vpDisplay::displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMath::rad(), vpColor::red, vpImagePoint::set_i(), and vpImagePoint::set_j().
|
inline |
Gets the 0 order moment which represents the area of the ellipse.
Definition at line 131 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 1 order raw moment with .
Definition at line 145 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 166 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 1 order raw moment with .
Definition at line 138 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 152 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 159 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order central moment .
Definition at line 180 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 173 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 187 of file vpMeEllipse.h.
|
inline |
Gets the semiminor axis of the ellipse.
Definition at line 197 of file vpMeEllipse.h.
|
inline |
Gets the semimajor axis of the ellipse.
Definition at line 202 of file vpMeEllipse.h.
|
inline |
Gets the center of the ellipse.
Definition at line 192 of file vpMeEllipse.h.
|
inline |
Gets the angle made by the major axis and the i axis of the image frame
Definition at line 207 of file vpMeEllipse.h.
|
inline |
Gets the equation parameters of the ellipse
Definition at line 212 of file vpMeEllipse.h.
|
inline |
Definition at line 105 of file vpMeEllipse.h.
|
inline |
Gets the highest angle
Definition at line 222 of file vpMeEllipse.h.
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters
Definition at line 142 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 156 of file vpMeTracker.h.
|
inlineinherited |
Definition at line 157 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 164 of file vpMeTracker.h.
|
inline |
Gets the smallest angle
Definition at line 217 of file vpMeEllipse.h.
|
inherited |
Definition at line 57 of file vpMeTracker.cpp.
References vpTracker::init(), vpMeSite::NONE, vpTracker::p, vpColVector::resize(), and vpMeTracker::selectDisplay.
Referenced by vpMeTracker::vpMeTracker().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I | ) |
Initilization of the tracking. Ask the user to click counter clockwise on five points located on the ellipse edge to track.
I | : Image in which the ellipse appears. |
Definition at line 707 of file vpMeEllipse.cpp.
References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), iP1, iP2, and vpColor::red.
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const unsigned int | n, | ||
vpImagePoint * | iP | ||
) |
Initialization of the tracking. The ellipse is defined thanks to the coordinates of n points.
I | : Image in which the ellipse appears. |
n | : The number of points in the list. |
iP | : A pointer to a list of points belonging to the ellipse edge. |
Definition at line 741 of file vpMeEllipse.cpp.
References alpha1, alpha2, vpMeTracker::display(), display(), e, expecteddensity, vpDisplay::flush(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMe::getSampleStep(), vpColor::green, vpMeTracker::initTracking(), iP1, iP2, vpMeTracker::me, vpMatrix::pseudoInverse(), vpMath::rad(), vpMath::sqr(), and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const std::vector< vpImagePoint > & | iP | ||
) |
Initialization of the tracking. The ellipse is defined thanks to a vector of n points.
I | : Image in which the ellipse appears. |
iP | : A vector of points belonging to the ellipse edge used to initialize the tracking. |
Definition at line 796 of file vpMeEllipse.cpp.
References alpha1, alpha2, vpMeTracker::display(), display(), e, expecteddensity, vpDisplay::flush(), vpMe::getSampleStep(), vpColor::green, vpMeTracker::initTracking(), iP1, iP2, vpMeTracker::me, vpMatrix::pseudoInverse(), vpMath::rad(), vpMath::sqr(), and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const vpImagePoint & | ic, | ||
double | a_p, | ||
double | b_p, | ||
double | e_p, | ||
double | low_alpha, | ||
double | high_alpha | ||
) |
Definition at line 841 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, ce, vpMeTracker::display(), display(), e, vpDisplay::flush(), vpColor::green, vpMeTracker::initTracking(), iPc, se, and track().
void vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I, |
const unsigned int | n, | ||
unsigned * | i, | ||
unsigned * | j | ||
) |
i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4
Definition at line 995 of file vpMeEllipse.cpp.
References vpMeTracker::display(), display(), e, vpDisplay::flush(), vpColor::green, vpMeTracker::initTracking(), iP1, iP2, vpMatrix::pseudoInverse(), vpImagePoint::set_i(), vpImagePoint::set_j(), vpMath::sqr(), track(), vpCDEBUG, and vpERROR_TRACE.
|
inherited |
Definition at line 123 of file vpMeTracker.cpp.
References vpMeTracker::list.
Referenced by vpMeLine::leastSquare(), vpMeNurbs::localReSample(), vpMeLine::reSample(), and vpMeNurbs::reSample().
|
inherited |
Definition at line 139 of file vpMeTracker.cpp.
Referenced by vpMeNurbs::localReSample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeNurbs::seekExtremities(), and vpMeLine::seekExtremities().
|
inherited |
Definition at line 149 of file vpMeTracker.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().
void vpMeEllipse::printParameters | ( | ) |
Print the parameters and the coordinates of the ellipse center.
Definition at line 312 of file vpMeEllipse.cpp.
References iPc.
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 97 of file vpMeTracker.cpp.
References vpMeTracker::list, and vpMeTracker::nGoodElement.
Referenced by vpMeTracker::~vpMeTracker().
|
inlineinherited |
Definition at line 101 of file vpMeTracker.h.
|
inlineinherited |
|
inlineinherited |
Set the moving edges initialisation parameters
p_me | : Moving Edges. |
Definition at line 135 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges
l | : list of Moving Edges. |
Definition at line 149 of file vpMeTracker.h.
|
inline |
Set the new threshold for the robust estimation of the parameters of the ellipse equation. If the weight of a point is below this threshold, this one is removed from the list of tracked meSite. Value must be between 0 (never rejected) and 1 (always rejected).
threshold | : The new value of the threshold. |
Definition at line 233 of file vpMeEllipse.h.
|
inherited |
Definition at line 133 of file vpMeTracker.cpp.
References vpMeTracker::list.
void vpMeEllipse::track | ( | const vpImage< unsigned char > & | I | ) |
Track the ellipse in the image I.
I | : Image in which the ellipse appears. |
Definition at line 874 of file vpMeEllipse.cpp.
References vpMeTracker::display(), display(), vpDisplay::flush(), vpColor::red, vpMeTracker::track(), and vpDEBUG_ENABLE.
Referenced by initTracking().
double vpMeEllipse::a |
is the semiminor axis of the ellipse.
Definition at line 255 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
The smallest angle.
Definition at line 267 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
The highest angle.
Definition at line 269 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
Stores the value of the angle for each vpMeSite.
Definition at line 275 of file vpMeEllipse.h.
Referenced by vpMeEllipse(), and ~vpMeEllipse().
double vpMeEllipse::b |
is the semimajor axis of the ellipse.
Definition at line 257 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
Value of cos(e).
Definition at line 271 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 77 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), vpSphere::init(), vpLine::init(), vpPoint::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 83 of file vpTracker.h.
Referenced by vpTracker::init(), vpTracker::operator=(), and vpPoint::operator=().
|
inherited |
Definition at line 169 of file vpMeTracker.h.
Referenced by vpMeTracker::vpMeTracker().
double vpMeEllipse::e |
is the angle made by the major axis and the i axis of the image frame .
Definition at line 259 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
Expected number of me to track along the ellipse.
Definition at line 287 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
inherited |
Definition at line 76 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), and vpMeTracker::vpMeTracker().
|
protected |
The coordinates of the point corresponding to the smallest angle. More things about the are given at the beginning of the class description.
Definition at line 263 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
protected |
The coordinates of the point corresponding to the highest angle. More things about the are given at the beginning of the class description.
Definition at line 265 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
vpImagePoint vpMeEllipse::iPc |
The coordinates of the ellipse center.
Definition at line 253 of file vpMeEllipse.h.
Referenced by display(), initTracking(), printParameters(), and vpMeEllipse().
vpColVector vpMeEllipse::K |
Parameters of the ellipse to define the set of points that satisfy the implicit equation :
Definition at line 251 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
inherited |
Tracking dependent variables/functions List of tracked moving edges points.
Definition at line 73 of file vpMeTracker.h.
Referenced by vpMeTracker::display(), vpMeLine::display(), vpMeTracker::initTracking(), vpMeLine::leastSquare(), vpMeNurbs::localReSample(), vpMeTracker::numberOfSignal(), vpMeTracker::operator=(), vpMeTracker::reset(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), vpMeNurbs::suppressPoints(), vpMeNurbs::supressNearPoints(), vpMeTracker::totalNumberOfSignal(), vpMeTracker::track(), vpMeNurbs::track(), vpMeLine::updateDelta(), vpMeNurbs::updateDelta(), vpMeTracker::vpMeTracker(), ~vpMeEllipse(), and vpMeLine::~vpMeLine().
|
protected |
|
protected |
Definition at line 281 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 283 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
|
protected |
Second order raw moments.
Definition at line 283 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 283 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
inherited |
Moving edges initialisation parameters.
Definition at line 75 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), initTracking(), vpMeTracker::operator=(), vpMeLine::reSample(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
protected |
Definition at line 279 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Second order central moments.
Definition at line 279 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 279 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
inherited |
Definition at line 77 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), vpMeTracker::reset(), vpMeTracker::track(), and vpMeTracker::vpMeTracker().
|
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(), vpPoint::display(), vpSphere::display(), vpCircle::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(), vpLine::init(), vpPoint::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 168 of file vpMeTracker.h.
Referenced by vpMeTracker::vpMeTracker().
|
protected |
Value of sin(e).
Definition at line 273 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
protectedinherited |
Definition at line 80 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), vpMeNurbs::localReSample(), vpMeTracker::operator=(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeNurbs::seekExtremities(), vpMeLine::seekExtremities(), and vpMeTracker::vpMeTracker().
|
protected |
Threshold for the robust least square.
Definition at line 285 of file vpMeEllipse.h.
Referenced by vpMeEllipse().