![]() |
Visual Servoing Platform
version 3.2.0
|
#include <vpMeEllipse.h>
Public Member Functions | |
vpMeEllipse () | |
vpMeEllipse (const vpMeEllipse &meellipse) | |
virtual | ~vpMeEllipse () |
int | getExpectedDensity () |
void | track (const vpImage< unsigned char > &I) |
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 () |
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 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 bool | inMask (const vpImage< bool > *mask, const unsigned int i, const unsigned int j) |
Public Attributes | |
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 |
Deprecated functions | |
vpColVector | K |
vpImagePoint | iPc |
double | a |
double | b |
double | e |
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 |
void | initTracking (const vpImage< unsigned char > &I, const unsigned int n, unsigned *i, unsigned *j) |
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) |
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) |
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 105 of file vpMeEllipse.h.
vpMeEllipse::vpMeEllipse | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 81 of file vpMeEllipse.cpp.
vpMeEllipse::vpMeEllipse | ( | const vpMeEllipse & | meellipse | ) |
Copy constructor.
Definition at line 100 of file vpMeEllipse.cpp.
|
virtual |
Basic destructor.
Definition at line 131 of file vpMeEllipse.cpp.
|
inlinevirtual |
Display the moving edge sites with a color corresponding to their state.
I | : The image. |
Reimplemented from vpMeTracker.
Definition at line 124 of file vpMeEllipse.h.
|
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 ![]() |
highalpha | : Highest ![]() |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 995 of file vpMeEllipse.cpp.
Display the ellipse.
I | : Image in which the ellipse appears. |
col | : Color of the displayed ellipse. |
Implements vpMeTracker.
Definition at line 639 of file vpMeEllipse.cpp.
Referenced by initTracking().
|
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 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 ![]() |
highalpha | : Highest ![]() |
color | : Color used to display th lines. |
thickness | : Thickness of the drawings. |
Definition at line 1073 of file vpMeEllipse.cpp.
|
inline |
Gets the 0 order moment which represents the area of the ellipse.
Definition at line 145 of file vpMeEllipse.h.
|
inline |
Gets the 1 order raw moment with
.
Definition at line 161 of file vpMeEllipse.h.
|
inline |
Gets the 2 order raw moment with
.
Definition at line 185 of file vpMeEllipse.h.
|
inline |
Gets the 1 order raw moment with
.
Definition at line 153 of file vpMeEllipse.h.
|
inline |
Gets the 2 order raw moment with
.
Definition at line 169 of file vpMeEllipse.h.
|
inline |
Gets the 2 order raw moment with
.
Definition at line 177 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 199 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 192 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 206 of file vpMeEllipse.h.
|
inline |
Gets the semiminor axis of the ellipse.
Definition at line 216 of file vpMeEllipse.h.
|
inline |
Gets the semimajor axis of the ellipse.
Definition at line 221 of file vpMeEllipse.h.
|
inline |
Gets the center of the ellipse.
Definition at line 211 of file vpMeEllipse.h.
|
inline |
Gets the angle made by the major axis and the i axis of the image frame
Definition at line 227 of file vpMeEllipse.h.
|
inline |
Gets the equation parameters of the ellipse
Definition at line 232 of file vpMeEllipse.h.
|
inline |
Definition at line 115 of file vpMeEllipse.h.
|
inline |
Gets the highest angle
Definition at line 247 of file vpMeEllipse.h.
|
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 smallest angle
Definition at line 242 of file vpMeEllipse.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 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 652 of file vpMeEllipse.cpp.
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 738 of file vpMeEllipse.cpp.
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 926 of file vpMeEllipse.cpp.
References vpMeTracker::display(), display(), e, vpDisplay::flush(), vpColor::green, vpMeTracker::initTracking(), iP1, iP2, K, vpMatrix::pseudoInverse(), vpImagePoint::set_i(), vpImagePoint::set_j(), vpMath::sqr(), and track().
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 684 of file vpMeEllipse.cpp.
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 781 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, ce, vpMeTracker::display(), display(), e, vpDisplay::flush(), vpColor::green, vpMeTracker::initTracking(), iPc, se, 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 139 of file vpMeTracker.cpp.
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), and vpMbtFaceDepthNormal::computeDesiredFeatures().
|
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 vpMeEllipse::printParameters | ( | ) |
Print the parameters and the coordinates of the ellipse center.
Definition at line 292 of file vpMeEllipse.cpp.
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 95 of file vpMeTracker.cpp.
Referenced by vpMeTracker::~vpMeTracker().
|
inlineinherited |
Definition at line 103 of file vpMeTracker.h.
|
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 |
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 258 of file vpMeEllipse.h.
|
inherited |
Definition at line 128 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 813 of file vpMeEllipse.cpp.
Referenced by initTracking().
double vpMeEllipse::a |
is the semiminor axis of the ellipse.
Definition at line 281 of file vpMeEllipse.h.
Referenced by initTracking().
|
protected |
|
protected |
|
protected |
Stores the value of the angle for each vpMeSite.
Definition at line 306 of file vpMeEllipse.h.
double vpMeEllipse::b |
is the semimajor axis of the ellipse.
Definition at line 283 of file vpMeEllipse.h.
Referenced by initTracking().
|
protected |
|
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().
double vpMeEllipse::e |
is the angle made by the major axis and the i axis of the image frame
.
Definition at line 286 of file vpMeEllipse.h.
Referenced by initTracking().
|
protected |
Expected number of me to track along the ellipse.
Definition at line 318 of file vpMeEllipse.h.
|
inherited |
Definition at line 76 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), 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 292 of file vpMeEllipse.h.
Referenced by initTracking().
|
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 296 of file vpMeEllipse.h.
Referenced by initTracking().
vpImagePoint vpMeEllipse::iPc |
The coordinates of the ellipse center.
Definition at line 279 of file vpMeEllipse.h.
Referenced by initTracking().
vpColVector vpMeEllipse::K |
Parameters of the ellipse to define the set of points that satisfy the implicit equation :
Definition at line 277 of file vpMeEllipse.h.
Referenced by initTracking().
|
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().
|
protected |
Surface.
Definition at line 308 of file vpMeEllipse.h.
|
protected |
Definition at line 312 of file vpMeEllipse.h.
|
protected |
Definition at line 314 of file vpMeEllipse.h.
|
protected |
First order raw moments.
Definition at line 312 of file vpMeEllipse.h.
|
protected |
Second order raw moments.
Definition at line 314 of file vpMeEllipse.h.
|
protected |
Definition at line 314 of file vpMeEllipse.h.
|
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().
|
protected |
Definition at line 310 of file vpMeEllipse.h.
|
protected |
Second order central moments.
Definition at line 310 of file vpMeEllipse.h.
|
protected |
Definition at line 310 of file vpMeEllipse.h.
|
inherited |
Definition at line 77 of file vpMeTracker.h.
Referenced by vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
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().
|
protected |
|
protectedinherited |
Definition at line 82 of file vpMeTracker.h.
Referenced by vpMeTracker::init(), vpMeTracker::operator=(), and vpMeTracker::vpMeTracker().
|
protected |
Threshold for the robust least square.
Definition at line 316 of file vpMeEllipse.h.