40 #include <visp3/core/vpConfig.h> 50 #include <visp3/core/vpMeterPixelConversion.h> 51 #include <visp3/core/vpPixelMeterConversion.h> 52 #include <visp3/core/vpPlane.h> 53 #include <visp3/mbt/vpMbtDistanceCircle.h> 54 #include <visp3/vision/vpPose.h> 55 #include <visp3/visual_features/vpFeatureBuilder.h> 56 #include <visp3/visual_features/vpFeatureEllipse.h> 62 : name(), index(0), cam(), me(NULL), wmean(1), featureEllipse(), isTrackedCircle(true), meEllipse(NULL), circle(NULL),
63 radius(0.), p1(NULL), p2(NULL), p3(NULL), L(), error(), nbFeature(0), Reinit(false), hiddenface(NULL),
64 index_polygon(-1), isvisible(false)
158 std::cout <<
"Problem when projecting circle\n";
172 double n20_p, n11_p, n02_p;
174 meEllipse->initTracking(I, ic, n20_p, n11_p, n02_p, doNotTrack);
222 std::cout <<
"Problem when projecting circle\n";
228 double n20_p, n11_p, n02_p;
230 meEllipse->updateParameters(I, ic, n20_p, n11_p, n02_p);
274 bool displayFullModel)
279 double n20_p = params[2];
280 double n11_p = params[3];
281 double n02_p = params[4];
298 bool displayFullModel)
303 double n20_p = params[3];
304 double n11_p = params[4];
305 double n02_p = params[5];
315 std::vector<std::vector<double> > features;
318 for (std::list<vpMeSite>::const_iterator it =
meEllipse->getMeList().begin(); it !=
meEllipse->getMeList().end(); ++it) {
320 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 321 std::vector<double> params = {0,
324 static_cast<double>(p_me.
getState())};
326 std::vector<double> params;
330 params.push_back(static_cast<double>(p_me.
getState()));
332 features.push_back(params);
352 bool displayFullModel)
354 std::vector<double> params;
356 if ((
isvisible && isTrackedCircle) || displayFullModel) {
363 std::cout <<
"Cannot project the circle";
367 double n20_p, n11_p, n02_p;
370 params.push_back(center.
get_i());
371 params.push_back(center.
get_j());
372 params.push_back(n20_p);
373 params.push_back(n11_p);
374 params.push_back(n02_p);
434 std::cout <<
"Problem projection circle\n";
453 for (std::list<vpMeSite>::const_iterator it =
meEllipse->getMeList().begin(); it !=
meEllipse->getMeList().end();
456 H[0] = 2 * (n11 * (y - yg) + n02 * (xg - x));
457 H[1] = 2 * (n20 * (yg - y) + n11 * (x - xg));
459 H[3] = 2 * (yg * (x - xg) + y * xg + n11 - x * y);
462 for (
unsigned int k = 0; k < 6; k++)
463 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];
unsigned int getRange() const
Implementation of a matrix and operations on matrices.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int nbFeature
The number of moving edges.
static void convertEllipse(const vpCameraParameters &cam, const vpSphere &sphere, vpImagePoint ¢er_p, double &n20_p, double &n11_p, double &n02_p)
double get_jfloat() const
vpPoint * p3
An other point on the plane containing the circle.
void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)
#define vpDEBUG_ENABLE(level)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void buildFrom(const vpPoint &_p1, const vpPoint &_p2, const vpPoint &_p3, double r)
Implementation of row vector and the associated operations.
vpMatrix L
The interaction matrix.
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
std::vector< double > getModelForDisplay(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false)
Class to define RGB colors available for display functionnalities.
vpMatrix interaction(unsigned int select=FEATURE_ALL)
compute the interaction matrix from a subset a the possible features
bool initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, bool doNotTrack, const vpImage< bool > *mask=NULL)
vpColVector error
The error vector.
double get_oY() const
Get the point oY coordinate in the object frame.
vpMbtMeEllipse * meEllipse
The moving edge containers.
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
vpPoint * p2
A point on the plane containing the circle.
static void flush(const vpImage< unsigned char > &I)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
vpMeSiteState getState() const
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.
virtual ~vpMbtDistanceCircle()
std::vector< std::vector< double > > getFeaturesForDisplay()
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
double get_oZ() const
Get the point oZ coordinate in the object frame.
static void displayEllipse(const vpImage< unsigned char > &I, const vpImagePoint ¢er, const double &coef1, const double &coef2, const double &coef3, bool use_normalized_centered_moments, const vpColor &color, unsigned int thickness=1, bool display_center=false, bool display_arc=false)
void updateMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
vpCircle * circle
The circle to track.
void displayMovingEdges(const vpImage< unsigned char > &I)
void setMovingEdge(vpMe *Me)
double get_oX() const
Get the point oX coordinate in the object frame.
void resize(unsigned int i, bool flagNullify=true)
void initInteractionMatrixError()
double get_ifloat() const
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpImage< bool > *mask=NULL)
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 a 3D circle in the object frame and allows forward projection of a 3D circle in th...
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) const
vpPoint * p1
The center of the circle.
void setWorldCoordinates(const vpColVector &oP)