39 #include <visp/vpMbEdgeKltTracker.h>
41 #ifdef VISP_HAVE_OPENCV
91 unsigned int i=
scales.size();
142 unsigned int i=
scales.size();
177 unsigned int nbrow = 0;
178 for(std::list<vpMbtDistanceLine*>::iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
184 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
274 #ifdef VISP_HAVE_XML2
278 vpTRACE(
"You need the libXML2 to read the config file %s", configFile);
303 const unsigned int lvl)
313 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
321 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
368 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
372 std::list<vpMeSite>::iterator itListLine;
375 for (
unsigned int i=0 ; i < l->
nbFeature ; i++){
402 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
405 std::list<vpMeSite>::iterator itListCyl1;
406 std::list<vpMeSite>::iterator itListCyl2;
437 for(
unsigned int i=cy->
nbFeaturel1 ; i < cy->nbFeature ; i++){
479 if(nbrow < 4 && nbInfos < 4){
487 double residu_1 = -1;
488 unsigned int iter = 0;
504 J_klt.
resize(2*nbInfos,6);
510 vpRobust robust_mbt(0), robust_klt(0);
515 double factorMBT = 1.0;
516 double factorKLT = 1.0;
524 double residuMBT = 0;
525 double residuKLT = 0;
527 while( ((
int)((residu - residu_1)*1e8) !=0 ) && (iter<
maxIter) ){
535 unsigned int shift = 0;
548 w.
resize(nbrow + 2*nbInfos);
557 robust_klt.
resize(2*nbInfos);
559 w_true.
resize(nbrow + 2*nbInfos);
565 for(
unsigned int i = 0; i < R_mbt.
getRows(); i++)
566 residuMBT += fabs(R_mbt[i]);
569 robust_mbt.setIteration(iter);
578 for(
unsigned int i = 0; i < R_klt.
getRows(); i++)
579 residuKLT += fabs(R_klt[i]);
590 unsigned int cpt = 0;
591 while(cpt< (nbrow+2*nbInfos)){
592 if(cpt<(
unsigned)nbrow){
593 w[cpt] = ((w_mbt[cpt] * factor[cpt]) * factorMBT) ;
596 w[cpt] = (w_klt[cpt-nbrow] * factorKLT);
609 for (
unsigned int i = 0; i < static_cast<unsigned int>(R->
getRows()); i++){
613 w_true[i] = w[i]*w[i];
616 for (
unsigned int j = 0; j < 6; j += 1){
622 residu = sqrt(num/den);
653 unsigned int nbInfos;
654 unsigned int nbFaceUsed;
663 std::cout <<
"[ERROR] Unable to init with KLT" << std::endl;
699 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
716 std::list<vpMeSite>::const_iterator itListLine;
720 for (
unsigned int i=0 ; i < l->
nbFeature ; i++){
729 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
734 std::list<vpMeSite>::const_iterator itCyl1;
735 std::list<vpMeSite>::const_iterator itCyl2;
741 for(
unsigned int i=0 ; i < cy->
nbFeature ; i++){
744 if(i<cy->nbFeaturel1) {
769 for(std::list<vpMbtDistanceLine*>::const_iterator it=
lines[lvl].begin(); it!=
lines[lvl].end(); ++it){
772 for (
unsigned int i=0 ; i < l->
nbFeature ; i++){
773 for (
unsigned int j=0; j < 6 ; j++){
774 L[n+i][j] = l->
L[i][j];
775 error[n+i] = l->
error[i];
781 for(std::list<vpMbtDistanceCylinder*>::const_iterator it=
cylinders[lvl].begin(); it!=
cylinders[lvl].end(); ++it){
784 for(
unsigned int i=0 ; i < cy->
nbFeature ; i++){
785 for(
unsigned int j=0; j < 6 ; j++){
786 L[n+i][j] = cy->
L[i][j];
787 error[n+i] = cy->
error[i];
849 const vpColor& col ,
const unsigned int thickness,
const bool displayFullModel)
853 for (
unsigned int i = 0; i <
scales.size(); i += 1){
856 (*it)->display(I, cMo, cam, col, thickness);
875 const vpColor& col ,
const unsigned int thickness,
const bool displayFullModel)
879 for (
unsigned int i = 0; i <
scales.size(); i += 1){
882 (*it)->display(I, cMo, cam, col, thickness);
889 #endif //VISP_HAVE_OPENCV