51 #include <visp/vpDebug.h>
52 #include <visp/vpPose.h>
53 #include <visp/vpExponentialMap.h>
54 #include <visp/vpPixelMeterConversion.h>
55 #include <visp/vpImageIo.h>
56 #include <visp/vpRobust.h>
57 #include <visp/vpDisplayOpenCV.h>
58 #include <visp/vpDisplayX.h>
59 #include <visp/vpDisplayGDI.h>
60 #include <visp/vpMatrixException.h>
61 #include <visp/vpMath.h>
62 #include <visp/vpException.h>
63 #include <visp/vpTrackingException.h>
64 #include <visp/vpMbEdgeTracker.h>
65 #include <visp/vpMbtDistanceLine.h>
66 #include <visp/vpMbtXmlParser.h>
102 vpMbtDistanceLine *l ;
103 vpMbtDistanceCylinder *c;
105 for (
unsigned int i = 0; i <
lines.size(); i += 1){
107 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
115 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
140 for (
unsigned int i = 0; i <
scales.size(); i += 1){
142 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
143 (*it)->setMovingEdge(&
me) ;
146 vpMbtDistanceCylinder *cy;
147 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
149 cy->setMovingEdge(&
me) ;
167 double residu_1 =1e3;
173 vpMbtDistanceLine *l ;
174 vpMbtDistanceCylinder *cy ;
180 unsigned int iter = 0;
183 unsigned int nbrow = 0;
184 unsigned int nberrors_lines = 0;
185 unsigned int nberrors_cylinders = 0;
189 nbrow += l->nbFeature ;
190 nberrors_lines+=l->nbFeature;
191 l->initInteractionMatrixError() ;
196 nbrow += cy->nbFeature ;
197 nberrors_cylinders += cy->nbFeature ;
198 cy->initInteractionMatrixError() ;
202 vpERROR_TRACE(
"\n\t\t Error-> not enough data in the interaction matrix...") ;
210 unsigned int nerror = error.
getRows();
217 double e_prev = 0, e_cur, e_next;
223 while ( reloop ==
true && iter<10)
227 weighted_error.
resize(nerror) ;
240 l->computeInteractionMatrixError(
cMo);
245 for(std::list<int>::const_iterator it = l->Lindex_polygon.begin(); it!=l->Lindex_polygon.end(); ++it){
247 if (l->hiddenface->isAppearing(index))
252 if(l->closeToImageBorder(_I, 10))
260 std::list<vpMeSite>::const_iterator itListLine;
261 if (iter == 0 && l->meline != NULL)
262 itListLine = l->meline->getMeList().begin();
264 for (
unsigned int i=0 ; i < l->nbFeature ; i++)
266 for (
unsigned int j=0; j < 6 ; j++)
268 L[n+i][j] = l->L[i][j];
270 error[n+i] = l->error[i];
272 if (error[n+i] <= limite) count = count+1.0;
288 if (l->nbFeature > 1)
290 e_next = l->error[1];
301 else if(i == l->nbFeature-1)
313 e_next = l->error[i+1];
314 if ( fabs(e_cur - e_prev) < limite )
318 if ( fabs(e_cur - e_next) < limite )
332 cy->computeInteractionMatrixError(
cMo, _I);
335 std::list<vpMeSite>::const_iterator itCyl1;
336 std::list<vpMeSite>::const_iterator itCyl2;
337 if (iter == 0 && (cy->meline1 != NULL || cy->meline2 != NULL)){
338 itCyl1 = cy->meline1->getMeList().begin();
339 itCyl2 = cy->meline2->getMeList().begin();
342 for(
unsigned int i=0 ; i < cy->nbFeature ; i++){
343 for(
unsigned int j=0; j < 6 ; j++){
344 L[n+i][j] = cy->L[i][j];
346 error[n+i] = cy->error[i];
348 if (error[n+i] <= limite) count = count+1.0;
356 if(i<cy->nbFeaturel1) {
370 e_cur = cy->error[0];
371 if (cy->nbFeature > 1)
373 e_next = cy->error[1];
382 if (i == cy->nbFeaturel1)
384 e_cur = cy->error[i];
385 if (cy->nbFeaturel2 > 1)
387 e_next = cy->error[i+1];
398 else if(i == cy->nbFeaturel1-1)
400 e_cur = cy->error[i];
407 else if(i == cy->nbFeature-1)
409 e_cur = cy->error[i];
418 e_cur = cy->error[i];
419 e_next = cy->error[i+1];
420 if ( fabs(e_cur - e_prev) < limite ){
423 if ( fabs(e_cur - e_next) < limite ){
433 count = count / (double)nbrow;
441 double wi ;
double eri ;
442 for(
unsigned int i = 0; i < nerror; i++){
448 weighted_error[i] = wi*eri ;
452 for (
unsigned int i=0 ; i < nerror ; i++){
453 for (
unsigned int j=0 ; j < 6 ; j++){
454 L[i][j] = w[i]*factor[i]*L[i][j] ;
470 vpRobust robust_lines(nberrors_lines);
471 vpRobust robust_cylinders(nberrors_cylinders);
484 while ( ((
int)((residu_1 - r)*1e8) !=0 ) && (iter<30))
487 unsigned int nlines = 0;
488 unsigned int ncylinders = 0;
491 l->computeInteractionMatrixError(
cMo) ;
492 for (
unsigned int i=0 ; i < l->nbFeature ; i++){
493 for (
unsigned int j=0; j < 6 ; j++){
494 L[n+i][j] = l->L[i][j];
495 error[n+i] = l->error[i];
496 error_lines[nlines+i] = error[n+i];
500 nlines+= l->nbFeature;
505 cy->computeInteractionMatrixError(
cMo, _I) ;
506 for(
unsigned int i=0 ; i < cy->nbFeature ; i++){
507 for(
unsigned int j=0; j < 6 ; j++){
508 L[n+i][j] = cy->L[i][j];
509 error[n+i] = cy->error[i];
510 error_cylinders[ncylinders+i] = error[n+i];
515 ncylinders+= cy->nbFeature ;
520 weighted_error.
resize(nerror);
523 w_lines.
resize(nberrors_lines);
525 w_cylinders.
resize(nberrors_cylinders);
530 if(nberrors_lines > 0)
532 if(nberrors_cylinders > 0){
540 if(nberrors_lines > 0)
542 if(nberrors_cylinders > 0){
547 unsigned int cpt = 0;
549 if(cpt<nberrors_lines){
550 w[cpt] = w_lines[cpt];
553 w[cpt] = w_cylinders[cpt-nberrors_lines];
568 for(
unsigned int i=0; i<nerror; i++){
575 weighted_error[i] = wi*eri ;
581 for (
unsigned int i=0 ; i < nerror ; i++){
582 for (
unsigned int j=0 ; j < 6 ; j++){
583 L[i][j] = w[i]*factor[i]*L[i][j];
608 std::list<vpMeSite>::iterator itListLine;
609 if (l->nbFeature > 0) itListLine = l->meline->getMeList().begin();
611 for (
unsigned int i=0 ; i < l->nbFeature ; i++){
625 wmean /= l->nbFeature ;
629 l->setMeanWeight(wmean);
641 std::list<vpMeSite>::iterator itListCyl1;
642 std::list<vpMeSite>::iterator itListCyl2;
643 if (cy->nbFeature > 0){
644 itListCyl1 = cy->meline1->getMeList().begin();
645 itListCyl2 = cy->meline2->getMeList().begin();
649 for(
unsigned int i=0 ; i < cy->nbFeaturel1 ; i++){
661 if (cy->nbFeaturel1!=0)
662 wmean /= cy->nbFeaturel1 ;
666 cy->setMeanWeight1(wmean);
673 for(
unsigned int i=cy->nbFeaturel1 ; i < cy->nbFeature ; i++){
685 if (cy->nbFeaturel2!=0)
686 wmean /= cy->nbFeaturel2 ;
690 cy->setMeanWeight2(wmean);
708 int nbExpectedPoint = 0;
712 vpMbtDistanceLine *l ;
715 if (l->isVisible() && l->meline != NULL)
717 nbExpectedPoint += (int)l->meline->expecteddensity;
718 for(std::list<vpMeSite>::const_iterator it=l->meline->getMeList().begin(); it!=l->meline->getMeList().end(); ++it){
727 vpMbtDistanceCylinder *cy ;
730 if (cy->meline1 !=NULL && cy->meline2 != NULL)
732 nbExpectedPoint += (int)cy->meline1->expecteddensity;
733 for(std::list<vpMeSite>::const_iterator it=cy->meline1->getMeList().begin(); it!=cy->meline1->getMeList().end(); ++it){
738 nbExpectedPoint += (int)cy->meline2->expecteddensity;
739 for(std::list<vpMeSite>::const_iterator it=cy->meline2->getMeList().begin(); it!=cy->meline2->getMeList().end(); ++it){
747 if (nbGoodPoint <
percentageGdPt *(nbGoodPoint+nbBadPoint) || nbExpectedPoint < 2)
749 std::cout <<
"nbGoodPoint :" << nbGoodPoint << std::endl;
750 std::cout <<
"nbBadPoint :" << nbBadPoint << std::endl;
751 std::cout <<
"nbExpectedPoint :" << nbExpectedPoint << std::endl;
771 unsigned int lvl =
scales.size();
786 vpTRACE(
"Error in moving edge tracking") ;
792 vpMbtDistanceLine *l ;
793 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
796 l->initInteractionMatrixError() ;
800 vpMbtDistanceCylinder *cy ;
801 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
803 cy->initInteractionMatrixError();
812 vpTRACE(
"Error in computeVVS") ;
828 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
831 l->displayMovingEdges(I);
835 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
837 cy->displayMovingEdges(I);
848 vpTRACE(
"Error in moving edge updating") ;
853 bool newvisibleface = false ;
890 unsigned int i=
scales.size();
935 #ifdef VISP_HAVE_XML2
939 xmlp.parse(filename);
948 xmlp.getCameraParameters(camera);
949 xmlp.getMe(meParser);
953 vpTRACE(
"You need the libXML2 to read the config file %s", filename);
971 const unsigned int thickness,
const bool displayFullModel)
973 vpMbtDistanceLine *l ;
975 for (
unsigned int i = 0; i <
scales.size(); i += 1){
979 l->display(I,_cMo, cam, col, thickness, displayFullModel);
983 (*it)->display(I, _cMo, cam, col, thickness);
1004 const unsigned int thickness,
const bool displayFullModel)
1006 vpMbtDistanceLine *l ;
1008 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1012 l->display(I,_cMo, cam, col, thickness, displayFullModel) ;
1016 (*it)->display(I, _cMo, cam, col, thickness) ;
1035 vpMbtDistanceLine *l ;
1040 bool isvisible = false ;
1042 for(std::list<int>::const_iterator it=l->Lindex_polygon.begin(); it!=l->Lindex_polygon.end(); ++it){
1044 if (index ==-1) isvisible =true ;
1047 if (l->hiddenface->isVisible(index)) isvisible =
true ;
1052 if (l->Lindex_polygon.empty()) isvisible =
true;
1056 l->setVisible(
true) ;
1057 if (l->meline==NULL)
1060 l->initMovingEdge(I, _cMo) ;
1065 l->setVisible(
false) ;
1066 if (l->meline!=NULL)
delete l->meline;
1072 vpMbtDistanceCylinder *cy ;
1075 if (cy->meline1==NULL || cy->meline2==NULL){
1076 cy->initMovingEdge(I, _cMo) ;
1090 vpMbtDistanceLine *l ;
1093 if(l->isVisible() ==
true){
1094 if(l->meline == NULL){
1095 l->initMovingEdge(I,
cMo);
1097 l->trackMovingEdge(I,
cMo) ;
1101 vpMbtDistanceCylinder *cy;
1104 if(cy->meline1 == NULL || cy->meline2 == NULL){
1105 cy->initMovingEdge(I,
cMo);
1107 cy->trackMovingEdge(I,
cMo) ;
1120 vpMbtDistanceLine *l ;
1123 l->updateMovingEdge(I,
cMo) ;
1124 if (l->nbFeature == 0 && l->isVisible()){
1130 vpMbtDistanceCylinder *cy ;
1133 cy->updateMovingEdge(I,
cMo) ;
1134 if(cy->nbFeaturel1 == 0 || cy->nbFeaturel2 == 0){
1152 vpMbtDistanceLine *l ;
1155 if (l->Reinit && l->isVisible())
1156 l->reinitMovingEdge(I, _cMo);
1159 vpMbtDistanceCylinder*cy;
1163 cy->reinitMovingEdge(I, _cMo);
1177 bool samePoint(
const vpPoint &P1,
const vpPoint &P2,
double threshold=1e-5)
1204 bool already_here = false ;
1205 vpMbtDistanceLine *l ;
1207 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1210 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1212 if((samePoint(*(l->p1),P1) && samePoint(*(l->p2),P2)) ||
1213 (samePoint(*(l->p1),P2) && samePoint(*(l->p2),P1)) ){
1214 already_here = true ;
1215 l->Lindex_polygon.push_back(polygone);
1216 l->hiddenface = &
faces ;
1221 l =
new vpMbtDistanceLine ;
1223 l->setCameraParameters(
cam) ;
1224 l->buildFrom(P1,P2) ;
1225 l->Lindex_polygon.push_back(polygone);
1226 l->setMovingEdge(&
me) ;
1227 l->hiddenface = &
faces ;
1228 l->setIndex(
nline) ;
1231 lines[i].push_back(l);
1246 vpMbtDistanceLine *l;
1248 for(
unsigned int i=0; i<
scales.size(); i++){
1250 for(std::list<vpMbtDistanceLine*>::iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1252 if (name.compare(l->getName()) == 0){
1275 bool already_here = false ;
1276 vpMbtDistanceCylinder *cy ;
1278 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1281 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1283 if((samePoint(*(cy->p1),P1) && samePoint(*(cy->p2),P2)) ||
1284 (samePoint(*(cy->p1),P2) && samePoint(*(cy->p2),P1)) ){
1285 already_here = (std::fabs(cy->radius - r) < std::numeric_limits<double>::epsilon() *
vpMath::maximum(cy->radius, r));
1290 cy =
new vpMbtDistanceCylinder ;
1292 cy->setCameraParameters(
cam);
1293 cy->buildFrom(P1, P2, r);
1294 cy->setMovingEdge(&
me);
1314 vpMbtDistanceCylinder *cy;
1316 for(
unsigned int i=0; i<
scales.size(); i++){
1318 for(std::list<vpMbtDistanceCylinder*>::iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1320 if (name.compare(cy->getName()) == 0){
1338 faces.addPolygon(&p) ;
1340 unsigned int nbpt = p.getNbPoint() ;
1342 for (
unsigned int i=0 ; i < nbpt-1 ; i++)
1365 n =
faces.setVisible(cMo) ;
1370 newvisibleline = true ;
1373 newvisibleline = false ;
1390 std::string model(file);
1419 vpMbtPolygon *polygon = NULL;
1420 polygon =
new vpMbtPolygon;
1421 polygon->setNbPoint(_corners.size());
1422 polygon->setIndex((
int)_indexFace);
1423 for(
unsigned int j = 0; j < _corners.size(); j++) {
1424 polygon->addPoint(j, _corners[j]);
1444 if(_indexCylinder != 0){
1459 vpMbtDistanceLine *l;
1460 vpMbtDistanceCylinder *cy;
1462 for (
unsigned int i = 0; i <
scales.size(); i += 1){
1464 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[i].begin(); it!=
lines[i].end(); ++it){
1466 if (l!=NULL)
delete l ;
1470 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[i].begin(); it!=
cylinders[i].end(); ++it){
1472 if (cy!=NULL)
delete cy;
1528 unsigned int nbGoodPoints = 0;
1529 vpMbtDistanceLine *l ;
1530 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[_level].begin(); it!=
lines[_level].end(); ++it){
1532 if (l->isVisible() && l->meline != NULL)
1534 for(std::list<vpMeSite>::const_iterator it=l->meline->getMeList().begin(); it!=l->meline->getMeList().end(); ++it){
1540 vpMbtDistanceCylinder *cy ;
1541 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[_level].begin(); it!=
cylinders[_level].end(); ++it){
1543 if (cy->meline1 != NULL || cy->meline2 != NULL)
1545 for(std::list<vpMeSite>::const_iterator it=cy->meline1->getMeList().begin(); it!=cy->meline1->getMeList().end(); ++it){
1548 for(std::list<vpMeSite>::const_iterator it=cy->meline2->getMeList().begin(); it!=cy->meline2->getMeList().end(); ++it){
1554 return nbGoodPoints;
1570 if(_index >= static_cast<unsigned int>(
faces.getPolygon().size()) ){
1573 std::list<vpMbtPolygon*>::const_iterator it =
faces.getPolygon().begin();
1574 std::advance(it, _index);
1586 return static_cast<unsigned int>(
faces.getPolygon().size());
1612 unsigned int nbActivatedLevels = 0;
1613 for (
unsigned int i = 0; i < _scales.size(); i += 1){
1615 nbActivatedLevels++;
1618 if((_scales.size() < 1) || (nbActivatedLevels == 0)){
1619 vpERROR_TRACE(
" !! WARNING : must use at least one level for the tracking. Use the global one");
1629 lines.resize(_scales.size());
1631 for (
unsigned int i = 0; i <
lines.size(); i += 1){
1655 _pyramid.resize(
scales.size());
1664 for(
unsigned int i=1; i<_pyramid.size(); i += 1){
1666 unsigned int cScale =
static_cast<unsigned int>(pow(2., (
int)i));
1668 #ifdef VISP_HAVE_OPENCV
1669 IplImage* vpI0 = cvCreateImageHeader(cvSize((
int)_I.
getWidth(), (int)_I.
getHeight()), IPL_DEPTH_8U, 1);
1670 vpI0->imageData = (
char*)(_I.
bitmap);
1671 IplImage* vpI = cvCreateImage(cvSize((
int)(_I.
getWidth() / cScale), (
int)(_I.
getHeight() / cScale)), IPL_DEPTH_8U, 1);
1672 cvResize(vpI0, vpI, CV_INTER_NN);
1674 cvReleaseImage(&vpI);
1675 vpI0->imageData = NULL;
1676 cvReleaseImageHeader(&vpI0);
1678 for (
unsigned int k = 0, ii = 0; k < I->
getHeight(); k += 1, ii += cScale){
1679 for (
unsigned int l = 0, jj = 0; l < I->
getWidth(); l += 1, jj += cScale){
1680 (*I)[k][l] = _I[ii][jj];
1701 if(_pyramid.size() > 0){
1703 for (
unsigned int i = 1; i < _pyramid.size(); i += 1){
1704 if(_pyramid[i] != NULL){
1713 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
1730 std::ostringstream oss;
1732 std::string errorMsg =
"level " + oss.str() +
" is not used, cannot get its distance lines.";
1737 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[_level].begin(); it!=
lines[_level].end(); ++it){
1761 std::ostringstream oss;
1763 std::string errorMsg =
"level " + oss.str() +
" is not used, cannot get its distance lines.";
1768 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[_level].begin(); it!=
cylinders[_level].end(); ++it){
1803 std::ostringstream oss;
1805 std::string errorMsg =
"level " + oss.str() +
" is not used, cannot get its distance lines.";
1809 linesList =
lines[_level];
1827 std::ostringstream oss;
1829 std::string errorMsg =
"level " + oss.str() +
" is not used, cannot get its distance lines.";
1846 const double ratio = pow(2., (
int)_scale);
1868 const double ratio = pow(2., (
int)_scale);
1894 vpMbtDistanceLine *l;
1901 vpMbtDistanceCylinder *cy;
unsigned int ncylinder
Index of the cylinder to add, and total number of polygon extracted so far.
Definition of the vpMatrix class.
vpMatrix covarianceMatrix
Covariance matrix.
void initFromCalibrationMatrix(const vpMatrix &_K)
virtual void loadModel(const std::string &_modelFile)
void upScale(const unsigned int _scale)
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
Compute the weights according a residue vector and a PsiFunction.
unsigned int getWidth() const
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
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 loadConfigFile(const std::string &filename)
void track(const vpImage< unsigned char > &I)
Provide simple list management.
double lambda
The gain of the virtual visual servoing stage.
unsigned int scaleLevel
Current scale level used. This attribute must not be modified outsied of the downScale() and upScale(...
Type * bitmap
points toward the bitmap
void setIdentity()
Basic initialisation (identity)
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
virtual void setCameraParameters(const vpCameraParameters &_cam)
Class to define colors available for display functionnalities.
vpHomogeneousMatrix cMo
The current pose.
virtual void initFromPose(const vpImage< unsigned char > &_I, const std::string &_initFile)
unsigned int getNbPolygon()
void getLcylinder(std::list< vpMbtDistanceCylinder * > &cylindersList, const unsigned int _level=0)
void computeJTR(const vpMatrix &_J, const vpColVector &_R, vpMatrix &_JTR)
virtual ~vpMbEdgeTracker()
bool displayMe
If true, the moving edges are displayed during the track() method.
double get_oY() const
Get the point Y coordinate in the object frame.
void reInitLevel(const unsigned int _lvl)
Contains predetermined masks for sites and holds moving edges tracking parameters.
std::vector< const vpImage< unsigned char > * > Ipyramid
Pyramid of image associated to the current image. This pyramid is compted in the init() and in the tr...
void removeCylinder(const std::string &name)
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
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).
void visibleFace(const vpHomogeneousMatrix &cMo, bool &newvisibleline)
static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b)
void downScale(const unsigned int _scale)
vpMbtHiddenFaces faces
Set of faces describing the object.
Class that defines what is a point.
vpMeSiteState getState() const
void addLine(vpPoint &p1, vpPoint &p2, int polygone=-1, std::string name="")
vpCameraParameters cam
The camera parameters.
static Type maximum(const Type &a, const Type &b)
int index_polygon
Index of the polygon to add, and total number of polygon extracted so far. Cannot be unsigned because...
std::vector< bool > scales
Vector of scale level to use for the multi-scale tracking.
Error that can be emited by the vpTracker class and its derivates.
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
static double sqr(double x)
virtual void initCylinder(const vpPoint &_p1, const vpPoint _p2, const double _radius, const unsigned int _indexCylinder=0)
Generic class defining intrinsic camera parameters.
void addRight(const type &el)
add a new element in the list, at the right of the current one
double get_oZ() const
Get the point Z coordinate in the object frame.
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)
virtual void initFaceFromCorners(const std::vector< vpPoint > &_corners, const unsigned int _indexFace=-1)
void reInitModel(const vpImage< unsigned char > &I, const char *cad_name, const vpHomogeneousMatrix &_cMo)
void setState(const vpMeSiteState &flag)
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &_cMo)
vpMbtPolygon * getPolygon(const unsigned int _index)
void diag(const vpColVector &A)
void setScales(const std::vector< bool > &_scales)
double get_oX() const
Get the point X coordinate in the object frame.
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.
vpHomogeneousMatrix inverse() const
static vpHomogeneousMatrix direct(const vpColVector &v)
void addCylinder(const vpPoint &P1, const vpPoint &P2, const double r, const std::string &name="")
Contains an M-Estimator and various influence function.
unsigned int nbvisiblepolygone
Number of polygon (face) currently visible.
unsigned int getHeight() const
void getLline(std::list< vpMbtDistanceLine * > &linesList, const unsigned int _level=0)
void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int l=1, const bool displayFullModel=false)
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Compute the pseudo inverse of the matrix using the SVD.
unsigned int nline
Index of the polygon to add, and total number of polygon extracted so far.
void addPolygon(vpMbtPolygon &p)
unsigned int getNbPoints(const unsigned int _level=0)
void trackMovingEdge(const vpImage< unsigned char > &I)
void loadModel(const std::string &cad_name)
void setThreshold(const double noise_threshold)
unsigned int getRows() const
Return the number of rows of the matrix.
static int sign(double x)
void removeLine(const std::string &name)
void setIteration(const unsigned int iter)
Set iteration.
void setMovingEdge(const vpMe &_me)
void resize(const unsigned int i, const bool flagNullify=true)