Visual Servoing Platform  version 3.4.1 under development (2021-04-17)
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 // Intializer
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, const vpHomogeneousMatrix &T=vpHomogeneousMatrix());
459 
469  virtual inline void setAngleAppear(const double &a) { angleAppears = a; }
470 
480  virtual inline void setAngleDisappear(const double &a) { angleDisappears = a; }
481 
487  virtual void setCameraParameters(const vpCameraParameters &cam) { m_cam = cam; }
488 
489  virtual void setClipping(const unsigned int &flags);
490 
499  virtual void setCovarianceComputation(const bool &flag) { computeCovariance = flag; }
500 
517  virtual void setDisplayFeatures(bool displayF) { displayFeatures = displayF; }
518 
519  virtual void setEstimatedDoF(const vpColVector &v);
520 
521  virtual void setFarClippingDistance(const double &dist);
522 
528  virtual inline void setInitialMu(double mu) { m_initialMu = mu; }
529 
535  virtual inline void setLambda(double gain) { m_lambda = gain; }
536 
537  virtual void setLod(bool useLod, const std::string &name = "");
538 
544  virtual inline void setMaxIter(unsigned int max) { m_maxIter = max; }
545 
546  virtual void setMinLineLengthThresh(double minLineLengthThresh, const std::string &name = "");
547 
548  virtual void setMinPolygonAreaThresh(double minPolygonAreaThresh, const std::string &name = "");
549 
550  virtual void setNearClippingDistance(const double &dist);
551 
557  virtual inline void setOptimizationMethod(const vpMbtOptimizationMethod &opt) { m_optimizationMethod = opt; }
558 
559  void setProjectionErrorMovingEdge(const vpMe &me);
560 
561  void setProjectionErrorKernelSize(const unsigned int &size);
562 
563  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
564 
571  virtual inline void setStopCriteriaEpsilon(const double eps) { m_stopCriteriaEpsilon = eps; }
572 
584  virtual void setProjectionErrorComputation(const bool &flag) { computeProjError = flag; }
585 
589  virtual void setProjectionErrorDisplay(bool display) { m_projectionErrorDisplay = display; }
590 
594  virtual void setProjectionErrorDisplayArrowLength(unsigned int length) { m_projectionErrorDisplayLength = length; }
595 
599  virtual void setProjectionErrorDisplayArrowThickness(unsigned int thickness) { m_projectionErrorDisplayThickness = thickness; }
600 
601  virtual void setScanLineVisibilityTest(const bool &v) { useScanLine = v; }
602 
603  virtual void setOgreVisibilityTest(const bool &v);
604 
605  void savePose(const std::string &filename) const;
606 
607 #ifdef VISP_HAVE_OGRE
608 
617  virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio) { faces.setGoodNbRayCastingAttemptsRatio(ratio); }
627  virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
628  {
629  faces.setNbRayCastingAttemptsForVisibility(attempts);
630  }
631 #endif
632 
643  inline virtual void setOgreShowConfigDialog(bool showConfigDialog) { ogreShowConfigDialog = showConfigDialog; }
644 
655  inline void setPoseSavingFilename(const std::string &filename) { poseSavingFilename = filename; }
656 
657  /* PURE VIRTUAL METHODS */
658 
671  virtual void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
672  const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false) = 0;
685  virtual void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
686  const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false) = 0;
687 
688  virtual std::vector<std::vector<double> > getModelForDisplay(unsigned int width, unsigned int height,
689  const vpHomogeneousMatrix &cMo,
690  const vpCameraParameters &cam,
691  bool displayFullModel=false)=0;
692 
698  virtual void init(const vpImage<unsigned char> &I) = 0;
699 
708  virtual void loadConfigFile(const std::string &configFile, bool verbose=true);
709 
713  virtual void resetTracker() = 0;
714 
725  virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cdMo) = 0;
726 
737  virtual void setPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cdMo) = 0;
738 
744  virtual void testTracking() = 0;
745 
751  virtual void track(const vpImage<unsigned char> &I) = 0;
752 
758  virtual void track(const vpImage<vpRGBa> &I) = 0;
759 
760 protected:
762  void addPolygon(const std::vector<vpPoint> &corners, int idFace = -1, const std::string &polygonName = "",
763  bool useLod = false, double minPolygonAreaThreshold = 2500.0,
764  double minLineLengthThreshold = 50.0);
765  void addPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = -1,
766  const std::string &polygonName = "", bool useLod = false,
767  double minPolygonAreaThreshold = 2500.0);
768  void addPolygon(const vpPoint &p1, const vpPoint &p2, int idFace = -1, const std::string &polygonName = "",
769  bool useLod = false, double minLineLengthThreshold = 50);
770  void addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, int idFace = -1,
771  const std::string &polygonName = "", bool useLod = false,
772  double minLineLengthThreshold = 50);
773 
774  void addProjectionErrorCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, double r, int idFace = -1,
775  const std::string &name = "");
776  void addProjectionErrorCylinder(const vpPoint &P1, const vpPoint &P2, double r, int idFace = -1, const std::string &name = "");
777  void addProjectionErrorLine(vpPoint &p1, vpPoint &p2, int polygon = -1, std::string name = "");
778 
779  void addProjectionErrorPolygon(const std::vector<vpPoint> &corners, int idFace = -1, const std::string &polygonName = "",
780  bool useLod = false, double minPolygonAreaThreshold = 2500.0,
781  const double minLineLengthThreshold = 50.0);
782  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = -1,
783  const std::string &polygonName = "", bool useLod = false,
784  double minPolygonAreaThreshold = 2500.0);
785  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, int idFace = -1, const std::string &polygonName = "",
786  bool useLod = false, double minLineLengthThreshold = 50);
787  void addProjectionErrorPolygon(const std::vector<std::vector<vpPoint> > &listFaces, int idFace = -1,
788  const std::string &polygonName = "", bool useLod = false,
789  double minLineLengthThreshold = 50);
790 
791  void createCylinderBBox(const vpPoint &p1, const vpPoint &p2, const double &radius,
792  std::vector<std::vector<vpPoint> > &listFaces);
793 
794  virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity_, const vpColVector &w_true,
795  const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true,
796  const vpMatrix &LVJ_true, const vpColVector &error);
797 
798  void computeJTR(const vpMatrix &J, const vpColVector &R, vpColVector &JTR) const;
799 
800  double computeProjectionErrorImpl(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
801  const vpCameraParameters &_cam, unsigned int &nbFeatures);
802 
803  virtual void computeVVSCheckLevenbergMarquardt(unsigned int iter, vpColVector &error,
804  const vpColVector &m_error_prev, const vpHomogeneousMatrix &cMoPrev,
805  double &mu, bool &reStartFromLastIncrement,
806  vpColVector *const w = NULL, const vpColVector *const m_w_prev = NULL);
807  virtual void computeVVSInit() = 0;
808  virtual void computeVVSInteractionMatrixAndResidu() = 0;
809  virtual void computeVVSPoseEstimation(const bool isoJoIdentity_, unsigned int iter, vpMatrix &L, vpMatrix &LTL,
810  vpColVector &R, const vpColVector &error, vpColVector &error_prev,
811  vpColVector &LTR, double &mu, vpColVector &v, const vpColVector *const w = NULL,
812  vpColVector *const m_w_prev = NULL);
813  virtual void computeVVSWeights(vpRobust &robust, const vpColVector &error, vpColVector &w);
814 
815 #ifdef VISP_HAVE_COIN3D
816  virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, int &idFace);
817  virtual void extractFaces(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
818  const std::string &polygonName = "");
819  virtual void extractLines(SoVRMLIndexedLineSet *line_set, int &idFace, const std::string &polygonName = "");
820  virtual void extractCylinders(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
821  const std::string &polygonName = "");
822 #endif
823 
824  vpPoint getGravityCenter(const std::vector<vpPoint> &_pts) const;
825 
839  virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius,
840  int idFace = 0, const std::string &name = "") = 0;
841 
842 #ifdef VISP_HAVE_MODULE_GUI
843  virtual void initClick(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color, const std::string &initFile,
844  bool displayHelp = false, const vpHomogeneousMatrix &T = vpHomogeneousMatrix());
845 
846  virtual void initClick(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
847  const std::vector<vpPoint> &points3D_list, const std::string &displayFile = "");
848 #endif
849 
850  virtual void initFromPoints(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
851  const std::string &initFile);
852 
853  virtual void initFromPoints(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
854  const std::vector<vpImagePoint> &points2D_list, const std::vector<vpPoint> &points3D_list);
855 
856  virtual void initFromPose(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
857  const std::string &initFile);
858 
869  virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace = 0,
870  const std::string &name = "") = 0;
871 
884  virtual void initFaceFromCorners(vpMbtPolygon &polygon) = 0;
885  virtual void initFaceFromLines(vpMbtPolygon &polygon) = 0;
886 
887  void initProjectionErrorCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius,
888  int idFace = 0, const std::string &name = "");
889  void initProjectionErrorCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace = 0,
890  const std::string &name = "");
891  void initProjectionErrorFaceFromCorners(vpMbtPolygon &polygon);
892  void initProjectionErrorFaceFromLines(vpMbtPolygon &polygon);
893 
894  virtual void loadVRMLModel(const std::string &modelFile);
895  virtual void loadCAOModel(const std::string &modelFile, std::vector<std::string> &vectorOfModelFilename,
896  int &startIdFace, bool verbose = false, bool parent = true,
898 
899  void projectionErrorInitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo);
900  void projectionErrorResetMovingEdges();
901  void projectionErrorVisibleFace(unsigned int width, unsigned int height, const vpHomogeneousMatrix &_cMo);
902 
903  void removeComment(std::ifstream &fileId);
904 
905  std::map<std::string, std::string> parseParameters(std::string &endLine);
906 
907  bool samePoint(const vpPoint &P1, const vpPoint &P2) const;
908 };
909 
910 #endif
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:256
bool m_computeInteraction
Definition: vpMbTracker.h:185
virtual double getStopCriteriaEpsilon() const
Definition: vpMbTracker.h:425
bool computeProjError
Definition: vpMbTracker.h:133
virtual void setCovarianceComputation(const bool &flag)
Definition: vpMbTracker.h:499
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:153
vpMatrix covarianceMatrix
Covariance matrix.
Definition: vpMbTracker.h:130
bool m_projectionErrorDisplay
Display gradient and model orientation for projection error computation.
Definition: vpMbTracker.h:213
vpCameraParameters m_cam
The camera parameters.
Definition: vpMbTracker.h:111
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:480
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:298
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:557
Class to define RGB colors available for display functionnalities.
Definition: vpColor.h:157
virtual vpMbtPolygon * getPolygon(unsigned int index)
Definition: vpMbTracker.h:395
virtual double getInitialMu() const
Definition: vpMbTracker.h:284
vpMe m_projectionErrorMe
Moving-Edges parameters for projection error.
Definition: vpMbTracker.h:205
bool modelInitialised
Definition: vpMbTracker.h:123
virtual void setOgreShowConfigDialog(bool showConfigDialog)
Definition: vpMbTracker.h:643
virtual double getProjectionError() const
Definition: vpMbTracker.h:310
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:563
bool useOgre
Use Ogre3d for visibility tests.
Definition: vpMbTracker.h:155
virtual vpMbtOptimizationMethod getOptimizationMethod() const
Definition: vpMbTracker.h:384
std::string modelFileName
Definition: vpMbTracker.h:120
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
Definition: vpMbTracker.h:128
void setGoodNbRayCastingAttemptsRatio(const double &ratio)
virtual void setProjectionErrorDisplayArrowLength(unsigned int length)
Definition: vpMbTracker.h:594
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition: vpPoint.h:81
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:423
virtual double getAngleDisappear() const
Definition: vpMbTracker.h:241
vpMatrix oJo
The Degrees of Freedom to estimate.
Definition: vpMbTracker.h:115
virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Definition: vpMbTracker.h:617
virtual void getPose(vpHomogeneousMatrix &cMo) const
Definition: vpMbTracker.h:414
virtual void setCameraParameters(const vpCameraParameters &cam)
Definition: vpMbTracker.h:487
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:66
virtual void setInitialMu(double mu)
Definition: vpMbTracker.h:528
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 setLambda(double gain)
Definition: vpMbTracker.h:535
virtual void setStopCriteriaEpsilon(const double eps)
Definition: vpMbTracker.h:571
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:469
vpMbtOptimizationMethod m_optimizationMethod
Optimization method used.
Definition: vpMbTracker.h:140
double angleAppears
Angle used to detect a face appearance.
Definition: vpMbTracker.h:145
virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
Definition: vpMbTracker.h:627
unsigned int m_maxIter
Maximum number of iterations of the virtual visual servoing stage.
Definition: vpMbTracker.h:189
bool m_sodb_init_called
Flag that indicates that SoDB::init(); was called.
Definition: vpMbTracker.h:225
std::string poseSavingFilename
Definition: vpMbTracker.h:126
std::vector< vpMbtDistanceLine * > m_projectionErrorLines
Distance line primitives for projection error.
Definition: vpMbTracker.h:196
virtual void setProjectionErrorDisplay(bool display)
Definition: vpMbTracker.h:589
virtual void setProjectionErrorDisplayArrowThickness(unsigned int thickness)
Definition: vpMbTracker.h:599
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
bool ogreShowConfigDialog
Definition: vpMbTracker.h:156
virtual unsigned int getNbPolygon() const
Definition: vpMbTracker.h:368
vpCameraParameters m_projectionErrorCam
Camera parameters used for projection error computation.
Definition: vpMbTracker.h:219
virtual void setMaxIter(unsigned int max)
Definition: vpMbTracker.h:544
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:265
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:151
vpMatrix m_SobelY
Sobel kernel in Y.
Definition: vpMbTracker.h:211
Contains an M-estimator and various influence function.
Definition: vpRobust.h:88
double angleDisappears
Angle used to detect a face disappearance.
Definition: vpMbTracker.h:147
virtual double getLambda() const
Definition: vpMbTracker.h:291
void setPoseSavingFilename(const std::string &filename)
Definition: vpMbTracker.h:655
virtual void setScanLineVisibilityTest(const bool &v)
Definition: vpMbTracker.h:601
vpUniRand m_rand
Random number generator used in vpMbtDistanceLine::buildFrom()
Definition: vpMbTracker.h:227
Class for generating random numbers with uniform probability density.
Definition: vpUniRand.h:100
virtual double getNearClippingDistance() const
Definition: vpMbTracker.h:375
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
vpHomogeneousMatrix m_cMo
The current pose.
Definition: vpMbTracker.h:113
virtual vpMbHiddenFaces< vpMbtPolygon > & getFaces()
Definition: vpMbTracker.h:332
virtual void setDisplayFeatures(bool displayF)
Definition: vpMbTracker.h:517
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
virtual void getCameraParameters(vpCameraParameters &cam) const
Definition: vpMbTracker.h:248
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:339
virtual void setProjectionErrorComputation(const bool &flag)
Definition: vpMbTracker.h:584
virtual double getAngleAppear() const
Definition: vpMbTracker.h:238