39 #include <visp3/core/vpConfig.h>
49 #include <visp3/mbt/vpMbtDistanceCircle.h>
50 #include <visp3/core/vpPlane.h>
51 #include <visp3/core/vpMeterPixelConversion.h>
52 #include <visp3/core/vpPixelMeterConversion.h>
53 #include <visp3/visual_features/vpFeatureBuilder.h>
54 #include <visp3/visual_features/vpFeatureEllipse.h>
55 #include <visp3/vision/vpPose.h>
61 : name(), index(0), cam(), me(NULL), wmean(1),
62 featureEllipse(), isTrackedCircle(true), meEllipse(NULL),
63 circle(NULL), radius(0.), p1(NULL), p2(NULL), p3(NULL),
64 L(), error(), nbFeature(0), Reinit(false),
65 hiddenface(NULL), index_polygon(-1), isvisible(false)
76 if (
p1 != NULL)
delete p1;
77 if (
p2 != NULL)
delete p2;
78 if (
p3 != NULL)
delete p3;
160 std::cout<<
"Problem when projecting circle\n";
174 double mu20_p, mu11_p, mu02_p;
176 meEllipse->initTracking(I, ic, mu20_p, mu11_p, mu02_p);
232 catch(...){std::cout<<
"Problem when projecting circle\n";}
238 double mu20_p, mu11_p, mu02_p;
240 meEllipse->updateParameters(I, ic, mu20_p, mu11_p, mu02_p);
288 const bool displayFullModel )
290 if( (
isvisible && isTrackedCircle) || displayFullModel){
297 catch(...){std::cout<<
"Cannot project the circle";}
300 double mu20_p, mu11_p, mu02_p;
320 const unsigned int thickness,
const bool displayFullModel)
322 if( (
isvisible && isTrackedCircle) || displayFullModel){
329 catch(...){std::cout<<
"Cannot project the circle";}
332 double mu20_p, mu11_p, mu02_p;
389 catch(...){std::cout<<
"Problem projection circle\n";}
407 for(std::list<vpMeSite>::const_iterator it=
meEllipse->getMeList().begin(); it!=
meEllipse->getMeList().end(); ++it){
409 H[0] = 2*(mu11*(y-yg)+mu02*(xg-x));
410 H[1] = 2*(mu20*(yg-y)+mu11*(x-xg));
412 H[3] = 2*(yg*(x-xg)+y*xg+mu11-x*y);
415 for (
unsigned int k=0; k<6; k++)
416 L[j][k] = H[0]*H1[0][k] + H[1]*H1[1][k] + H[2]*H1[2][k] + H[3]*H1[3][k] + H[4]*H1[4][k];
419 + 2*(mu11*yg-mu02*xg)*x + 2*(mu11*xg-mu20*yg)*y
unsigned int getRange() const
Implementation of a matrix and operations on matrices.
static void displayEllipse(const vpImage< unsigned char > &I, const vpImagePoint ¢er, const double &coef1, const double &coef2, const double &coef3, bool use_centered_moments, const vpColor &color, unsigned int thickness=1)
unsigned int nbFeature
The number of moving edges.
vpPoint * p3
An other point on the plane containing the circle.
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
perspective projection of the circle
#define vpDEBUG_ENABLE(level)
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of row vector and the associated operations.
vpMatrix L
The interaction matrix.
Class to define colors available for display functionnalities.
vpColVector error
The error vector.
double get_oY() const
Get the point Y coordinate in the object frame.
void buildFrom(const vpPoint &_p1, const vpPoint &_p2, const vpPoint &_p3, const double r)
vpMbtMeEllipse * meEllipse
The moving edge containers.
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
vpPoint * p2
A point on the plane containing the circle.
static void flush(const vpImage< unsigned char > &I)
Class that defines what is a point.
bool Reinit
Indicates if the circle has to be reinitialized.
bool isvisible
Indicates if the circle is visible or not.
static double sqr(double x)
void trackMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
Generic class defining intrinsic camera parameters.
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
double get_oZ() const
Get the point Z coordinate in the object frame.
void updateMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
vpCircle * circle
The circle to track.
static void convertEllipse(const vpCameraParameters &cam, const vpCircle &circle, vpImagePoint ¢er, double &mu20_p, double &mu11_p, double &mu02_p)
void displayMovingEdges(const vpImage< unsigned char > &I)
bool initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void setMovingEdge(vpMe *Me)
double get_oX() const
Get the point X coordinate in the object frame.
void initInteractionMatrixError()
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
compute the interaction matrix from a subset a the possible features
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
This class defines the container for a plane geometrical structure.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
double radius
The radius of the circle.
Class that defines what is a circle.
vpPoint * p1
The center of the circle.
void setWorldCoordinates(const vpColVector &oP)
void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness=1, const bool displayFullModel=false)
void resize(const unsigned int i, const bool flagNullify=true)