49 #include <visp/vpDebug.h>
50 #include <visp/vpPose.h>
51 #include <visp/vpExponentialMap.h>
52 #include <visp/vpPixelMeterConversion.h>
53 #include <visp/vpImageIo.h>
54 #include <visp/vpRobust.h>
55 #include <visp/vpDisplayOpenCV.h>
56 #include <visp/vpDisplayX.h>
57 #include <visp/vpDisplayGDI.h>
58 #include <visp/vpMatrixException.h>
59 #include <visp/vpMath.h>
60 #include <visp/vpException.h>
61 #include <visp/vpTrackingException.h>
62 #include <visp/vpMbEdgeTracker.h>
63 #include <visp/vpMbtDistanceLine.h>
64 #include <visp/vpMbtXmlParser.h>
65 #include <visp/vpMbtPolygon.h>
72 bool samePoint(
const vpPoint &P1,
const vpPoint &P2,
double threshold);
78 : compute_interaction(1), lambda(1), me(), lines(1), cylinders(1), nline(0), ncylinder(0),
79 index_polygon(0), faces(), nbvisiblepolygone(0), percentageGdPt(0.4), scales(1),
80 Ipyramid(0), scaleLevel(0), useOgre(false),
81 angleAppears(
vpMath::rad(89) ), angleDisappears(
vpMath::rad(89) ),
82 distNearClip(0.001), distFarClip(100), clippingFlag(
vpMbtPolygon::NO_CLIPPING)
99 for (
unsigned int i = 0; i <
lines.size(); i += 1){
101 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
109 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
134 for (
unsigned int i = 0; i <
scales.size(); i += 1){
136 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
137 (*it)->setMovingEdge(&(this->
me)) ;
141 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
161 #ifndef VISP_HAVE_OGRE
163 std::cout <<
"WARNING: ViSP doesn't have Ogre3D, basic visibility test will be used. setOgreVisibilityTest() set to false." << std::endl;
179 double residu_1 =1e3;
192 unsigned int iter = 0;
195 unsigned int nbrow = 0;
196 unsigned int nberrors_lines = 0;
197 unsigned int nberrors_cylinders = 0;
214 vpERROR_TRACE(
"\n\t\t Error-> not enough data in the interaction matrix...") ;
222 unsigned int nerror = error.
getRows();
229 double e_prev = 0, e_cur, e_next;
234 while ( reloop ==
true && iter<10)
238 weighted_error.
resize(nerror) ;
257 int index = *itindex;
271 std::list<vpMeSite>::const_iterator itListLine;
272 if (iter == 0 && l->
meline != NULL)
275 for (
unsigned int i=0 ; i < l->
nbFeature ; i++)
277 for (
unsigned int j=0; j < 6 ; j++)
279 L[n+i][j] = l->
L[i][j];
281 error[n+i] = l->
error[i];
283 if (error[n+i] <= limite) count = count+1.0;
301 e_next = l->
error[1];
324 e_next = l->
error[i+1];
325 if ( fabs(e_cur - e_prev) < limite )
329 if ( fabs(e_cur - e_next) < limite )
346 std::list<vpMeSite>::const_iterator itCyl1;
347 std::list<vpMeSite>::const_iterator itCyl2;
353 for(
unsigned int i=0 ; i < cy->
nbFeature ; i++){
354 for(
unsigned int j=0; j < 6 ; j++){
355 L[n+i][j] = cy->
L[i][j];
357 error[n+i] = cy->
error[i];
359 if (error[n+i] <= limite) count = count+1.0;
367 if(i<cy->nbFeaturel1) {
381 e_cur = cy->
error[0];
384 e_next = cy->
error[1];
395 e_cur = cy->
error[i];
398 e_next = cy->
error[i+1];
411 e_cur = cy->
error[i];
420 e_cur = cy->
error[i];
429 e_cur = cy->
error[i];
430 e_next = cy->
error[i+1];
431 if ( fabs(e_cur - e_prev) < limite ){
434 if ( fabs(e_cur - e_next) < limite ){
444 count = count / (double)nbrow;
452 double wi ;
double eri ;
453 for(
unsigned int i = 0; i < nerror; i++){
459 weighted_error[i] = wi*eri ;
463 for (
unsigned int i=0 ; i < nerror ; i++){
464 for (
unsigned int j=0 ; j < 6 ; j++){
465 L[i][j] = w[i]*factor[i]*L[i][j] ;
481 vpRobust robust_lines(nberrors_lines);
482 vpRobust robust_cylinders(nberrors_cylinders);
495 while ( ((
int)((residu_1 - r)*1e8) !=0 ) && (iter<30))
498 unsigned int nlines = 0;
499 unsigned int ncylinders = 0;
503 for (
unsigned int i=0 ; i < l->
nbFeature ; i++){
504 for (
unsigned int j=0; j < 6 ; j++){
505 L[n+i][j] = l->
L[i][j];
506 error[n+i] = l->
error[i];
507 error_lines[nlines+i] = error[n+i];
517 for(
unsigned int i=0 ; i < cy->
nbFeature ; i++){
518 for(
unsigned int j=0; j < 6 ; j++){
519 L[n+i][j] = cy->
L[i][j];
520 error[n+i] = cy->
error[i];
521 error_cylinders[ncylinders+i] = error[n+i];
531 weighted_error.
resize(nerror);
534 w_lines.
resize(nberrors_lines);
536 w_cylinders.
resize(nberrors_cylinders);
541 if(nberrors_lines > 0)
543 if(nberrors_cylinders > 0){
551 if(nberrors_lines > 0)
553 if(nberrors_cylinders > 0){
558 unsigned int cpt = 0;
560 if(cpt<nberrors_lines){
561 w[cpt] = w_lines[cpt];
564 w[cpt] = w_cylinders[cpt-nberrors_lines];
579 for(
unsigned int i=0; i<nerror; i++){
586 weighted_error[i] = wi*eri ;
592 for (
unsigned int i=0 ; i < nerror ; i++){
593 for (
unsigned int j=0 ; j < 6 ; j++){
594 L[i][j] = w[i]*factor[i]*L[i][j];
618 std::list<vpMeSite>::iterator itListLine;
621 for (
unsigned int i=0 ; i < l->
nbFeature ; i++){
651 std::list<vpMeSite>::iterator itListCyl1;
652 std::list<vpMeSite>::iterator itListCyl2;
683 for(
unsigned int i=cy->
nbFeaturel1 ; i < cy->nbFeature ; i++){
718 int nbExpectedPoint = 0;
760 || nbExpectedPoint < 2)
780 unsigned int lvl = (
unsigned int)
scales.size();
795 vpTRACE(
"Error in moving edge tracking") ;
802 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
810 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
821 vpTRACE(
"Error in computeVVS") ;
837 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
844 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
857 vpTRACE(
"Error in moving edge updating") ;
862 bool newvisibleface = false ;
897 #ifdef VISP_HAVE_OGRE
908 unsigned int i = (
unsigned int)
scales.size();
1019 #ifdef VISP_HAVE_XML2
1028 std::cout <<
" *********** Parsing XML for Mb Edge Tracker ************ " << std::endl;
1029 xmlp.
parse(configFile);
1039 xmlp.
getMe(meParser);
1056 vpTRACE(
"You need the libXML2 to read the config file %s", configFile);
1074 const unsigned int thickness,
const bool displayFullModel)
1078 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1082 l->
display(I,cMo_, camera, col, thickness, displayFullModel);
1086 (*it)->display(I, cMo_, camera, col, thickness);
1093 #ifdef VISP_HAVE_OGRE
1112 const unsigned int thickness,
const bool displayFullModel)
1116 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1120 l->
display(I, cMo_, camera, col, thickness, displayFullModel) ;
1124 (*it)->display(I, cMo_, camera, col, thickness) ;
1131 #ifdef VISP_HAVE_OGRE
1153 bool isvisible = false ;
1156 int index = *itindex;
1157 if (index ==-1) isvisible =true ;
1290 bool samePoint(
const vpPoint &P1,
const vpPoint &P2,
double threshold=1e-5)
1317 bool already_here = false ;
1320 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1323 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1325 if((samePoint(*(l->
p1),P1) && samePoint(*(l->
p2),P2)) ||
1326 (samePoint(*(l->
p1),P2) && samePoint(*(l->
p2),P1)) ){
1327 already_here = true ;
1354 lines[i].push_back(l);
1371 for(
unsigned int i=0; i<
scales.size(); i++){
1373 for(std::list<vpMbtDistanceLine*>::iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1375 if (name.compare(l->
getName()) == 0){
1398 bool already_here = false ;
1401 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1404 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1406 if((samePoint(*(cy->
p1),P1) && samePoint(*(cy->
p2),P2)) ||
1407 (samePoint(*(cy->
p1),P2) && samePoint(*(cy->
p2),P1)) ){
1439 for(
unsigned int i=0; i<
scales.size(); i++){
1441 for(std::list<vpMbtDistanceCylinder*>::iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1443 if (name.compare(cy->
getName()) == 0){
1465 for (
unsigned int i=0 ; i < nbpt-1 ; i++)
1474 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
1494 #ifdef VISP_HAVE_OGRE
1495 bool changed =
false;
1506 newvisibleline = true ;
1509 newvisibleline = false ;
1513 #endif //VISP_BUILD_DEPRECATED_FUNCTIONS
1530 bool changed =
false;
1537 #ifdef VISP_HAVE_OGRE
1548 newvisibleline = true ;
1551 newvisibleline = false ;
1568 std::string model(file);
1599 polygon->
setNbPoint((
unsigned int)_corners.size());
1600 polygon->
setIndex((
int)_indexFace);
1601 for(
unsigned int j = 0; j < _corners.size(); j++) {
1622 if(indexCylinder != 0){
1640 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1642 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1644 if (l!=NULL)
delete l ;
1648 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1650 if (cy!=NULL)
delete cy;
1693 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1695 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1697 if (l!=NULL)
delete l ;
1701 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1703 if (cy!=NULL)
delete cy;
1741 unsigned int nbGoodPoints = 0;
1743 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[level].begin(); it!=
lines[level].end(); ++it){
1754 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[level].begin(); it!=
cylinders[level].end(); ++it){
1767 return nbGoodPoints;
1783 if(index >= static_cast<unsigned int>(
faces.
size()) ){
1787 return faces[index];
1798 return static_cast<unsigned int>(
faces.
size());
1824 unsigned int nbActivatedLevels = 0;
1825 for (
unsigned int i = 0; i < scale.size(); i += 1){
1827 nbActivatedLevels++;
1830 if((scale.size() < 1) || (nbActivatedLevels == 0)){
1831 vpERROR_TRACE(
" !! WARNING : must use at least one level for the tracking. Use the global one");
1833 this->
scales.push_back(
true);
1841 lines.resize(scale.size());
1843 for (
unsigned int i = 0; i <
lines.size(); i += 1){
1859 vpTRACE(
"Far clipping value cannot be inferior than near clipping value. Far clipping won't be considered.");
1860 else if ( dist < 0 )
1861 vpTRACE(
"Far clipping value cannot be inferior than 0. Far clipping won't be considered.");
1867 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1869 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1887 vpTRACE(
"Near clipping value cannot be superior than far clipping value. Near clipping won't be considered.");
1888 else if ( dist < 0 )
1889 vpTRACE(
"Near clipping value cannot be inferior than 0. Near clipping won't be considered.");
1895 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1897 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1920 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1922 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1947 _pyramid.resize(
scales.size());
1956 for(
unsigned int i=1; i<_pyramid.size(); i += 1){
1958 unsigned int cScale =
static_cast<unsigned int>(pow(2., (
int)i));
1960 #ifdef VISP_HAVE_OPENCV
1961 IplImage* vpI0 = cvCreateImageHeader(cvSize((
int)_I.
getWidth(), (int)_I.
getHeight()), IPL_DEPTH_8U, 1);
1962 vpI0->imageData = (
char*)(_I.
bitmap);
1963 IplImage* vpI = cvCreateImage(cvSize((
int)(_I.
getWidth() / cScale), (
int)(_I.
getHeight() / cScale)), IPL_DEPTH_8U, 1);
1964 cvResize(vpI0, vpI, CV_INTER_NN);
1966 cvReleaseImage(&vpI);
1967 vpI0->imageData = NULL;
1968 cvReleaseImageHeader(&vpI0);
1970 for (
unsigned int k = 0, ii = 0; k < I->
getHeight(); k += 1, ii += cScale){
1971 for (
unsigned int l = 0, jj = 0; l < I->
getWidth(); l += 1, jj += cScale){
1972 (*I)[k][l] = _I[ii][jj];
1993 if(_pyramid.size() > 0){
1995 for (
unsigned int i = 1; i < _pyramid.size(); i += 1){
1996 if(_pyramid[i] != NULL){
2019 std::ostringstream oss;
2021 std::string errorMsg =
"level " + oss.str() +
" is not used, cannot get its distance lines.";
2025 linesList =
lines[level];
2043 std::ostringstream oss;
2045 std::string errorMsg =
"level " + oss.str() +
" is not used, cannot get its distance lines.";
2062 const double ratio = pow(2., (
int)_scale);
2084 const double ratio = pow(2., (
int)_scale);
void setWindowName(const Ogre::String &n)
double distFarClip
Distance for near clipping.
unsigned int ncylinder
Index of the cylinder to add, and total number of polygon extracted so far.
void setMovingEdge(vpMe *Me)
Definition of the vpMatrix class.
void displayMovingEdges(const vpImage< unsigned char > &I)
vpMatrix covarianceMatrix
Covariance matrix.
void initFromCalibrationMatrix(const vpMatrix &_K)
void updateMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void setFarClippingDistance(const double &dist)
void setMovingEdge(const vpMe &me)
void setClipping(const unsigned int &flags)
void setVisible(bool _isvisible)
void trackMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void upScale(const unsigned int _scale)
std::string getName() const
void updateMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
Compute the weights according a residue vector and a PsiFunction.
bool isAppearing(const unsigned int i)
unsigned int getWidth() const
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
void getCameraParameters(vpCameraParameters &_cam) const
bool Reinit
Indicates if the line has to be reinitialized.
void setMeanWeight2(const double wmean)
void computeVVS(const vpImage< unsigned char > &_I)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void init(const vpImage< unsigned char > &I)
void track(const vpImage< unsigned char > &I)
double lambda
The gain of the virtual visual servoing stage.
unsigned int scaleLevel
Current scale level used. This attribute must not be modified outside of the downScale() and upScale(...
std::list< int > Lindex_polygon
Index of the faces which contain the line.
Type * bitmap
points toward the bitmap
void setCameraParameters(const vpCameraParameters &camera)
void setIdentity()
Basic initialisation (identity)
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
Class to define colors available for display functionnalities.
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
void trackMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void setBackgroundSizeOgre(const unsigned int &h, const unsigned int &w)
vpHomogeneousMatrix cMo
The current pose.
vpPoint * p1
The first extremity.
double distNearClip
Distance for near clipping.
void displayMovingEdges(const vpImage< unsigned char > &I)
double getNearClippingDistance() const
virtual ~vpMbEdgeTracker()
double get_oY() const
Get the point Y coordinate in the object frame.
void getMe(vpMe &_ecm) const
error that can be emited by ViSP classes.
void computeJTR(const vpMatrix &J, const vpColVector &R, vpMatrix &JTR)
Manage a cylinder used in the model-based tracker.
void reInitLevel(const unsigned int _lvl)
Contains predetermined masks for sites and holds moving edges tracking parameters.
Manage the line of a polygon used in the model-based tracker.
unsigned int nbFeature
The number of moving edges.
Provides simple mathematics computation tools that are not available in the C mathematics library (ma...
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)
std::vector< const vpImage< unsigned char > * > Ipyramid
Pyramid of image associated to the current image. This pyramid is computed in the init() and in the t...
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const unsigned int indexCylinder=0)
void getLcylinder(std::list< vpMbtDistanceCylinder * > &cylindersList, const unsigned int level=0)
void setIndex(const unsigned int i)
virtual void setCameraParameters(const vpCameraParameters &camera)
virtual void initFromPose(const vpImage< unsigned char > &I, const std::string &initFile)
unsigned int setVisibleOgre(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed)
void removeCylinder(const std::string &name)
vpMbtPolygon & getPolygon()
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
double angleDisappears
Angle used to detect a face disappearance.
void loadConfigFile(const std::string &configFile)
vpMe me
The moving edges parameters.
void updateMovingEdge(const vpImage< unsigned char > &I)
std::vector< std::list< vpMbtDistanceLine * > > lines
Vector of list of all the lines tracked (each line is linked to a list of moving edges). Each element of the vector is for a scale (element 0 = level 0 = no subsampling).
unsigned int getNbPoints(const unsigned int level=0) const
void setNearClippingDistance(const double &dist)
vpPoint * p1
The first extremity on the axe.
void initInteractionMatrixError()
static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b)
bool useOgre
Use Ogre3d for visibility tests.
unsigned int nbFeature
The number of moving edges.
void downScale(const unsigned int _scale)
bool hasNearClippingDistance() const
Class that defines what is a point.
vpMatrix L
The interaction matrix.
vpMeSiteState getState() const
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 addLine(vpPoint &p1, vpPoint &p2, int polygone=-1, std::string name="")
vpCameraParameters cam
The camera parameters.
unsigned int setVisible(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, const double &angle, bool &changed)
static Type maximum(const Type &a, const Type &b)
virtual void setNearClippingDistance(const double &dist)
double getFarClippingDistance() const
void initOgre(const vpCameraParameters &cam=vpCameraParameters())
unsigned int nbFeaturel1
The number of moving edges on line 1.
bool hasFarClippingDistance() const
int index_polygon
Index of the polygon to add, and total number of polygon extracted so far. Cannot be unsigned because...
void addPoint(const unsigned int n, const vpPoint &P)
vpAROgre * getOgreContext()
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
std::vector< bool > scales
Vector of scale level to use for the multi-scale tracking.
void getLline(std::list< vpMbtDistanceLine * > &linesList, const unsigned int level=0)
Error that can be emited by the vpTracker class and its derivates.
double getAngleDisappear() const
Implementation of a polygon of the model used by the model-based tracker.
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
vpPoint * p2
The second extremity.
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
static double sqr(double x)
void setAngleDisappear(const double &adisappear)
vpColVector error
The error vector.
Generic class defining intrinsic camera parameters.
virtual void loadModel(const std::string &modelFile)
double get_oZ() const
Get the point Z coordinate in the object frame.
void setIndex(const unsigned int i)
double percentageGdPt
Percentage of good points over total number of points below which tracking is supposed to have failed...
void initPyramid(const vpImage< unsigned char > &_I, std::vector< const vpImage< unsigned char > * > &_pyramid)
void cleanPyramid(std::vector< const vpImage< unsigned char > * > &_pyramid)
vpMbtMeLine * meline1
The moving edge containers (first line of the cylinder)
double angleAppears
Angle used to detect a face appearance.
virtual void setFarClippingDistance(const double &dist)
virtual void initFaceFromCorners(const std::vector< vpPoint > &_corners, const unsigned int _indexFace=-1)
std::list< vpMeSite > & getMeList()
void reInitModel(const vpImage< unsigned char > &I, const char *cad_name, const vpHomogeneousMatrix &cMo)
void setCameraParameters(const vpCameraParameters &_cam)
void addPolygon(PolygonType *p)
void setState(const vpMeSiteState &flag)
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
static double rad(double deg)
void parse(const char *filename)
void setMeanWeight1(const double wmean)
void diag(const vpColVector &A)
virtual void setOgreVisibilityTest(const bool &v)
unsigned int size() const
void setScales(const std::vector< bool > &_scales)
vpPoint * p2
The second extremity on the axe.
void setCameraParameters(const vpCameraParameters &camera)
double get_oX() const
Get the point X coordinate in the object frame.
bool closeToImageBorder(const vpImage< unsigned char > &I, const unsigned int threshold)
static double deg(double rad)
bool displayFeatures
If true, the features are displayed.
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void buildFrom(const vpPoint &_p1, const vpPoint &_p2, const double r)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
std::vector< std::list< vpMbtDistanceCylinder * > > cylinders
Vector of the tracked cylinders.
void setAngleAppear(const double &aappear)
void setMovingEdge(vpMe *Me)
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
vpHomogeneousMatrix inverse() const
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
static vpHomogeneousMatrix direct(const vpColVector &v)
void addCylinder(const vpPoint &P1, const vpPoint &P2, const double r, const std::string &name="")
bool isVisible(const unsigned int i)
Contains an M-Estimator and various influence function.
unsigned int nbvisiblepolygone
Number of polygon (face) currently visible.
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 visibleFace(const vpImage< unsigned char > &_I, const vpHomogeneousMatrix &_cMo, bool &newvisibleline)
unsigned int getHeight() const
unsigned int getNbPolygon() const
void setMeanWeight(const double w_mean)
vpColVector error
The error vector.
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Compute the pseudo inverse of the matrix using the SVD.
bool Reinit
Indicates if the line has to be reinitialized.
vpMbHiddenFaces< vpMbtPolygon > faces
Set of faces describing the object.
double radius
The radius of the cylinder.
unsigned int getNbPoint() const
unsigned int nline
Index of the polygon to add, and total number of polygon extracted so far.
void addPolygon(vpMbtPolygon &p)
void setName(const std::string line_name)
void trackMovingEdge(const vpImage< unsigned char > &I)
void displayOgre(const vpHomogeneousMatrix &cMo)
unsigned int clippingFlag
Flags specifying which clipping to used.
void loadModel(const std::string &cad_name)
double getAngleAppear() const
virtual void setClipping(const unsigned int &flags)
unsigned int nbFeaturel2
The number of moving edges on line 2.
void setThreshold(const double noise_threshold)
unsigned int getRows() const
Return the number of rows of the matrix.
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void setName(const std::string &cyl_name)
static int sign(double x)
virtual void setNbPoint(const unsigned int nb)
vpMbtMeLine * meline2
The moving edge containers (second line of the cylinder)
void removeLine(const std::string &name)
bool getFovClipping() const
void setIteration(const unsigned int iter)
Set iteration.
vpMatrix L
The interaction matrix.
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo, const vpImage< unsigned char > &I)
void initInteractionMatrixError()
void setMovingEdge(const vpMe &_ecm)
std::string getName() const
vpMbtMeLine * meline
The moving edge container.
vpMbtPolygon * getPolygon(const unsigned int index)
void buildFrom(vpPoint &_p1, vpPoint &_p2)
void resize(const unsigned int i, const bool flagNullify=true)
virtual void setIndex(const int i)
vpPoint * p
corners in the object frame