Visual Servoing Platform  version 3.2.1 under development (2019-11-19)
vpMbTracker.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Generic model based tracker. This class declares the methods to implement
33  *in order to have a model based tracker.
34  *
35  * Authors:
36  * Romain Tallonneau
37  * Aurelien Yol
38  *
39  *****************************************************************************/
40 
45 #ifndef vpMbTracker_hh
46 #define vpMbTracker_hh
47 
48 #include <map>
49 #include <string>
50 #include <vector>
51 
52 #include <visp3/core/vpCameraParameters.h>
53 #include <visp3/core/vpColVector.h>
54 #include <visp3/core/vpHomogeneousMatrix.h>
55 #include <visp3/core/vpImage.h>
56 #include <visp3/core/vpImagePoint.h>
57 #include <visp3/core/vpMatrix.h>
58 #include <visp3/core/vpPoint.h>
59 #include <visp3/core/vpPolygon.h>
60 #include <visp3/core/vpRGBa.h>
61 #include <visp3/core/vpRobust.h>
62 #include <visp3/mbt/vpMbHiddenFaces.h>
63 #include <visp3/mbt/vpMbtPolygon.h>
64 
65 #include <visp3/mbt/vpMbtDistanceCircle.h>
66 #include <visp3/mbt/vpMbtDistanceCylinder.h>
67 #include <visp3/mbt/vpMbtDistanceLine.h>
68 
69 #ifdef VISP_HAVE_COIN3D
70 // Work around to avoid type redefinition int8_t with Coin
71 // #if defined(_WIN32) && defined(VISP_HAVE_OGRE) && (_MSC_VER >= 1600) //
72 // Visual Studio 2010
73 // #define HAVE_INT8_T 1
74 // #endif
75 
76 // Inventor includes
77 #include <Inventor/VRMLnodes/SoVRMLGroup.h>
78 #include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h>
79 #include <Inventor/VRMLnodes/SoVRMLIndexedLineSet.h>
80 #endif
81 
104 class VISP_EXPORT vpMbTracker
105 {
106 public:
107  typedef enum { GAUSS_NEWTON_OPT = 0, LEVENBERG_MARQUARDT_OPT = 1 } vpMbtOptimizationMethod;
108 
109 protected:
120  std::string modelFileName;
126  std::string poseSavingFilename;
141 
145  double angleAppears;
149  double distNearClip;
151  double distFarClip;
153  unsigned int clippingFlag;
155  bool useOgre;
160  unsigned int nbPoints;
162  unsigned int nbLines;
164  unsigned int nbPolygonLines;
166  unsigned int nbPolygonPoints;
168  unsigned int nbCylinders;
170  unsigned int nbCircles;
182  std::map<std::string, std::string> mapOfParameterNames;
187  double m_lambda;
189  unsigned int m_maxIter;
193  double m_initialMu;
194 
196  std::vector<vpMbtDistanceLine *> m_projectionErrorLines;
198  std::vector<vpMbtDistanceCylinder *> m_projectionErrorCylinders;
200  std::vector<vpMbtDistanceCircle *> m_projectionErrorCircles;
224 
225 public:
226  vpMbTracker();
227  virtual ~vpMbTracker();
228 
230  virtual double computeCurrentProjectionError(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
231  const vpCameraParameters &_cam);
232 
234  virtual inline double getAngleAppear() const { return angleAppears; }
235 
237  virtual inline double getAngleDisappear() const { return angleDisappears; }
238 
244  virtual void getCameraParameters(vpCameraParameters &camera) const { camera = this->cam; }
245 
252  virtual inline unsigned int getClipping() const { return clippingFlag; }
253 
262  {
263  if (!computeCovariance) {
264  // vpTRACE("Warning : The covariance matrix has not been computed.
265  // See setCovarianceComputation() to do it.");
266  std::cerr << "Warning : The covariance matrix has not been computed. "
267  "See setCovarianceComputation() to do it."
268  << std::endl;
269  }
270 
271  return covarianceMatrix;
272  }
273 
280  virtual inline double getInitialMu() const { return m_initialMu; }
281 
287  virtual inline double getLambda() const { return m_lambda; }
288 
294  virtual inline unsigned int getMaxIter() const { return m_maxIter; }
295 
306  virtual double getProjectionError() const { return projectionError; }
307 
308  virtual vpColVector getEstimatedDoF() const;
309 
325  virtual vpColVector getError() const = 0;
326 
328  virtual inline vpMbHiddenFaces<vpMbtPolygon> &getFaces() { return faces; }
329 
335  virtual inline double getFarClippingDistance() const { return distFarClip; }
336 
357  virtual vpColVector getRobustWeights() const = 0;
358 
364  virtual inline unsigned int getNbPolygon() const { return static_cast<unsigned int>(faces.size()); }
365 
371  virtual inline double getNearClippingDistance() const { return distNearClip; }
372 
380  virtual inline vpMbtOptimizationMethod getOptimizationMethod() const { return m_optimizationMethod; }
381 
391  virtual inline vpMbtPolygon *getPolygon(const unsigned int index)
392  {
393  if (index >= static_cast<unsigned int>(faces.size())) {
394  throw vpException(vpException::dimensionError, "index out of range");
395  }
396 
397  return faces[index];
398  }
399 
400  virtual std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > >
401  getPolygonFaces(const bool orderPolygons = true, const bool useVisibility = true, const bool clipPolygon = false);
402 
410  virtual inline void getPose(vpHomogeneousMatrix &cMo_) const { cMo_ = this->cMo; }
411 
419  virtual inline vpHomogeneousMatrix getPose() const { return this->cMo; }
420 
421  virtual inline double getStopCriteriaEpsilon() const { return m_stopCriteriaEpsilon; }
422 
423 // Intializer
424 
425 #ifdef VISP_HAVE_MODULE_GUI
426  virtual void initClick(const vpImage<unsigned char> &I, const std::string &initFile, const bool displayHelp = false,
428  virtual void initClick(const vpImage<vpRGBa> &I_color, const std::string &initFile, const bool displayHelp = false,
430 
431  virtual void initClick(const vpImage<unsigned char> &I, const std::vector<vpPoint> &points3D_list,
432  const std::string &displayFile = "");
433  virtual void initClick(const vpImage<vpRGBa> &I_color, const std::vector<vpPoint> &points3D_list,
434  const std::string &displayFile = "");
435 #endif
436 
437  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::string &initFile);
438  virtual void initFromPoints(const vpImage<vpRGBa> &I_color, const std::string &initFile);
439 
440  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::vector<vpImagePoint> &points2D_list,
441  const std::vector<vpPoint> &points3D_list);
442  virtual void initFromPoints(const vpImage<vpRGBa> &I_color, const std::vector<vpImagePoint> &points2D_list,
443  const std::vector<vpPoint> &points3D_list);
444 
445  virtual void initFromPose(const vpImage<unsigned char> &I, const std::string &initFile);
446  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const std::string &initFile);
447 
448  virtual void initFromPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
449  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cMo);
450 
451  virtual void initFromPose(const vpImage<unsigned char> &I, const vpPoseVector &cPo);
452  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const vpPoseVector &cPo);
453 
454  virtual void loadModel(const std::string &modelFile, const bool verbose = false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix());
455 
465  virtual inline void setAngleAppear(const double &a) { angleAppears = a; }
466 
476  virtual inline void setAngleDisappear(const double &a) { angleDisappears = a; }
477 
483  virtual void setCameraParameters(const vpCameraParameters &camera) { this->cam = camera; }
484 
485  virtual void setClipping(const unsigned int &flags);
486 
495  virtual void setCovarianceComputation(const bool &flag) { computeCovariance = flag; }
496 
513  virtual void setDisplayFeatures(const bool displayF) { displayFeatures = displayF; }
514 
515  virtual void setEstimatedDoF(const vpColVector &v);
516 
517  virtual void setFarClippingDistance(const double &dist);
518 
524  virtual inline void setInitialMu(const double mu) { m_initialMu = mu; }
525 
531  virtual inline void setLambda(const double gain) { m_lambda = gain; }
532 
533  virtual void setLod(const bool useLod, const std::string &name = "");
534 
540  virtual inline void setMaxIter(const unsigned int max) { m_maxIter = max; }
541 
542  virtual void setMinLineLengthThresh(const double minLineLengthThresh, const std::string &name = "");
543 
544  virtual void setMinPolygonAreaThresh(const double minPolygonAreaThresh, const std::string &name = "");
545 
546  virtual void setNearClippingDistance(const double &dist);
547 
553  virtual inline void setOptimizationMethod(const vpMbtOptimizationMethod &opt) { m_optimizationMethod = opt; }
554 
555  void setProjectionErrorMovingEdge(const vpMe &me);
556 
557  void setProjectionErrorKernelSize(const unsigned int &size);
558 
559  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
560 
567  virtual inline void setStopCriteriaEpsilon(const double eps) { m_stopCriteriaEpsilon = eps; }
568 
580  virtual void setProjectionErrorComputation(const bool &flag) { computeProjError = flag; }
581 
585  virtual void setProjectionErrorDisplay(const bool display) { m_projectionErrorDisplay = display; }
586 
590  virtual void setProjectionErrorDisplayArrowLength(const unsigned int length) { m_projectionErrorDisplayLength = length; }
591 
595  virtual void setProjectionErrorDisplayArrowThickness(const unsigned int thickness) { m_projectionErrorDisplayThickness = thickness; }
596 
597  virtual void setScanLineVisibilityTest(const bool &v) { useScanLine = v; }
598 
599  virtual void setOgreVisibilityTest(const bool &v);
600 
601  void savePose(const std::string &filename) const;
602 
603 #ifdef VISP_HAVE_OGRE
604 
613  virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio) { faces.setGoodNbRayCastingAttemptsRatio(ratio); }
623  virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
624  {
625  faces.setNbRayCastingAttemptsForVisibility(attempts);
626  }
627 #endif
628 
639  inline virtual void setOgreShowConfigDialog(const bool showConfigDialog) { ogreShowConfigDialog = showConfigDialog; }
640 
651  inline void setPoseSavingFilename(const std::string &filename) { poseSavingFilename = filename; }
652 
653  /* PURE VIRTUAL METHODS */
654 
667  virtual void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
668  const vpColor &col, const unsigned int thickness = 1, const bool displayFullModel = false) = 0;
681  virtual void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
682  const vpColor &col, const unsigned int thickness = 1, const bool displayFullModel = false) = 0;
683 
684  virtual std::vector<std::vector<double> > getModelForDisplay(unsigned int width, unsigned int height,
685  const vpHomogeneousMatrix &cMo,
686  const vpCameraParameters &cam,
687  const bool displayFullModel=false)=0;
688 
694  virtual void init(const vpImage<unsigned char> &I) = 0;
695 
703  virtual void loadConfigFile(const std::string &configFile);
704 
708  virtual void resetTracker() = 0;
709 
720  virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cdMo) = 0;
721 
732  virtual void setPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cdMo) = 0;
733 
739  virtual void testTracking() = 0;
740 
746  virtual void track(const vpImage<unsigned char> &I) = 0;
747 
753  virtual void track(const vpImage<vpRGBa> &I) = 0;
754 
755 protected:
757  void addPolygon(const std::vector<vpPoint> &corners, const int idFace = -1, const std::string &polygonName = "",
758  const bool useLod = false, const double minPolygonAreaThreshold = 2500.0,
759  const double minLineLengthThreshold = 50.0);
760  void addPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius, const int idFace = -1,
761  const std::string &polygonName = "", const bool useLod = false,
762  const double minPolygonAreaThreshold = 2500.0);
763  void addPolygon(const vpPoint &p1, const vpPoint &p2, const int idFace = -1, const std::string &polygonName = "",
764  const bool useLod = false, const double minLineLengthThreshold = 50);
765  void addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, const int idFace = -1,
766  const std::string &polygonName = "", const bool useLod = false,
767  const double minLineLengthThreshold = 50);
768 
769  void addProjectionErrorCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, const double r, int idFace = -1,
770  const std::string &name = "");
771  void addProjectionErrorCylinder(const vpPoint &P1, const vpPoint &P2, const double r, int idFace = -1, const std::string &name = "");
772  void addProjectionErrorLine(vpPoint &p1, vpPoint &p2, int polygon = -1, std::string name = "");
773 
774  void addProjectionErrorPolygon(const std::vector<vpPoint> &corners, const int idFace = -1, const std::string &polygonName = "",
775  const bool useLod = false, const double minPolygonAreaThreshold = 2500.0,
776  const double minLineLengthThreshold = 50.0);
777  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius, const int idFace = -1,
778  const std::string &polygonName = "", const bool useLod = false,
779  const double minPolygonAreaThreshold = 2500.0);
780  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const int idFace = -1, const std::string &polygonName = "",
781  const bool useLod = false, const double minLineLengthThreshold = 50);
782  void addProjectionErrorPolygon(const std::vector<std::vector<vpPoint> > &listFaces, const int idFace = -1,
783  const std::string &polygonName = "", const bool useLod = false,
784  const double minLineLengthThreshold = 50);
785 
786  void createCylinderBBox(const vpPoint &p1, const vpPoint &p2, const double &radius,
787  std::vector<std::vector<vpPoint> > &listFaces);
788 
789  virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity_, const vpColVector &w_true,
790  const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true,
791  const vpMatrix &LVJ_true, const vpColVector &error);
792 
793  void computeJTR(const vpMatrix &J, const vpColVector &R, vpColVector &JTR) const;
794 
795  double computeProjectionErrorImpl(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
796  const vpCameraParameters &_cam, unsigned int &nbFeatures);
797 
798  virtual void computeVVSCheckLevenbergMarquardt(const unsigned int iter, vpColVector &error,
799  const vpColVector &m_error_prev, const vpHomogeneousMatrix &cMoPrev,
800  double &mu, bool &reStartFromLastIncrement,
801  vpColVector *const w = NULL, const vpColVector *const m_w_prev = NULL);
802  virtual void computeVVSInit() = 0;
803  virtual void computeVVSInteractionMatrixAndResidu() = 0;
804  virtual void computeVVSPoseEstimation(const bool isoJoIdentity_, const unsigned int iter, vpMatrix &L, vpMatrix &LTL,
805  vpColVector &R, const vpColVector &error, vpColVector &error_prev,
806  vpColVector &LTR, double &mu, vpColVector &v, const vpColVector *const w = NULL,
807  vpColVector *const m_w_prev = NULL);
808  virtual void computeVVSWeights(vpRobust &robust, const vpColVector &error, vpColVector &w);
809 
810 #ifdef VISP_HAVE_COIN3D
811  virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, int &idFace);
812  virtual void extractFaces(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
813  const std::string &polygonName = "");
814  virtual void extractLines(SoVRMLIndexedLineSet *line_set, int &idFace, const std::string &polygonName = "");
815  virtual void extractCylinders(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
816  const std::string &polygonName = "");
817 #endif
818 
819  vpPoint getGravityCenter(const std::vector<vpPoint> &_pts) const;
820 
834  virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius,
835  const int idFace = 0, const std::string &name = "") = 0;
836 
837 #ifdef VISP_HAVE_MODULE_GUI
838  virtual void initClick(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color, const std::string &initFile,
839  const bool displayHelp = false, const vpHomogeneousMatrix &T = vpHomogeneousMatrix());
840 
841  virtual void initClick(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
842  const std::vector<vpPoint> &points3D_list, const std::string &displayFile = "");
843 #endif
844 
845  virtual void initFromPoints(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
846  const std::string &initFile);
847 
848  virtual void initFromPoints(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
849  const std::vector<vpImagePoint> &points2D_list, const std::vector<vpPoint> &points3D_list);
850 
851  virtual void initFromPose(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
852  const std::string &initFile);
853 
864  virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const int idFace = 0,
865  const std::string &name = "") = 0;
866 
879  virtual void initFaceFromCorners(vpMbtPolygon &polygon) = 0;
880  virtual void initFaceFromLines(vpMbtPolygon &polygon) = 0;
881 
882  void initProjectionErrorCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius,
883  const int idFace = 0, const std::string &name = "");
884  void initProjectionErrorCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const int idFace = 0,
885  const std::string &name = "");
886  void initProjectionErrorFaceFromCorners(vpMbtPolygon &polygon);
887  void initProjectionErrorFaceFromLines(vpMbtPolygon &polygon);
888 
889  virtual void loadVRMLModel(const std::string &modelFile);
890  virtual void loadCAOModel(const std::string &modelFile, std::vector<std::string> &vectorOfModelFilename,
891  int &startIdFace, const bool verbose = false, const bool parent = true,
893 
894  void projectionErrorInitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo);
895  void projectionErrorResetMovingEdges();
896  void projectionErrorVisibleFace(unsigned int width, unsigned int height, const vpHomogeneousMatrix &_cMo);
897 
898  void removeComment(std::ifstream &fileId);
899 
900  std::map<std::string, std::string> parseParameters(std::string &endLine);
901 
902  bool samePoint(const vpPoint &P1, const vpPoint &P2) const;
903 };
904 
905 #endif
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:252
bool m_computeInteraction
Definition: vpMbTracker.h:185
virtual double getStopCriteriaEpsilon() const
Definition: vpMbTracker.h:421
bool computeProjError
Definition: vpMbTracker.h:133
virtual void setDisplayFeatures(const bool displayF)
Definition: vpMbTracker.h:513
virtual void setCovarianceComputation(const bool &flag)
Definition: vpMbTracker.h:495
virtual void setOgreShowConfigDialog(const bool showConfigDialog)
Definition: vpMbTracker.h:639
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:164
vpMatrix covarianceMatrix
Covariance matrix.
Definition: vpMbTracker.h:130
virtual void getPose(vpHomogeneousMatrix &cMo_) const
Definition: vpMbTracker.h:410
bool m_projectionErrorDisplay
Display gradient and model orientation for projection error computation.
Definition: vpMbTracker.h:213
unsigned int m_projectionErrorDisplayLength
Length of the arrows used to show the gradient and model orientation.
Definition: vpMbTracker.h:215
unsigned int nbLines
Number of lines in CAO model.
Definition: vpMbTracker.h:162
unsigned int size() const
virtual void setAngleDisappear(const double &a)
Definition: vpMbTracker.h:476
unsigned int nbCircles
Number of circles in CAO model.
Definition: vpMbTracker.h:170
vpMbHiddenFaces< vpMbtPolygon > faces
Set of faces describing the object.
Definition: vpMbTracker.h:143
virtual unsigned int getMaxIter() const
Definition: vpMbTracker.h:294
Implementation of an homogeneous matrix and operations on such kind of matrices.
std::map< std::string, std::string > mapOfParameterNames
Definition: vpMbTracker.h:182
unsigned int nbCylinders
Number of cylinders in CAO model.
Definition: vpMbTracker.h:168
unsigned int nbPoints
Number of points in CAO model.
Definition: vpMbTracker.h:160
virtual void setOptimizationMethod(const vpMbtOptimizationMethod &opt)
Definition: vpMbTracker.h:553
Class to define colors available for display functionnalities.
Definition: vpColor.h:120
virtual double getInitialMu() const
Definition: vpMbTracker.h:280
vpHomogeneousMatrix cMo
The current pose.
Definition: vpMbTracker.h:113
vpMe m_projectionErrorMe
Moving-Edges parameters for projection error.
Definition: vpMbTracker.h:205
bool modelInitialised
Definition: vpMbTracker.h:123
virtual double getProjectionError() const
Definition: vpMbTracker.h:306
error that can be emited by ViSP classes.
Definition: vpException.h:71
Definition: vpMe.h:60
virtual void setMask(const vpImage< bool > &mask)
Definition: vpMbTracker.h:559
bool useOgre
Use Ogre3d for visibility tests.
Definition: vpMbTracker.h:155
virtual vpMbtOptimizationMethod getOptimizationMethod() const
Definition: vpMbTracker.h:380
std::string modelFileName
Definition: vpMbTracker.h:120
virtual void setMaxIter(const unsigned int max)
Definition: vpMbTracker.h:540
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
Definition: vpMbTracker.h:128
virtual void setInitialMu(const double mu)
Definition: vpMbTracker.h:524
void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Class that defines what is a point.
Definition: vpPoint.h:58
vpCameraParameters cam
The camera parameters.
Definition: vpMbTracker.h:111
bool m_projectionErrorOgreShowConfigDialog
Definition: vpMbTracker.h:203
double distFarClip
Distance for near clipping.
Definition: vpMbTracker.h:151
double projectionError
Definition: vpMbTracker.h:136
virtual vpHomogeneousMatrix getPose() const
Definition: vpMbTracker.h:419
virtual double getAngleDisappear() const
Definition: vpMbTracker.h:237
vpMatrix oJo
The Degrees of Freedom to estimate.
Definition: vpMbTracker.h:115
virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Definition: vpMbTracker.h:613
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:66
virtual void setCameraParameters(const vpCameraParameters &camera)
Definition: vpMbTracker.h:483
bool useScanLine
Use Scanline for visibility tests.
Definition: vpMbTracker.h:158
double minLineLengthThresholdGeneral
Minimum line length threshold for LOD mode (general setting)
Definition: vpMbTracker.h:177
virtual void setStopCriteriaEpsilon(const double eps)
Definition: vpMbTracker.h:567
void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
Generic class defining intrinsic camera parameters.
Main methods for a model-based tracker.
Definition: vpMbTracker.h:104
vpMatrix m_SobelX
Sobel kernel in X.
Definition: vpMbTracker.h:209
double m_initialMu
Initial Mu for Levenberg Marquardt optimization loop.
Definition: vpMbTracker.h:193
double m_lambda
Gain of the virtual visual servoing stage.
Definition: vpMbTracker.h:187
unsigned int nbPolygonLines
Number of polygon lines in CAO model.
Definition: vpMbTracker.h:164
virtual void setAngleAppear(const double &a)
Definition: vpMbTracker.h:465
virtual void setProjectionErrorDisplay(const bool display)
Definition: vpMbTracker.h:585
vpMbtOptimizationMethod m_optimizationMethod
Optimization method used.
Definition: vpMbTracker.h:140
virtual void setLambda(const double gain)
Definition: vpMbTracker.h:531
double angleAppears
Angle used to detect a face appearance.
Definition: vpMbTracker.h:145
virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
Definition: vpMbTracker.h:623
unsigned int m_maxIter
Maximum number of iterations of the virtual visual servoing stage.
Definition: vpMbTracker.h:189
std::string poseSavingFilename
Definition: vpMbTracker.h:126
std::vector< vpMbtDistanceLine * > m_projectionErrorLines
Distance line primitives for projection error.
Definition: vpMbTracker.h:196
const vpImage< bool > * m_mask
Mask used to disable tracking on a part of image.
Definition: vpMbTracker.h:221
unsigned int nbPolygonPoints
Number of polygon points in CAO model.
Definition: vpMbTracker.h:166
double m_stopCriteriaEpsilon
Epsilon threshold to stop the VVS optimization loop.
Definition: vpMbTracker.h:191
double minPolygonAreaThresholdGeneral
Minimum polygon area threshold for LOD mode (general setting)
Definition: vpMbTracker.h:179
bool displayFeatures
If true, the features are displayed.
Definition: vpMbTracker.h:138
virtual void getCameraParameters(vpCameraParameters &camera) const
Definition: vpMbTracker.h:244
bool ogreShowConfigDialog
Definition: vpMbTracker.h:156
virtual unsigned int getNbPolygon() const
Definition: vpMbTracker.h:364
vpCameraParameters m_projectionErrorCam
Camera parameters used for projection error computation.
Definition: vpMbTracker.h:219
bool applyLodSettingInConfig
Definition: vpMbTracker.h:175
Implementation of column vector and the associated operations.
Definition: vpColVector.h:130
virtual vpMatrix getCovarianceMatrix() const
Definition: vpMbTracker.h:261
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:151
virtual void setProjectionErrorDisplayArrowLength(const unsigned int length)
Definition: vpMbTracker.h:590
vpMatrix m_SobelY
Sobel kernel in Y.
Definition: vpMbTracker.h:211
virtual vpMbtPolygon * getPolygon(const unsigned int index)
Definition: vpMbTracker.h:391
Contains an M-Estimator and various influence function.
Definition: vpRobust.h:58
double angleDisappears
Angle used to detect a face disappearance.
Definition: vpMbTracker.h:147
virtual double getLambda() const
Definition: vpMbTracker.h:287
void setPoseSavingFilename(const std::string &filename)
Definition: vpMbTracker.h:651
virtual void setScanLineVisibilityTest(const bool &v)
Definition: vpMbTracker.h:597
virtual void setProjectionErrorDisplayArrowThickness(const unsigned int thickness)
Definition: vpMbTracker.h:595
virtual double getNearClippingDistance() const
Definition: vpMbTracker.h:371
unsigned int clippingFlag
Flags specifying which clipping to used.
Definition: vpMbTracker.h:153
unsigned int m_projectionErrorKernelSize
Kernel size used to compute the gradient orientation.
Definition: vpMbTracker.h:207
std::vector< vpMbtDistanceCircle * > m_projectionErrorCircles
Distance circle primitive for projection error.
Definition: vpMbTracker.h:200
vpImage< unsigned char > m_I
Grayscale image buffer, used when passing color images.
Definition: vpMbTracker.h:223
double distNearClip
Distance for near clipping.
Definition: vpMbTracker.h:149
bool useLodGeneral
True if LOD mode is enabled.
Definition: vpMbTracker.h:172
virtual vpMbHiddenFaces< vpMbtPolygon > & getFaces()
Definition: vpMbTracker.h:328
bool isoJoIdentity
Boolean to know if oJo is identity (for fast computation)
Definition: vpMbTracker.h:117
unsigned int m_projectionErrorDisplayThickness
Thickness of the arrows used to show the gradient and model orientation.
Definition: vpMbTracker.h:217
vpMbHiddenFaces< vpMbtPolygon > m_projectionErrorFaces
Set of faces describing the object, used for projection error.
Definition: vpMbTracker.h:202
std::vector< vpMbtDistanceCylinder * > m_projectionErrorCylinders
Distance cylinder primitives for projection error.
Definition: vpMbTracker.h:198
virtual double getFarClippingDistance() const
Definition: vpMbTracker.h:335
virtual void setProjectionErrorComputation(const bool &flag)
Definition: vpMbTracker.h:580
virtual double getAngleAppear() const
Definition: vpMbTracker.h:234