Visual Servoing Platform  version 3.3.1 under development (2020-12-02)
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;
226 
227 public:
228  vpMbTracker();
229  virtual ~vpMbTracker();
230 
232  virtual double computeCurrentProjectionError(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
233  const vpCameraParameters &_cam);
234 
236  virtual inline double getAngleAppear() const { return angleAppears; }
237 
239  virtual inline double getAngleDisappear() const { return angleDisappears; }
240 
246  virtual void getCameraParameters(vpCameraParameters &cam) const { cam = m_cam; }
247 
254  virtual inline unsigned int getClipping() const { return clippingFlag; }
255 
264  {
265  if (!computeCovariance) {
266  // vpTRACE("Warning : The covariance matrix has not been computed.
267  // See setCovarianceComputation() to do it.");
268  std::cerr << "Warning : The covariance matrix has not been computed. "
269  "See setCovarianceComputation() to do it."
270  << std::endl;
271  }
272 
273  return covarianceMatrix;
274  }
275 
282  virtual inline double getInitialMu() const { return m_initialMu; }
283 
289  virtual inline double getLambda() const { return m_lambda; }
290 
296  virtual inline unsigned int getMaxIter() const { return m_maxIter; }
297 
308  virtual double getProjectionError() const { return projectionError; }
309 
310  virtual vpColVector getEstimatedDoF() const;
311 
327  virtual vpColVector getError() const = 0;
328 
330  virtual inline vpMbHiddenFaces<vpMbtPolygon> &getFaces() { return faces; }
331 
337  virtual inline double getFarClippingDistance() const { return distFarClip; }
338 
359  virtual vpColVector getRobustWeights() const = 0;
360 
366  virtual inline unsigned int getNbPolygon() const { return static_cast<unsigned int>(faces.size()); }
367 
373  virtual inline double getNearClippingDistance() const { return distNearClip; }
374 
382  virtual inline vpMbtOptimizationMethod getOptimizationMethod() const { return m_optimizationMethod; }
383 
393  virtual inline vpMbtPolygon *getPolygon(unsigned int index)
394  {
395  if (index >= static_cast<unsigned int>(faces.size())) {
396  throw vpException(vpException::dimensionError, "index out of range");
397  }
398 
399  return faces[index];
400  }
401 
402  virtual std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > >
403  getPolygonFaces(bool orderPolygons = true, bool useVisibility = true, bool clipPolygon = false);
404 
412  virtual inline void getPose(vpHomogeneousMatrix &cMo) const { cMo = m_cMo; }
413 
421  virtual inline vpHomogeneousMatrix getPose() const { return m_cMo; }
422 
423  virtual inline double getStopCriteriaEpsilon() const { return m_stopCriteriaEpsilon; }
424 
425 // Intializer
426 
427 #ifdef VISP_HAVE_MODULE_GUI
428  virtual void initClick(const vpImage<unsigned char> &I, const std::string &initFile, bool displayHelp = false,
430  virtual void initClick(const vpImage<vpRGBa> &I_color, const std::string &initFile, bool displayHelp = false,
432 
433  virtual void initClick(const vpImage<unsigned char> &I, const std::vector<vpPoint> &points3D_list,
434  const std::string &displayFile = "");
435  virtual void initClick(const vpImage<vpRGBa> &I_color, const std::vector<vpPoint> &points3D_list,
436  const std::string &displayFile = "");
437 #endif
438 
439  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::string &initFile);
440  virtual void initFromPoints(const vpImage<vpRGBa> &I_color, const std::string &initFile);
441 
442  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::vector<vpImagePoint> &points2D_list,
443  const std::vector<vpPoint> &points3D_list);
444  virtual void initFromPoints(const vpImage<vpRGBa> &I_color, const std::vector<vpImagePoint> &points2D_list,
445  const std::vector<vpPoint> &points3D_list);
446 
447  virtual void initFromPose(const vpImage<unsigned char> &I, const std::string &initFile);
448  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const std::string &initFile);
449 
450  virtual void initFromPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
451  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cMo);
452 
453  virtual void initFromPose(const vpImage<unsigned char> &I, const vpPoseVector &cPo);
454  virtual void initFromPose(const vpImage<vpRGBa> &I_color, const vpPoseVector &cPo);
455 
456  virtual void loadModel(const std::string &modelFile, bool verbose = false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix());
457 
467  virtual inline void setAngleAppear(const double &a) { angleAppears = a; }
468 
478  virtual inline void setAngleDisappear(const double &a) { angleDisappears = a; }
479 
485  virtual void setCameraParameters(const vpCameraParameters &cam) { m_cam = cam; }
486 
487  virtual void setClipping(const unsigned int &flags);
488 
497  virtual void setCovarianceComputation(const bool &flag) { computeCovariance = flag; }
498 
515  virtual void setDisplayFeatures(bool displayF) { displayFeatures = displayF; }
516 
517  virtual void setEstimatedDoF(const vpColVector &v);
518 
519  virtual void setFarClippingDistance(const double &dist);
520 
526  virtual inline void setInitialMu(double mu) { m_initialMu = mu; }
527 
533  virtual inline void setLambda(double gain) { m_lambda = gain; }
534 
535  virtual void setLod(bool useLod, const std::string &name = "");
536 
542  virtual inline void setMaxIter(unsigned int max) { m_maxIter = max; }
543 
544  virtual void setMinLineLengthThresh(double minLineLengthThresh, const std::string &name = "");
545 
546  virtual void setMinPolygonAreaThresh(double minPolygonAreaThresh, const std::string &name = "");
547 
548  virtual void setNearClippingDistance(const double &dist);
549 
555  virtual inline void setOptimizationMethod(const vpMbtOptimizationMethod &opt) { m_optimizationMethod = opt; }
556 
557  void setProjectionErrorMovingEdge(const vpMe &me);
558 
559  void setProjectionErrorKernelSize(const unsigned int &size);
560 
561  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
562 
569  virtual inline void setStopCriteriaEpsilon(const double eps) { m_stopCriteriaEpsilon = eps; }
570 
582  virtual void setProjectionErrorComputation(const bool &flag) { computeProjError = flag; }
583 
587  virtual void setProjectionErrorDisplay(bool display) { m_projectionErrorDisplay = display; }
588 
592  virtual void setProjectionErrorDisplayArrowLength(unsigned int length) { m_projectionErrorDisplayLength = length; }
593 
597  virtual void setProjectionErrorDisplayArrowThickness(unsigned int thickness) { m_projectionErrorDisplayThickness = thickness; }
598 
599  virtual void setScanLineVisibilityTest(const bool &v) { useScanLine = v; }
600 
601  virtual void setOgreVisibilityTest(const bool &v);
602 
603  void savePose(const std::string &filename) const;
604 
605 #ifdef VISP_HAVE_OGRE
606 
615  virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio) { faces.setGoodNbRayCastingAttemptsRatio(ratio); }
625  virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
626  {
627  faces.setNbRayCastingAttemptsForVisibility(attempts);
628  }
629 #endif
630 
641  inline virtual void setOgreShowConfigDialog(bool showConfigDialog) { ogreShowConfigDialog = showConfigDialog; }
642 
653  inline void setPoseSavingFilename(const std::string &filename) { poseSavingFilename = filename; }
654 
655  /* PURE VIRTUAL METHODS */
656 
669  virtual void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
670  const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false) = 0;
683  virtual void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
684  const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false) = 0;
685 
686  virtual std::vector<std::vector<double> > getModelForDisplay(unsigned int width, unsigned int height,
687  const vpHomogeneousMatrix &cMo,
688  const vpCameraParameters &cam,
689  bool displayFullModel=false)=0;
690 
696  virtual void init(const vpImage<unsigned char> &I) = 0;
697 
705  virtual void loadConfigFile(const std::string &configFile);
706 
710  virtual void resetTracker() = 0;
711 
722  virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cdMo) = 0;
723 
734  virtual void setPose(const vpImage<vpRGBa> &I_color, const vpHomogeneousMatrix &cdMo) = 0;
735 
741  virtual void testTracking() = 0;
742 
748  virtual void track(const vpImage<unsigned char> &I) = 0;
749 
755  virtual void track(const vpImage<vpRGBa> &I) = 0;
756 
757 protected:
759  void addPolygon(const std::vector<vpPoint> &corners, int idFace = -1, const std::string &polygonName = "",
760  bool useLod = false, double minPolygonAreaThreshold = 2500.0,
761  double minLineLengthThreshold = 50.0);
762  void addPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = -1,
763  const std::string &polygonName = "", bool useLod = false,
764  double minPolygonAreaThreshold = 2500.0);
765  void addPolygon(const vpPoint &p1, const vpPoint &p2, int idFace = -1, const std::string &polygonName = "",
766  bool useLod = false, double minLineLengthThreshold = 50);
767  void addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, int idFace = -1,
768  const std::string &polygonName = "", bool useLod = false,
769  double minLineLengthThreshold = 50);
770 
771  void addProjectionErrorCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, double r, int idFace = -1,
772  const std::string &name = "");
773  void addProjectionErrorCylinder(const vpPoint &P1, const vpPoint &P2, double r, int idFace = -1, const std::string &name = "");
774  void addProjectionErrorLine(vpPoint &p1, vpPoint &p2, int polygon = -1, std::string name = "");
775 
776  void addProjectionErrorPolygon(const std::vector<vpPoint> &corners, int idFace = -1, const std::string &polygonName = "",
777  bool useLod = false, double minPolygonAreaThreshold = 2500.0,
778  const double minLineLengthThreshold = 50.0);
779  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace = -1,
780  const std::string &polygonName = "", bool useLod = false,
781  double minPolygonAreaThreshold = 2500.0);
782  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, int idFace = -1, const std::string &polygonName = "",
783  bool useLod = false, double minLineLengthThreshold = 50);
784  void addProjectionErrorPolygon(const std::vector<std::vector<vpPoint> > &listFaces, int idFace = -1,
785  const std::string &polygonName = "", bool useLod = false,
786  double minLineLengthThreshold = 50);
787 
788  void createCylinderBBox(const vpPoint &p1, const vpPoint &p2, const double &radius,
789  std::vector<std::vector<vpPoint> > &listFaces);
790 
791  virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity_, const vpColVector &w_true,
792  const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true,
793  const vpMatrix &LVJ_true, const vpColVector &error);
794 
795  void computeJTR(const vpMatrix &J, const vpColVector &R, vpColVector &JTR) const;
796 
797  double computeProjectionErrorImpl(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
798  const vpCameraParameters &_cam, unsigned int &nbFeatures);
799 
800  virtual void computeVVSCheckLevenbergMarquardt(unsigned int iter, vpColVector &error,
801  const vpColVector &m_error_prev, const vpHomogeneousMatrix &cMoPrev,
802  double &mu, bool &reStartFromLastIncrement,
803  vpColVector *const w = NULL, const vpColVector *const m_w_prev = NULL);
804  virtual void computeVVSInit() = 0;
805  virtual void computeVVSInteractionMatrixAndResidu() = 0;
806  virtual void computeVVSPoseEstimation(const bool isoJoIdentity_, unsigned int iter, vpMatrix &L, vpMatrix &LTL,
807  vpColVector &R, const vpColVector &error, vpColVector &error_prev,
808  vpColVector &LTR, double &mu, vpColVector &v, const vpColVector *const w = NULL,
809  vpColVector *const m_w_prev = NULL);
810  virtual void computeVVSWeights(vpRobust &robust, const vpColVector &error, vpColVector &w);
811 
812 #ifdef VISP_HAVE_COIN3D
813  virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, int &idFace);
814  virtual void extractFaces(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
815  const std::string &polygonName = "");
816  virtual void extractLines(SoVRMLIndexedLineSet *line_set, int &idFace, const std::string &polygonName = "");
817  virtual void extractCylinders(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
818  const std::string &polygonName = "");
819 #endif
820 
821  vpPoint getGravityCenter(const std::vector<vpPoint> &_pts) const;
822 
836  virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius,
837  int idFace = 0, const std::string &name = "") = 0;
838 
839 #ifdef VISP_HAVE_MODULE_GUI
840  virtual void initClick(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color, const std::string &initFile,
841  bool displayHelp = false, const vpHomogeneousMatrix &T = vpHomogeneousMatrix());
842 
843  virtual void initClick(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
844  const std::vector<vpPoint> &points3D_list, const std::string &displayFile = "");
845 #endif
846 
847  virtual void initFromPoints(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
848  const std::string &initFile);
849 
850  virtual void initFromPoints(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
851  const std::vector<vpImagePoint> &points2D_list, const std::vector<vpPoint> &points3D_list);
852 
853  virtual void initFromPose(const vpImage<unsigned char> * const I, const vpImage<vpRGBa> * const I_color,
854  const std::string &initFile);
855 
866  virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace = 0,
867  const std::string &name = "") = 0;
868 
881  virtual void initFaceFromCorners(vpMbtPolygon &polygon) = 0;
882  virtual void initFaceFromLines(vpMbtPolygon &polygon) = 0;
883 
884  void initProjectionErrorCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius,
885  int idFace = 0, const std::string &name = "");
886  void initProjectionErrorCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace = 0,
887  const std::string &name = "");
888  void initProjectionErrorFaceFromCorners(vpMbtPolygon &polygon);
889  void initProjectionErrorFaceFromLines(vpMbtPolygon &polygon);
890 
891  virtual void loadVRMLModel(const std::string &modelFile);
892  virtual void loadCAOModel(const std::string &modelFile, std::vector<std::string> &vectorOfModelFilename,
893  int &startIdFace, bool verbose = false, bool parent = true,
895 
896  void projectionErrorInitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo);
897  void projectionErrorResetMovingEdges();
898  void projectionErrorVisibleFace(unsigned int width, unsigned int height, const vpHomogeneousMatrix &_cMo);
899 
900  void removeComment(std::ifstream &fileId);
901 
902  std::map<std::string, std::string> parseParameters(std::string &endLine);
903 
904  bool samePoint(const vpPoint &P1, const vpPoint &P2) const;
905 };
906 
907 #endif
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:254
bool m_computeInteraction
Definition: vpMbTracker.h:185
virtual double getStopCriteriaEpsilon() const
Definition: vpMbTracker.h:423
bool computeProjError
Definition: vpMbTracker.h:133
virtual void setCovarianceComputation(const bool &flag)
Definition: vpMbTracker.h:497
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:156
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:478
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:296
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:555
Class to define RGB colors available for display functionnalities.
Definition: vpColor.h:157
virtual vpMbtPolygon * getPolygon(unsigned int index)
Definition: vpMbTracker.h:393
virtual double getInitialMu() const
Definition: vpMbTracker.h:282
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:641
virtual double getProjectionError() const
Definition: vpMbTracker.h:308
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:561
bool useOgre
Use Ogre3d for visibility tests.
Definition: vpMbTracker.h:155
virtual vpMbtOptimizationMethod getOptimizationMethod() const
Definition: vpMbTracker.h:382
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:592
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:421
virtual double getAngleDisappear() const
Definition: vpMbTracker.h:239
vpMatrix oJo
The Degrees of Freedom to estimate.
Definition: vpMbTracker.h:115
virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Definition: vpMbTracker.h:615
virtual void getPose(vpHomogeneousMatrix &cMo) const
Definition: vpMbTracker.h:412
virtual void setCameraParameters(const vpCameraParameters &cam)
Definition: vpMbTracker.h:485
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:526
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:533
virtual void setStopCriteriaEpsilon(const double eps)
Definition: vpMbTracker.h:569
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:467
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:625
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:587
virtual void setProjectionErrorDisplayArrowThickness(unsigned int thickness)
Definition: vpMbTracker.h:597
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:366
vpCameraParameters m_projectionErrorCam
Camera parameters used for projection error computation.
Definition: vpMbTracker.h:219
virtual void setMaxIter(unsigned int max)
Definition: vpMbTracker.h:542
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:263
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:289
void setPoseSavingFilename(const std::string &filename)
Definition: vpMbTracker.h:653
virtual void setScanLineVisibilityTest(const bool &v)
Definition: vpMbTracker.h:599
virtual double getNearClippingDistance() const
Definition: vpMbTracker.h:373
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:330
virtual void setDisplayFeatures(bool displayF)
Definition: vpMbTracker.h:515
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:246
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:337
virtual void setProjectionErrorComputation(const bool &flag)
Definition: vpMbTracker.h:582
virtual double getAngleAppear() const
Definition: vpMbTracker.h:236