ViSP
2.10.0
|
#include <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 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 | setCircle (bool is_circle) |
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 142 of file vpMeEllipse.h.
vpMeEllipse::vpMeEllipse | ( | ) |
Basic constructor that calls the constructor of the class vpMeTracker.
Definition at line 83 of file vpMeEllipse.cpp.
References iP1, iP2, vpImagePoint::set_i(), vpImagePoint::set_j(), and vpCDEBUG.
vpMeEllipse::vpMeEllipse | ( | const vpMeEllipse & | meellipse | ) |
|
virtual |
Basic destructor.
Definition at line 147 of file vpMeEllipse.cpp.
References angle, vpMeTracker::list, and vpCDEBUG.
|
inherited |
Displays the status of moving edge sites
I | : The image. |
w | : vector |
index_w | : index |
Definition at line 356 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 787 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 159 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 1276 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 1355 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 192 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 1 order raw moment with .
Definition at line 206 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 227 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 1 order raw moment with .
Definition at line 199 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 213 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 220 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order central moment .
Definition at line 241 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 234 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 248 of file vpMeEllipse.h.
|
inline |
Gets the semiminor axis of the ellipse.
Definition at line 258 of file vpMeEllipse.h.
|
inline |
Gets the semimajor axis of the ellipse.
Definition at line 263 of file vpMeEllipse.h.
|
inline |
Gets the center of the ellipse.
Definition at line 253 of file vpMeEllipse.h.
|
inline |
Gets the angle made by the major axis and the i axis of the image frame
Definition at line 268 of file vpMeEllipse.h.
|
inline |
Gets the equation parameters of the ellipse
Definition at line 273 of file vpMeEllipse.h.
|
inline |
Definition at line 152 of file vpMeEllipse.h.
|
inline |
Gets the highest angle
Definition at line 283 of file vpMeEllipse.h.
|
inlineinherited |
|
inlineinherited |
Return the moving edges initialisation parameters
Definition at line 149 of file vpMeTracker.h.
|
inlineinherited |
Return the list of moving edges
Definition at line 163 of file vpMeTracker.h.
|
inlineinherited |
Definition at line 164 of file vpMeTracker.h.
|
inlineinherited |
Return the number of points that has not been suppressed.
Definition at line 171 of file vpMeTracker.h.
|
inline |
Gets the smallest angle
Definition at line 278 of file vpMeEllipse.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 vpMeEllipse::initTracking | ( | const vpImage< unsigned char > & | I | ) |
Initilization of the tracking. Ask the user to click on five points from the ellipse edge to track.
I | : Image in which the ellipse appears. |
Definition at line 800 of file vpMeEllipse.cpp.
References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), iP1, iP2, vpColor::red, and vpCDEBUG.
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 pointsbelonging to the ellipse edge. |
i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4
Definition at line 835 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, vpMath::deg(), vpMeTracker::display(), display(), e, expecteddensity, vpDisplay::flush(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMe::getSampleStep(), vpColor::green, vpMeTracker::initTracking(), iP1, iP2, iPc, vpMeTracker::me, vpMatrix::pseudoInverse(), vpMath::rad(), vpMath::sqr(), track(), vpCDEBUG, and vpERROR_TRACE.
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 923 of file vpMeEllipse.cpp.
References a, alpha1, alpha2, b, ce, vpMeTracker::display(), display(), e, vpDisplay::flush(), vpColor::green, vpMeTracker::initTracking(), iPc, se, track(), and vpERROR_TRACE.
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 1170 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 127 of file vpMeTracker.cpp.
References vpMeTracker::list.
Referenced by vpMeLine::leastSquare(), vpMeNurbs::localReSample(), vpMeLine::reSample(), and vpMeNurbs::reSample().
|
inherited |
Definition at line 143 of file vpMeTracker.cpp.
Referenced by vpMeNurbs::localReSample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeNurbs::seekExtremities(), and vpMeLine::seekExtremities().
|
inherited |
Definition at line 153 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 338 of file vpMeEllipse.cpp.
References iPc.
|
inherited |
Reset the tracker by removing all the moving edges.
Definition at line 101 of file vpMeTracker.cpp.
References vpMeTracker::list, and vpMeTracker::nGoodElement.
Referenced by vpMeTracker::~vpMeTracker().
|
inline |
Set to true if you are sure to track a circle.
In that case, the set of points satisfy the implicit equation :
Compared to the classical equation of an ellipse, is equal to 1 and is equal to 0.
is_circle | : Set to true if you want to track a circle. |
Definition at line 185 of file vpMeEllipse.h.
|
inlineinherited |
Definition at line 108 of file vpMeTracker.h.
|
inlineinherited |
|
inlineinherited |
Set the moving edges initialisation parameters
p_me | : Moving Edges. |
Definition at line 142 of file vpMeTracker.h.
|
inlineinherited |
Set the list of moving edges
l | : list of Moving Edges. |
Definition at line 156 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 294 of file vpMeEllipse.h.
|
inherited |
Definition at line 137 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 969 of file vpMeEllipse.cpp.
References vpMeTracker::display(), display(), vpDisplay::flush(), vpColor::red, vpMeTracker::track(), vpCDEBUG, vpDEBUG_ENABLE, and vpERROR_TRACE.
Referenced by initTracking().
double vpMeEllipse::a |
is the semiminor axis of the ellipse.
Definition at line 318 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
The smallest angle.
Definition at line 330 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
The highest angle.
Definition at line 332 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
Stores the value of the angle for each vpMeSite.
Definition at line 338 of file vpMeEllipse.h.
Referenced by vpMeEllipse(), and ~vpMeEllipse().
double vpMeEllipse::b |
is the semimajor axis of the ellipse.
Definition at line 320 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
Value of cos(e).
Definition at line 334 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 82 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpCircle::changeFrame(), vpSphere::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpFeatureBuilder::create(), 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(), 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 176 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 322 of file vpMeEllipse.h.
Referenced by display(), initTracking(), and vpMeEllipse().
|
protected |
Expected number of me to track along the ellipse.
Definition at line 350 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
inherited |
Definition at line 83 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 326 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 328 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
vpImagePoint vpMeEllipse::iPc |
The coordinates of the ellipse center.
Definition at line 316 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 314 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
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(), 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 344 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 346 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
|
protected |
Second order raw moments.
Definition at line 346 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 346 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
inherited |
Moving edges initialisation parameters.
Definition at line 82 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 342 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Second order central moments.
Definition at line 342 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 342 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
inherited |
Definition at line 84 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 78 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpMeterPixelConversion::convertEllipse(), 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(), vpCircle::projection(), vpSphere::projection(), vpCylinder::projection(), and vpLine::projection().
|
inherited |
Definition at line 175 of file vpMeTracker.h.
Referenced by vpMeTracker::vpMeTracker().
|
protected |
Value of sin(e).
Definition at line 336 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
|
protectedinherited |
Definition at line 87 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 348 of file vpMeEllipse.h.
Referenced by vpMeEllipse().