Visual Servoing Platform  version 3.5.1 under development (2022-07-05)
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;
228 
229 public:
230  vpMbTracker();
231  virtual ~vpMbTracker();
232 
234  virtual double computeCurrentProjectionError(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
235  const vpCameraParameters &_cam);
236 
238  virtual inline double getAngleAppear() const { return angleAppears; }
239 
241  virtual inline double getAngleDisappear() const { return angleDisappears; }
242 
248  virtual void getCameraParameters(vpCameraParameters &cam) const { cam = m_cam; }
249 
256  virtual inline unsigned int getClipping() const { return clippingFlag; }
257 
266  {
267  if (!computeCovariance) {
268  // vpTRACE("Warning : The covariance matrix has not been computed.
269  // See setCovarianceComputation() to do it.");
270  std::cerr << "Warning : The covariance matrix has not been computed. "
271  "See setCovarianceComputation() to do it."
272  << std::endl;
273  }
274 
275  return covarianceMatrix;
276  }
277 
284  virtual inline double getInitialMu() const { return m_initialMu; }
285 
291  virtual inline double getLambda() const { return m_lambda; }
292 
298  virtual inline unsigned int getMaxIter() const { return m_maxIter; }
299 
310  virtual double getProjectionError() const { return projectionError; }
311 
312  virtual vpColVector getEstimatedDoF() const;
313 
329  virtual vpColVector getError() const = 0;
330 
332  virtual inline vpMbHiddenFaces<vpMbtPolygon> &getFaces() { return faces; }
333 
339  virtual inline double getFarClippingDistance() const { return distFarClip; }
340 
361  virtual vpColVector getRobustWeights() const = 0;
362 
368  virtual inline unsigned int getNbPolygon() const { return static_cast<unsigned int>(faces.size()); }
369 
375  virtual inline double getNearClippingDistance() const { return distNearClip; }
376 
384  virtual inline vpMbtOptimizationMethod getOptimizationMethod() const { return m_optimizationMethod; }
385 
395  virtual inline vpMbtPolygon *getPolygon(unsigned int index)
396  {
397  if (index >= static_cast<unsigned int>(faces.size())) {
398  throw vpException(vpException::dimensionError, "index out of range");
399  }
400 
401  return faces[index];
402  }
403 
404  virtual std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > >
405  getPolygonFaces(bool orderPolygons = true, bool useVisibility = true, bool clipPolygon = false);
406 
414  virtual inline void getPose(vpHomogeneousMatrix &cMo) const { cMo = m_cMo; }
415 
423  virtual inline vpHomogeneousMatrix getPose() const { return m_cMo; }
424 
425  virtual inline double getStopCriteriaEpsilon() const { return m_stopCriteriaEpsilon; }
426 
427  // initializer
428 
429 #ifdef VISP_HAVE_MODULE_GUI
430  virtual void initClick(const vpImage<unsigned char> &I, const std::string &initFile, bool displayHelp = false,
432  virtual void initClick(const vpImage<vpRGBa> &I_color, const std::string &initFile, bool displayHelp = false,
434 
435  virtual void initClick(const vpImage<unsigned char> &I, const std::vector<vpPoint> &points3D_list,
436  const std::string &displayFile = "");
437  virtual void initClick(const vpImage<vpRGBa> &I_color, const std::vector<vpPoint> &points3D_list,
438  const std::string &displayFile = "");
439 #endif
440 
441  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::string &initFile);
442  virtual void initFromPoints(const vpImage<vpRGBa> &I_color, const std::string &initFile);
443 
444  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::vector<vpImagePoint> &points2D_list,
445  const std::vector<vpPoint> &points3D_list);
446  virtual void initFromPoints(const vpImage<vpRGBa> &I_color, const std::vector<vpImagePoint> &points2D_list,
447  const std::vector<vpPoint> &points3D_list);
448 
449  virtual void initFromPose(const vpImage<unsigned char> &I, const std::string &initFile);
450  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const std::string &initFile);
451 
452  virtual void initFromPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
453  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cMo);
454 
455  virtual void initFromPose(const vpImage<unsigned char> &I, const vpPoseVector &cPo);
456  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const vpPoseVector &cPo);
457 
458  virtual void loadModel(const std::string &modelFile, bool verbose = false,
460 
470  virtual inline void setAngleAppear(const double &a) { angleAppears = a; }
471 
481  virtual inline void setAngleDisappear(const double &a) { angleDisappears = a; }
482 
488  virtual void setCameraParameters(const vpCameraParameters &cam) { m_cam = cam; }
489 
490  virtual void setClipping(const unsigned int &flags);
491 
500  virtual void setCovarianceComputation(const bool &flag) { computeCovariance = flag; }
501 
518  virtual void setDisplayFeatures(bool displayF) { displayFeatures = displayF; }
519 
520  virtual void setEstimatedDoF(const vpColVector &v);
521 
522  virtual void setFarClippingDistance(const double &dist);
523 
529  virtual inline void setInitialMu(double mu) { m_initialMu = mu; }
530 
536  virtual inline void setLambda(double gain) { m_lambda = gain; }
537 
538  virtual void setLod(bool useLod, const std::string &name = "");
539 
545  virtual inline void setMaxIter(unsigned int max) { m_maxIter = max; }
546 
547  virtual void setMinLineLengthThresh(double minLineLengthThresh, const std::string &name = "");
548 
549  virtual void setMinPolygonAreaThresh(double minPolygonAreaThresh, const std::string &name = "");
550 
551  virtual void setNearClippingDistance(const double &dist);
552 
558  virtual inline void setOptimizationMethod(const vpMbtOptimizationMethod &opt) { m_optimizationMethod = opt; }
559 
560  void setProjectionErrorMovingEdge(const vpMe &me);
561 
562  void setProjectionErrorKernelSize(const unsigned int &size);
563 
564  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
565 
572  virtual inline void setStopCriteriaEpsilon(const double eps) { m_stopCriteriaEpsilon = eps; }
573 
585  virtual void setProjectionErrorComputation(const bool &flag) { computeProjError = flag; }
586 
590  virtual void setProjectionErrorDisplay(bool display) { m_projectionErrorDisplay = display; }
591 
595  virtual void setProjectionErrorDisplayArrowLength(unsigned int length) { m_projectionErrorDisplayLength = length; }
596 
600  virtual void setProjectionErrorDisplayArrowThickness(unsigned int thickness)
601  {
602  m_projectionErrorDisplayThickness = thickness;
603  }
604 
605  virtual void setScanLineVisibilityTest(const bool &v) { useScanLine = v; }
606 
607  virtual void setOgreVisibilityTest(const bool &v);
608 
609  void savePose(const std::string &filename) const;
610 
611 #ifdef VISP_HAVE_OGRE
621  virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio) { faces.setGoodNbRayCastingAttemptsRatio(ratio); }
631  virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
632  {
633  faces.setNbRayCastingAttemptsForVisibility(attempts);
634  }
635 #endif
636 
647  inline virtual void setOgreShowConfigDialog(bool showConfigDialog) { ogreShowConfigDialog = showConfigDialog; }
648 
659  inline void setPoseSavingFilename(const std::string &filename) { poseSavingFilename = filename; }
660 
661  /* PURE VIRTUAL METHODS */
662 
675  virtual void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
676  const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false) = 0;
689  virtual void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
690  const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false) = 0;
691 
692  virtual std::vector<std::vector<double> > getModelForDisplay(unsigned int width, unsigned int height,
693  const vpHomogeneousMatrix &cMo,
694  const vpCameraParameters &cam,
695  bool displayFullModel = false) = 0;
696 
702  virtual void init(const vpImage<unsigned char> &I) = 0;
703 
712  virtual void loadConfigFile(const std::string &configFile, bool verbose = true);
713 
717  virtual void resetTracker() = 0;
718 
729  virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cdMo) = 0;
730 
741  virtual void setPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cdMo) = 0;
742 
748  virtual void testTracking() = 0;
749 
755  virtual void track(const vpImage<unsigned char> &I) = 0;
756 
762  virtual void track(const vpImage<vpRGBa> &I) = 0;
763 
764 protected:
766  void addPolygon(const std::vector<vpPoint> &corners, int idFace = -1, const std::string &polygonName = "",
767  bool useLod = false, double minPolygonAreaThreshold = 2500.0, double minLineLengthThreshold = 50.0);
768  void addPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = -1,
769  const std::string &polygonName = "", bool useLod = false, double minPolygonAreaThreshold = 2500.0);
770  void addPolygon(const vpPoint &p1, const vpPoint &p2, int idFace = -1, const std::string &polygonName = "",
771  bool useLod = false, double minLineLengthThreshold = 50);
772  void addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, int idFace = -1,
773  const std::string &polygonName = "", bool useLod = false, double minLineLengthThreshold = 50);
774 
775  void addProjectionErrorCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, double r, int idFace = -1,
776  const std::string &name = "");
777  void addProjectionErrorCylinder(const vpPoint &P1, const vpPoint &P2, double r, int idFace = -1,
778  const std::string &name = "");
779  void addProjectionErrorLine(vpPoint &p1, vpPoint &p2, int polygon = -1, std::string name = "");
780 
781  void addProjectionErrorPolygon(const std::vector<vpPoint> &corners, int idFace = -1,
782  const std::string &polygonName = "", bool useLod = false,
783  double minPolygonAreaThreshold = 2500.0, const double minLineLengthThreshold = 50.0);
784  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius,
785  int idFace = -1, const std::string &polygonName = "", bool useLod = false,
786  double minPolygonAreaThreshold = 2500.0);
787  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, int idFace = -1,
788  const std::string &polygonName = "", bool useLod = false,
789  double minLineLengthThreshold = 50);
790  void addProjectionErrorPolygon(const std::vector<std::vector<vpPoint> > &listFaces, int idFace = -1,
791  const std::string &polygonName = "", bool useLod = false,
792  double minLineLengthThreshold = 50);
793 
794  void createCylinderBBox(const vpPoint &p1, const vpPoint &p2, const double &radius,
795  std::vector<std::vector<vpPoint> > &listFaces);
796 
797  virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity_, const vpColVector &w_true,
798  const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true,
799  const vpMatrix &LVJ_true, const vpColVector &error);
800 
801  void computeJTR(const vpMatrix &J, const vpColVector &R, vpColVector &JTR) const;
802 
803  double computeProjectionErrorImpl(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
804  const vpCameraParameters &_cam, unsigned int &nbFeatures);
805 
806  virtual void computeVVSCheckLevenbergMarquardt(unsigned int iter, vpColVector &error, const vpColVector &m_error_prev,
807  const vpHomogeneousMatrix &cMoPrev, double &mu,
808  bool &reStartFromLastIncrement, vpColVector *const w = NULL,
809  const vpColVector *const m_w_prev = NULL);
810  virtual void computeVVSInit() = 0;
812  virtual void computeVVSPoseEstimation(const bool isoJoIdentity_, unsigned int iter, vpMatrix &L, vpMatrix &LTL,
813  vpColVector &R, const vpColVector &error, vpColVector &error_prev,
814  vpColVector &LTR, double &mu, vpColVector &v, const vpColVector *const w = NULL,
815  vpColVector *const m_w_prev = NULL);
816  virtual void computeVVSWeights(vpRobust &robust, const vpColVector &error, vpColVector &w);
817 
818 #ifdef VISP_HAVE_COIN3D
819  virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, int &idFace);
820  virtual void extractFaces(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
821  const std::string &polygonName = "");
822  virtual void extractLines(SoVRMLIndexedLineSet *line_set, int &idFace, const std::string &polygonName = "");
823  virtual void extractCylinders(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
824  const std::string &polygonName = "");
825 #endif
826 
827  vpPoint getGravityCenter(const std::vector<vpPoint> &_pts) const;
828 
842  virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = 0,
843  const std::string &name = "") = 0;
844 
845 #ifdef VISP_HAVE_MODULE_GUI
846  virtual void initClick(const vpImage<unsigned char> *const I, const vpImage<vpRGBa> *const I_color,
847  const std::string &initFile, bool displayHelp = false,
849 
850  virtual void initClick(const vpImage<unsigned char> *const I, const vpImage<vpRGBa> *const I_color,
851  const std::vector<vpPoint> &points3D_list, const std::string &displayFile = "");
852 #endif
853 
854  virtual void initFromPoints(const vpImage<unsigned char> *const I, const vpImage<vpRGBa> *const I_color,
855  const std::string &initFile);
856 
857  virtual void initFromPoints(const vpImage<unsigned char> *const I, const vpImage<vpRGBa> *const I_color,
858  const std::vector<vpImagePoint> &points2D_list,
859  const std::vector<vpPoint> &points3D_list);
860 
861  virtual void initFromPose(const vpImage<unsigned char> *const I, const vpImage<vpRGBa> *const I_color,
862  const std::string &initFile);
863 
874  virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace = 0,
875  const std::string &name = "") = 0;
876 
889  virtual void initFaceFromCorners(vpMbtPolygon &polygon) = 0;
890  virtual void initFaceFromLines(vpMbtPolygon &polygon) = 0;
891 
892  void initProjectionErrorCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = 0,
893  const std::string &name = "");
894  void initProjectionErrorCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace = 0,
895  const std::string &name = "");
896  void initProjectionErrorFaceFromCorners(vpMbtPolygon &polygon);
897  void initProjectionErrorFaceFromLines(vpMbtPolygon &polygon);
898 
899  virtual void loadVRMLModel(const std::string &modelFile);
900  virtual void loadCAOModel(const std::string &modelFile, std::vector<std::string> &vectorOfModelFilename,
901  int &startIdFace, bool verbose = false, bool parent = true,
903 
904  void projectionErrorInitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo);
905  void projectionErrorResetMovingEdges();
906  void projectionErrorVisibleFace(unsigned int width, unsigned int height, const vpHomogeneousMatrix &_cMo);
907 
908  void removeComment(std::ifstream &fileId);
909 
910  std::map<std::string, std::string> parseParameters(std::string &endLine);
911 
912  bool samePoint(const vpPoint &P1, const vpPoint &P2) const;
913 };
914 
915 #endif
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Definition: vpColVector.h:131
Class to define RGB colors available for display functionnalities.
Definition: vpColor.h:158
error that can be emited by ViSP classes.
Definition: vpException.h:72
@ dimensionError
Bad dimension.
Definition: vpException.h:95
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:154
void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
void setGoodNbRayCastingAttemptsRatio(const double &ratio)
unsigned int size() const
Main methods for a model-based tracker.
Definition: vpMbTracker.h:105
virtual double getNearClippingDistance() const
Definition: vpMbTracker.h:375
virtual void setProjectionErrorDisplayArrowLength(unsigned int length)
Definition: vpMbTracker.h:595
double m_lambda
Gain of the virtual visual servoing stage.
Definition: vpMbTracker.h:187
virtual void setMaxIter(unsigned int max)
Definition: vpMbTracker.h:545
virtual void display(const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)=0
vpCameraParameters m_projectionErrorCam
Camera parameters used for projection error computation.
Definition: vpMbTracker.h:219
unsigned int nbPolygonPoints
Number of polygon points in CAO model.
Definition: vpMbTracker.h:166
bool modelInitialised
Definition: vpMbTracker.h:123
virtual void setPose(const vpImage< vpRGBa > &I_color, const vpHomogeneousMatrix &cdMo)=0
double minLineLengthThresholdGeneral
Minimum line length threshold for LOD mode (general setting)
Definition: vpMbTracker.h:177
bool m_projectionErrorDisplay
Display gradient and model orientation for projection error computation.
Definition: vpMbTracker.h:213
virtual void track(const vpImage< unsigned char > &I)=0
virtual double getInitialMu() const
Definition: vpMbTracker.h:284
virtual void resetTracker()=0
virtual void setOgreShowConfigDialog(bool showConfigDialog)
Definition: vpMbTracker.h:647
virtual double getAngleAppear() const
Definition: vpMbTracker.h:238
virtual void setMask(const vpImage< bool > &mask)
Definition: vpMbTracker.h:564
virtual void getCameraParameters(vpCameraParameters &cam) const
Definition: vpMbTracker.h:248
vpImage< unsigned char > m_I
Grayscale image buffer, used when passing color images.
Definition: vpMbTracker.h:223
unsigned int m_projectionErrorDisplayLength
Length of the arrows used to show the gradient and model orientation.
Definition: vpMbTracker.h:215
std::vector< vpMbtDistanceCylinder * > m_projectionErrorCylinders
Distance cylinder primitives for projection error.
Definition: vpMbTracker.h:198
virtual void init(const vpImage< unsigned char > &I)=0
virtual void setDisplayFeatures(bool displayF)
Definition: vpMbTracker.h:518
virtual vpHomogeneousMatrix getPose() const
Definition: vpMbTracker.h:423
bool useLodGeneral
True if LOD mode is enabled.
Definition: vpMbTracker.h:172
double minPolygonAreaThresholdGeneral
Minimum polygon area threshold for LOD mode (general setting)
Definition: vpMbTracker.h:179
std::map< std::string, std::string > mapOfParameterNames
Definition: vpMbTracker.h:182
bool m_computeInteraction
Definition: vpMbTracker.h:185
vpMatrix oJo
The Degrees of Freedom to estimate.
Definition: vpMbTracker.h:115
virtual void getPose(vpHomogeneousMatrix &cMo) const
Definition: vpMbTracker.h:414
virtual std::vector< std::vector< double > > getModelForDisplay(unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false)=0
unsigned int nbLines
Number of lines in CAO model.
Definition: vpMbTracker.h:162
virtual void initFaceFromLines(vpMbtPolygon &polygon)=0
vpUniRand m_rand
Random number generator used in vpMbtDistanceLine::buildFrom()
Definition: vpMbTracker.h:227
vpMatrix covarianceMatrix
Covariance matrix.
Definition: vpMbTracker.h:130
double m_initialMu
Initial Mu for Levenberg Marquardt optimization loop.
Definition: vpMbTracker.h:193
bool computeProjError
Definition: vpMbTracker.h:133
virtual vpColVector getError() const =0
vpHomogeneousMatrix m_cMo
The current pose.
Definition: vpMbTracker.h:113
virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace=0, const std::string &name="")=0
virtual vpMbtOptimizationMethod getOptimizationMethod() const
Definition: vpMbTracker.h:384
vpMatrix m_SobelX
Sobel kernel in X.
Definition: vpMbTracker.h:209
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace=0, const std::string &name="")=0
void setPoseSavingFilename(const std::string &filename)
Definition: vpMbTracker.h:659
unsigned int nbPoints
Number of points in CAO model.
Definition: vpMbTracker.h:160
vpCameraParameters m_cam
The camera parameters.
Definition: vpMbTracker.h:111
double projectionError
Definition: vpMbTracker.h:136
double m_stopCriteriaEpsilon
Epsilon threshold to stop the VVS optimization loop.
Definition: vpMbTracker.h:191
std::string modelFileName
Definition: vpMbTracker.h:120
bool useOgre
Use Ogre3d for visibility tests.
Definition: vpMbTracker.h:155
virtual double getAngleDisappear() const
Definition: vpMbTracker.h:241
virtual void setStopCriteriaEpsilon(const double eps)
Definition: vpMbTracker.h:572
vpMbHiddenFaces< vpMbtPolygon > faces
Set of faces describing the object.
Definition: vpMbTracker.h:143
virtual void setCameraParameters(const vpCameraParameters &cam)
Definition: vpMbTracker.h:488
virtual void setAngleDisappear(const double &a)
Definition: vpMbTracker.h:481
bool isoJoIdentity
Boolean to know if oJo is identity (for fast computation)
Definition: vpMbTracker.h:117
virtual void setCovarianceComputation(const bool &flag)
Definition: vpMbTracker.h:500
virtual void setInitialMu(double mu)
Definition: vpMbTracker.h:529
virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
Definition: vpMbTracker.h:631
virtual void setScanLineVisibilityTest(const bool &v)
Definition: vpMbTracker.h:605
virtual vpMbHiddenFaces< vpMbtPolygon > & getFaces()
Definition: vpMbTracker.h:332
std::vector< vpMbtDistanceCircle * > m_projectionErrorCircles
Distance circle primitive for projection error.
Definition: vpMbTracker.h:200
std::string poseSavingFilename
Definition: vpMbTracker.h:126
unsigned int nbPolygonLines
Number of polygon lines in CAO model.
Definition: vpMbTracker.h:164
virtual vpColVector getRobustWeights() const =0
unsigned int m_projectionErrorDisplayThickness
Thickness of the arrows used to show the gradient and model orientation.
Definition: vpMbTracker.h:217
vpMbtOptimizationMethod m_optimizationMethod
Optimization method used.
Definition: vpMbTracker.h:140
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)=0
virtual vpMatrix getCovarianceMatrix() const
Definition: vpMbTracker.h:265
bool displayFeatures
If true, the features are displayed.
Definition: vpMbTracker.h:138
virtual void setProjectionErrorDisplay(bool display)
Definition: vpMbTracker.h:590
double angleDisappears
Angle used to detect a face disappearance.
Definition: vpMbTracker.h:147
virtual unsigned int getNbPolygon() const
Definition: vpMbTracker.h:368
virtual void setLambda(double gain)
Definition: vpMbTracker.h:536
bool applyLodSettingInConfig
Definition: vpMbTracker.h:175
virtual double getProjectionError() const
Definition: vpMbTracker.h:310
double distFarClip
Distance for near clipping.
Definition: vpMbTracker.h:151
virtual vpMbtPolygon * getPolygon(unsigned int index)
Definition: vpMbTracker.h:395
virtual double getStopCriteriaEpsilon() const
Definition: vpMbTracker.h:425
bool useScanLine
Use Scanline for visibility tests.
Definition: vpMbTracker.h:158
vpMatrix m_SobelY
Sobel kernel in Y.
Definition: vpMbTracker.h:211
virtual void setProjectionErrorComputation(const bool &flag)
Definition: vpMbTracker.h:585
double angleAppears
Angle used to detect a face appearance.
Definition: vpMbTracker.h:145
virtual void setOptimizationMethod(const vpMbtOptimizationMethod &opt)
Definition: vpMbTracker.h:558
virtual void computeVVSInteractionMatrixAndResidu()=0
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)=0
bool m_projectionErrorOgreShowConfigDialog
Definition: vpMbTracker.h:203
virtual unsigned int getMaxIter() const
Definition: vpMbTracker.h:298
const vpImage< bool > * m_mask
Mask used to disable tracking on a part of image.
Definition: vpMbTracker.h:221
virtual double getLambda() const
Definition: vpMbTracker.h:291
virtual void setProjectionErrorDisplayArrowThickness(unsigned int thickness)
Definition: vpMbTracker.h:600
virtual void setAngleAppear(const double &a)
Definition: vpMbTracker.h:470
virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Definition: vpMbTracker.h:621
virtual void computeVVSInit()=0
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
Definition: vpMbTracker.h:128
std::vector< vpMbtDistanceLine * > m_projectionErrorLines
Distance line primitives for projection error.
Definition: vpMbTracker.h:196
double distNearClip
Distance for near clipping.
Definition: vpMbTracker.h:149
bool m_sodb_init_called
Flag that indicates that SoDB::init(); was called.
Definition: vpMbTracker.h:225
unsigned int m_maxIter
Maximum number of iterations of the virtual visual servoing stage.
Definition: vpMbTracker.h:189
virtual void testTracking()=0
bool ogreShowConfigDialog
Definition: vpMbTracker.h:156
unsigned int nbCylinders
Number of cylinders in CAO model.
Definition: vpMbTracker.h:168
virtual void track(const vpImage< vpRGBa > &I)=0
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
unsigned int nbCircles
Number of circles in CAO model.
Definition: vpMbTracker.h:170
vpMe m_projectionErrorMe
Moving-Edges parameters for projection error.
Definition: vpMbTracker.h:205
virtual double getFarClippingDistance() const
Definition: vpMbTracker.h:339
vpMbHiddenFaces< vpMbtPolygon > m_projectionErrorFaces
Set of faces describing the object, used for projection error.
Definition: vpMbTracker.h:202
virtual void initFaceFromCorners(vpMbtPolygon &polygon)=0
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:256
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:67
Definition: vpMe.h:61
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition: vpPoint.h:82
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:152
Contains an M-estimator and various influence function.
Definition: vpRobust.h:89
Class for generating random numbers with uniform probability density.
Definition: vpUniRand.h:101