ViSP
2.9.0
|
#include <vpMeEllipse.h>
Public Member Functions | |
vpMeEllipse () | |
vpMeEllipse (const vpMeEllipse &meellipse) | |
virtual | ~vpMeEllipse () |
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 | display (const vpImage< unsigned char > &I, vpColor col) |
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 () |
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 |
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, vpColor color=vpColor::green) |
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, vpColor color=vpColor::green) |
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 |
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 144 of file vpMeEllipse.cpp.
References angle, vpMeTracker::list, and vpCDEBUG.
|
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 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().
|
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. |
highalpha | : Highest angle. |
color | : Color used to display th lines. |
Definition at line 1228 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. |
highalpha | : Highest angle. |
color | : Color used to display th lines. |
Definition at line 1305 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 187 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 1 order raw moment with .
Definition at line 201 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 222 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 1 order raw moment with .
Definition at line 194 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 208 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order raw moment with .
Definition at line 215 of file vpMeEllipse.h.
Referenced by vpFeatureBuilder::create().
|
inline |
Gets the 2 order central moment .
Definition at line 236 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 229 of file vpMeEllipse.h.
|
inline |
Gets the 2 order central moment .
Definition at line 243 of file vpMeEllipse.h.
|
inline |
Gets the semiminor axis of the ellipse.
Definition at line 253 of file vpMeEllipse.h.
|
inline |
Gets the semimajor axis of the ellipse.
Definition at line 258 of file vpMeEllipse.h.
|
inline |
Gets the center of the ellipse.
Definition at line 248 of file vpMeEllipse.h.
|
inline |
Gets the angle made by the major axis and the i axis of the image frame
Definition at line 263 of file vpMeEllipse.h.
|
inline |
Gets the equation parameters of the ellipse
Definition at line 268 of file vpMeEllipse.h.
|
inline |
Gets the highest angle
Definition at line 278 of file vpMeEllipse.h.
|
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 smallest angle
Definition at line 273 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 vpMeTracker::display(), display(), e, vpDisplay::flush(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpColor::green, vpMeTracker::initTracking(), iP1, iP2, vpMatrix::pseudoInverse(), vpMath::sqr(), track(), vpCDEBUG, 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 1124 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 118 of file vpMeTracker.cpp.
References vpMeTracker::list.
Referenced by vpMeLine::leastSquare(), vpMeNurbs::localReSample(), vpMeLine::reSample(), and vpMeNurbs::reSample().
|
inherited |
Definition at line 134 of file vpMeTracker.cpp.
Referenced by vpMeNurbs::localReSample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeNurbs::seekExtremities(), and vpMeLine::seekExtremities().
|
inherited |
Definition at line 144 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 336 of file vpMeEllipse.cpp.
References iPc.
|
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 180 of file vpMeEllipse.h.
|
inlineinherited |
Definition at line 108 of file vpMeTracker.h.
|
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 |
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 289 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 923 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 313 of file vpMeEllipse.h.
Referenced by display(), and vpMeEllipse().
|
protected |
The smallest angle.
Definition at line 325 of file vpMeEllipse.h.
Referenced by display(), and vpMeEllipse().
|
protected |
The highest angle.
Definition at line 327 of file vpMeEllipse.h.
Referenced by display(), and vpMeEllipse().
|
protected |
Stores the value of the angle for each vpMeSite.
Definition at line 333 of file vpMeEllipse.h.
Referenced by vpMeEllipse(), and ~vpMeEllipse().
double vpMeEllipse::b |
is the semimajor axis of the ellipse.
Definition at line 315 of file vpMeEllipse.h.
Referenced by display(), and vpMeEllipse().
|
protected |
|
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().
double vpMeEllipse::e |
is the angle made by the major axis and the i axis of the image frame .
Definition at line 317 of file vpMeEllipse.h.
Referenced by display(), 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 321 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 323 of file vpMeEllipse.h.
Referenced by initTracking(), and vpMeEllipse().
vpImagePoint vpMeEllipse::iPc |
The coordinates of the ellipse center.
Definition at line 311 of file vpMeEllipse.h.
Referenced by display(), printParameters(), and vpMeEllipse().
vpColVector vpMeEllipse::K |
Parameters of the ellipse to define the set of points that satisfy the implicit equation :
Definition at line 309 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=(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMeLine::setExtremities(), vpMeLine::suppressPoints(), vpMeNurbs::suppressPoints(), vpMeNurbs::supressNearPoints(), vpMeTracker::totalNumberOfSignal(), vpMeTracker::track(), vpMeNurbs::track(), vpMeNurbs::updateDelta(), vpMeLine::updateDelta(), vpMeTracker::vpMeTracker(), ~vpMeEllipse(), vpMeLine::~vpMeLine(), and vpMeTracker::~vpMeTracker().
|
protected |
|
protected |
Definition at line 339 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 341 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
|
protected |
Second order raw moments.
Definition at line 341 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 341 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
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().
|
protected |
Definition at line 337 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Second order central moments.
Definition at line 337 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
protected |
Definition at line 337 of file vpMeEllipse.h.
Referenced by vpMeEllipse().
|
inherited |
Definition at line 84 of file vpMeTracker.h.
Referenced by vpMeTracker::initTracking(), 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 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().
|
protected |
|
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 343 of file vpMeEllipse.h.
Referenced by vpMeEllipse().