Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
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 <algorithm>
49 #include <cctype>
50 #include <fstream>
51 #include <functional> // std::not1
52 #include <locale>
53 #include <map>
54 #include <sstream>
55 #include <string>
56 #include <vector>
57 
58 #include <visp3/core/vpCameraParameters.h>
59 #include <visp3/core/vpColVector.h>
60 #include <visp3/core/vpHomogeneousMatrix.h>
61 #include <visp3/core/vpImage.h>
62 #include <visp3/core/vpImagePoint.h>
63 #include <visp3/core/vpMatrix.h>
64 #include <visp3/core/vpPoint.h>
65 #include <visp3/core/vpPolygon.h>
66 #include <visp3/core/vpRGBa.h>
67 #include <visp3/core/vpRobust.h>
68 #include <visp3/mbt/vpMbHiddenFaces.h>
69 #include <visp3/mbt/vpMbtPolygon.h>
70 
71 #include <visp3/mbt/vpMbtDistanceCircle.h>
72 #include <visp3/mbt/vpMbtDistanceCylinder.h>
73 #include <visp3/mbt/vpMbtDistanceLine.h>
74 
75 #ifdef VISP_HAVE_COIN3D
76 // Work around to avoid type redefinition int8_t with Coin
77 // #if defined(_WIN32) && defined(VISP_HAVE_OGRE) && (_MSC_VER >= 1600) //
78 // Visual Studio 2010
79 // #define HAVE_INT8_T 1
80 // #endif
81 
82 // Inventor includes
83 #include <Inventor/VRMLnodes/SoVRMLGroup.h>
84 #include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h>
85 #include <Inventor/VRMLnodes/SoVRMLIndexedLineSet.h>
86 #endif
87 
110 class VISP_EXPORT vpMbTracker
111 {
112 public:
113  typedef enum { GAUSS_NEWTON_OPT = 0, LEVENBERG_MARQUARDT_OPT = 1 } vpMbtOptimizationMethod;
114 
115 protected:
126  std::string modelFileName;
132  std::string poseSavingFilename;
147 
151  double angleAppears;
155  double distNearClip;
157  double distFarClip;
159  unsigned int clippingFlag;
161  bool useOgre;
166  unsigned int nbPoints;
168  unsigned int nbLines;
170  unsigned int nbPolygonLines;
172  unsigned int nbPolygonPoints;
174  unsigned int nbCylinders;
176  unsigned int nbCircles;
188  std::map<std::string, std::string> mapOfParameterNames;
193  double m_lambda;
195  unsigned int m_maxIter;
199  double m_initialMu;
200 
202  std::vector<vpMbtDistanceLine *> m_projectionErrorLines;
204  std::vector<vpMbtDistanceCylinder *> m_projectionErrorCylinders;
206  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 &camera) const { camera = this->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(const 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(const bool orderPolygons = true, const bool useVisibility = true, const bool clipPolygon = false);
406 
414  virtual inline void getPose(vpHomogeneousMatrix &cMo_) const { cMo_ = this->cMo; }
415 
423  virtual inline vpHomogeneousMatrix getPose() const { return this->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, const bool displayHelp = false,
432  virtual void initClick(const vpImage<unsigned char> &I, const std::vector<vpPoint> &points3D_list,
433  const std::string &displayFile = "");
434 #endif
435 
436  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::string &initFile);
437  virtual void initFromPoints(const vpImage<unsigned char> &I, const std::vector<vpImagePoint> &points2D_list,
438  const std::vector<vpPoint> &points3D_list);
439 
440  virtual void initFromPose(const vpImage<unsigned char> &I, const std::string &initFile);
441  virtual void initFromPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
442  virtual void initFromPose(const vpImage<unsigned char> &I, const vpPoseVector &cPo);
443 
444  virtual void loadModel(const std::string &modelFile, const bool verbose = false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix());
445 
455  virtual inline void setAngleAppear(const double &a) { angleAppears = a; }
456 
466  virtual inline void setAngleDisappear(const double &a) { angleDisappears = a; }
467 
473  virtual void setCameraParameters(const vpCameraParameters &camera) { this->cam = camera; }
474 
475  virtual void setClipping(const unsigned int &flags);
476 
485  virtual void setCovarianceComputation(const bool &flag) { computeCovariance = flag; }
486 
503  virtual void setDisplayFeatures(const bool displayF) { displayFeatures = displayF; }
504 
505  virtual void setEstimatedDoF(const vpColVector &v);
506 
507  virtual void setFarClippingDistance(const double &dist);
508 
514  virtual inline void setInitialMu(const double mu) { m_initialMu = mu; }
515 
521  virtual inline void setLambda(const double gain) { m_lambda = gain; }
522 
523  virtual void setLod(const bool useLod, const std::string &name = "");
524 
530  virtual inline void setMaxIter(const unsigned int max) { m_maxIter = max; }
531 
532  virtual void setMinLineLengthThresh(const double minLineLengthThresh, const std::string &name = "");
533 
534  virtual void setMinPolygonAreaThresh(const double minPolygonAreaThresh, const std::string &name = "");
535 
536  virtual void setNearClippingDistance(const double &dist);
537 
543  virtual inline void setOptimizationMethod(const vpMbtOptimizationMethod &opt) { m_optimizationMethod = opt; }
544 
545  void setProjectionErrorMovingEdge(const vpMe &me);
546 
547  void setProjectionErrorKernelSize(const unsigned int &size);
548 
549  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
550 
557  virtual inline void setStopCriteriaEpsilon(const double eps) { m_stopCriteriaEpsilon = eps; }
558 
570  virtual void setProjectionErrorComputation(const bool &flag) { computeProjError = flag; }
571 
575  virtual void setProjectionErrorDisplay(const bool display) { m_projectionErrorDisplay = display; }
576 
580  virtual void setProjectionErrorDisplayArrowLength(const unsigned int length) { m_projectionErrorDisplayLength = length; }
581 
585  virtual void setProjectionErrorDisplayArrowThickness(const unsigned int thickness) { m_projectionErrorDisplayThickness = thickness; }
586 
587  virtual void setScanLineVisibilityTest(const bool &v) { useScanLine = v; }
588 
589  virtual void setOgreVisibilityTest(const bool &v);
590 
591  void savePose(const std::string &filename) const;
592 
593 #ifdef VISP_HAVE_OGRE
594 
603  virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio) { faces.setGoodNbRayCastingAttemptsRatio(ratio); }
613  virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
614  {
615  faces.setNbRayCastingAttemptsForVisibility(attempts);
616  }
617 #endif
618 
629  inline virtual void setOgreShowConfigDialog(const bool showConfigDialog) { ogreShowConfigDialog = showConfigDialog; }
630 
641  inline void setPoseSavingFilename(const std::string &filename) { poseSavingFilename = filename; }
642 
643  /* PURE VIRTUAL METHODS */
644 
657  virtual void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
658  const vpColor &col, const unsigned int thickness = 1, const bool displayFullModel = false) = 0;
671  virtual void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
672  const vpColor &col, const unsigned int thickness = 1, const bool displayFullModel = false) = 0;
673 
679  virtual void init(const vpImage<unsigned char> &I) = 0;
680 
688  virtual void loadConfigFile(const std::string &configFile);
689 
693  virtual void resetTracker() = 0;
694 
705  virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cdMo) = 0;
706 
712  virtual void testTracking() = 0;
713 
719  virtual void track(const vpImage<unsigned char> &I) = 0;
720 
721 protected:
723  void addPolygon(const std::vector<vpPoint> &corners, const int idFace = -1, const std::string &polygonName = "",
724  const bool useLod = false, const double minPolygonAreaThreshold = 2500.0,
725  const double minLineLengthThreshold = 50.0);
726  void addPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius, const int idFace = -1,
727  const std::string &polygonName = "", const bool useLod = false,
728  const double minPolygonAreaThreshold = 2500.0);
729  void addPolygon(const vpPoint &p1, const vpPoint &p2, const int idFace = -1, const std::string &polygonName = "",
730  const bool useLod = false, const double minLineLengthThreshold = 50);
731  void addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, const int idFace = -1,
732  const std::string &polygonName = "", const bool useLod = false,
733  const double minLineLengthThreshold = 50);
734 
735  void addProjectionErrorCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, const double r, int idFace = -1,
736  const std::string &name = "");
737  void addProjectionErrorCylinder(const vpPoint &P1, const vpPoint &P2, const double r, int idFace = -1, const std::string &name = "");
738  void addProjectionErrorLine(vpPoint &p1, vpPoint &p2, int polygon = -1, std::string name = "");
739 
740  void addProjectionErrorPolygon(const std::vector<vpPoint> &corners, const int idFace = -1, const std::string &polygonName = "",
741  const bool useLod = false, const double minPolygonAreaThreshold = 2500.0,
742  const double minLineLengthThreshold = 50.0);
743  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius, const int idFace = -1,
744  const std::string &polygonName = "", const bool useLod = false,
745  const double minPolygonAreaThreshold = 2500.0);
746  void addProjectionErrorPolygon(const vpPoint &p1, const vpPoint &p2, const int idFace = -1, const std::string &polygonName = "",
747  const bool useLod = false, const double minLineLengthThreshold = 50);
748  void addProjectionErrorPolygon(const std::vector<std::vector<vpPoint> > &listFaces, const int idFace = -1,
749  const std::string &polygonName = "", const bool useLod = false,
750  const double minLineLengthThreshold = 50);
751 
752  void createCylinderBBox(const vpPoint &p1, const vpPoint &p2, const double &radius,
753  std::vector<std::vector<vpPoint> > &listFaces);
754 
755  virtual void computeCovarianceMatrixVVS(const bool isoJoIdentity_, const vpColVector &w_true,
756  const vpHomogeneousMatrix &cMoPrev, const vpMatrix &L_true,
757  const vpMatrix &LVJ_true, const vpColVector &error);
758 
759  void computeJTR(const vpMatrix &J, const vpColVector &R, vpColVector &JTR) const;
760 
761  double computeProjectionErrorImpl(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo,
762  const vpCameraParameters &_cam, unsigned int &nbFeatures);
763 
764  virtual void computeVVSCheckLevenbergMarquardt(const unsigned int iter, vpColVector &error,
765  const vpColVector &m_error_prev, const vpHomogeneousMatrix &cMoPrev,
766  double &mu, bool &reStartFromLastIncrement,
767  vpColVector *const w = NULL, const vpColVector *const m_w_prev = NULL);
768  virtual void computeVVSInit() = 0;
769  virtual void computeVVSInteractionMatrixAndResidu() = 0;
770  virtual void computeVVSPoseEstimation(const bool isoJoIdentity_, const unsigned int iter, vpMatrix &L, vpMatrix &LTL,
771  vpColVector &R, const vpColVector &error, vpColVector &error_prev,
772  vpColVector &LTR, double &mu, vpColVector &v, const vpColVector *const w = NULL,
773  vpColVector *const m_w_prev = NULL);
774  virtual void computeVVSWeights(vpRobust &robust, const vpColVector &error, vpColVector &w);
775 
776 #ifdef VISP_HAVE_COIN3D
777  virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, int &idFace);
778  virtual void extractFaces(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
779  const std::string &polygonName = "");
780  virtual void extractLines(SoVRMLIndexedLineSet *line_set, int &idFace, const std::string &polygonName = "");
781  virtual void extractCylinders(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, int &idFace,
782  const std::string &polygonName = "");
783 #endif
784 
785  vpPoint getGravityCenter(const std::vector<vpPoint> &_pts) const;
786 
799  virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius,
800  const int idFace = 0, const std::string &name = "") = 0;
811  virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const int idFace = 0,
812  const std::string &name = "") = 0;
813 
826  virtual void initFaceFromCorners(vpMbtPolygon &polygon) = 0;
827  virtual void initFaceFromLines(vpMbtPolygon &polygon) = 0;
828 
829  void initProjectionErrorCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, const double radius,
830  const int idFace = 0, const std::string &name = "");
831  void initProjectionErrorCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const int idFace = 0,
832  const std::string &name = "");
833  void initProjectionErrorFaceFromCorners(vpMbtPolygon &polygon);
834  void initProjectionErrorFaceFromLines(vpMbtPolygon &polygon);
835 
836  virtual void loadVRMLModel(const std::string &modelFile);
837  virtual void loadCAOModel(const std::string &modelFile, std::vector<std::string> &vectorOfModelFilename,
838  int &startIdFace, const bool verbose = false, const bool parent = true,
840 
841  void projectionErrorInitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo);
842  void projectionErrorResetMovingEdges();
843  void projectionErrorVisibleFace(const vpImage<unsigned char> &_I, const vpHomogeneousMatrix &_cMo);
844 
845  void removeComment(std::ifstream &fileId);
846 
847  inline bool parseBoolean(std::string &input)
848  {
849  std::transform(input.begin(), input.end(), input.begin(), ::tolower);
850  std::istringstream is(input);
851  bool b;
852  // Parse string to boolean either in the textual representation
853  // (True/False) or in numeric representation (1/0)
854  is >> (input.size() > 1 ? std::boolalpha : std::noboolalpha) >> b;
855  return b;
856  }
857 
858  std::map<std::string, std::string> parseParameters(std::string &endLine);
859 
860  inline std::string &ltrim(std::string &s) const
861  {
862  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
863  return s;
864  }
865 
866  inline std::string &rtrim(std::string &s) const
867  {
868  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
869  return s;
870  }
871 
872  inline std::string &trim(std::string &s) const { return ltrim(rtrim(s)); }
873 
874  bool samePoint(const vpPoint &P1, const vpPoint &P2) const;
875 };
876 
877 #endif
bool m_computeInteraction
Definition: vpMbTracker.h:191
bool computeProjError
Definition: vpMbTracker.h:139
virtual void setDisplayFeatures(const bool displayF)
Definition: vpMbTracker.h:503
virtual void setCovarianceComputation(const bool &flag)
Definition: vpMbTracker.h:485
virtual void setOgreShowConfigDialog(const bool showConfigDialog)
Definition: vpMbTracker.h:629
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:104
vpMatrix covarianceMatrix
Covariance matrix.
Definition: vpMbTracker.h:136
bool parseBoolean(std::string &input)
Definition: vpMbTracker.h:847
bool m_projectionErrorDisplay
Display gradient and model orientation for projection error computation.
Definition: vpMbTracker.h:219
unsigned int m_projectionErrorDisplayLength
Length of the arrows used to show the gradient and model orientation.
Definition: vpMbTracker.h:221
unsigned int nbLines
Number of lines in CAO model.
Definition: vpMbTracker.h:168
virtual double getAngleAppear() const
Definition: vpMbTracker.h:238
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:256
virtual void setAngleDisappear(const double &a)
Definition: vpMbTracker.h:466
unsigned int nbCircles
Number of circles in CAO model.
Definition: vpMbTracker.h:176
vpMbHiddenFaces< vpMbtPolygon > faces
Set of faces describing the object.
Definition: vpMbTracker.h:149
virtual vpMbtOptimizationMethod getOptimizationMethod() const
Definition: vpMbTracker.h:384
Implementation of an homogeneous matrix and operations on such kind of matrices.
std::map< std::string, std::string > mapOfParameterNames
Definition: vpMbTracker.h:188
unsigned int nbCylinders
Number of cylinders in CAO model.
Definition: vpMbTracker.h:174
unsigned int nbPoints
Number of points in CAO model.
Definition: vpMbTracker.h:166
virtual void setOptimizationMethod(const vpMbtOptimizationMethod &opt)
Definition: vpMbTracker.h:543
Class to define colors available for display functionnalities.
Definition: vpColor.h:120
vpHomogeneousMatrix cMo
The current pose.
Definition: vpMbTracker.h:119
vpMe m_projectionErrorMe
Moving-Edges parameters for projection error.
Definition: vpMbTracker.h:211
std::string & rtrim(std::string &s) const
Definition: vpMbTracker.h:866
bool modelInitialised
Definition: vpMbTracker.h:129
virtual double getStopCriteriaEpsilon() const
Definition: vpMbTracker.h:425
virtual double getLambda() const
Definition: vpMbTracker.h:291
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:549
bool useOgre
Use Ogre3d for visibility tests.
Definition: vpMbTracker.h:161
std::string modelFileName
Definition: vpMbTracker.h:126
virtual void setMaxIter(const unsigned int max)
Definition: vpMbTracker.h:530
bool computeCovariance
Flag used to specify if the covariance matrix has to be computed or not.
Definition: vpMbTracker.h:134
virtual void setInitialMu(const double mu)
Definition: vpMbTracker.h:514
void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Class that defines what is a point.
Definition: vpPoint.h:58
vpCameraParameters cam
The camera parameters.
Definition: vpMbTracker.h:117
std::string & ltrim(std::string &s) const
Definition: vpMbTracker.h:860
virtual double getAngleDisappear() const
Definition: vpMbTracker.h:241
bool m_projectionErrorOgreShowConfigDialog
Definition: vpMbTracker.h:209
double distFarClip
Distance for near clipping.
Definition: vpMbTracker.h:157
double projectionError
Definition: vpMbTracker.h:142
vpMatrix oJo
The Degrees of Freedom to estimate.
Definition: vpMbTracker.h:121
virtual void setGoodNbRayCastingAttemptsRatio(const double &ratio)
Definition: vpMbTracker.h:603
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:473
virtual vpHomogeneousMatrix getPose() const
Definition: vpMbTracker.h:423
bool useScanLine
Use Scanline for visibility tests.
Definition: vpMbTracker.h:164
double minLineLengthThresholdGeneral
Minimum line length threshold for LOD mode (general setting)
Definition: vpMbTracker.h:183
virtual void setStopCriteriaEpsilon(const double eps)
Definition: vpMbTracker.h:557
virtual double getInitialMu() const
Definition: vpMbTracker.h:284
void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
virtual void getCameraParameters(vpCameraParameters &camera) const
Definition: vpMbTracker.h:248
virtual double getProjectionError() const
Definition: vpMbTracker.h:310
Generic class defining intrinsic camera parameters.
Main methods for a model-based tracker.
Definition: vpMbTracker.h:110
vpMatrix m_SobelX
Sobel kernel in X.
Definition: vpMbTracker.h:215
std::string & trim(std::string &s) const
Definition: vpMbTracker.h:872
double m_initialMu
Initial Mu for Levenberg Marquardt optimization loop.
Definition: vpMbTracker.h:199
double m_lambda
Gain of the virtual visual servoing stage.
Definition: vpMbTracker.h:193
unsigned int nbPolygonLines
Number of polygon lines in CAO model.
Definition: vpMbTracker.h:170
virtual void setAngleAppear(const double &a)
Definition: vpMbTracker.h:455
virtual void setProjectionErrorDisplay(const bool display)
Definition: vpMbTracker.h:575
vpMbtOptimizationMethod m_optimizationMethod
Optimization method used.
Definition: vpMbTracker.h:146
virtual void setLambda(const double gain)
Definition: vpMbTracker.h:521
double angleAppears
Angle used to detect a face appearance.
Definition: vpMbTracker.h:151
virtual void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
Definition: vpMbTracker.h:613
unsigned int m_maxIter
Maximum number of iterations of the virtual visual servoing stage.
Definition: vpMbTracker.h:195
std::string poseSavingFilename
Definition: vpMbTracker.h:132
std::vector< vpMbtDistanceLine * > m_projectionErrorLines
Distance line primitives for projection error.
Definition: vpMbTracker.h:202
unsigned int size() const
const vpImage< bool > * m_mask
Mask used to disable tracking on a part of image.
Definition: vpMbTracker.h:227
virtual double getNearClippingDistance() const
Definition: vpMbTracker.h:375
virtual unsigned int getMaxIter() const
Definition: vpMbTracker.h:298
unsigned int nbPolygonPoints
Number of polygon points in CAO model.
Definition: vpMbTracker.h:172
double m_stopCriteriaEpsilon
Epsilon threshold to stop the VVS optimization loop.
Definition: vpMbTracker.h:197
double minPolygonAreaThresholdGeneral
Minimum polygon area threshold for LOD mode (general setting)
Definition: vpMbTracker.h:185
bool displayFeatures
If true, the features are displayed.
Definition: vpMbTracker.h:144
bool ogreShowConfigDialog
Definition: vpMbTracker.h:162
vpCameraParameters m_projectionErrorCam
Camera parameters used for projection error computation.
Definition: vpMbTracker.h:225
bool applyLodSettingInConfig
Definition: vpMbTracker.h:181
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:92
virtual void setProjectionErrorDisplayArrowLength(const unsigned int length)
Definition: vpMbTracker.h:580
vpMatrix m_SobelY
Sobel kernel in Y.
Definition: vpMbTracker.h:217
virtual void getPose(vpHomogeneousMatrix &cMo_) const
Definition: vpMbTracker.h:414
virtual vpMbtPolygon * getPolygon(const unsigned int index)
Definition: vpMbTracker.h:395
Contains an M-Estimator and various influence function.
Definition: vpRobust.h:58
double angleDisappears
Angle used to detect a face disappearance.
Definition: vpMbTracker.h:153
virtual unsigned int getNbPolygon() const
Definition: vpMbTracker.h:368
void setPoseSavingFilename(const std::string &filename)
Definition: vpMbTracker.h:641
virtual void setScanLineVisibilityTest(const bool &v)
Definition: vpMbTracker.h:587
virtual double getFarClippingDistance() const
Definition: vpMbTracker.h:339
virtual void setProjectionErrorDisplayArrowThickness(const unsigned int thickness)
Definition: vpMbTracker.h:585
unsigned int clippingFlag
Flags specifying which clipping to used.
Definition: vpMbTracker.h:159
unsigned int m_projectionErrorKernelSize
Kernel size used to compute the gradient orientation.
Definition: vpMbTracker.h:213
std::vector< vpMbtDistanceCircle * > m_projectionErrorCircles
Distance circle primitive for projection error.
Definition: vpMbTracker.h:206
double distNearClip
Distance for near clipping.
Definition: vpMbTracker.h:155
bool useLodGeneral
True if LOD mode is enabled.
Definition: vpMbTracker.h:178
virtual vpMbHiddenFaces< vpMbtPolygon > & getFaces()
Definition: vpMbTracker.h:332
bool isoJoIdentity
Boolean to know if oJo is identity (for fast computation)
Definition: vpMbTracker.h:123
unsigned int m_projectionErrorDisplayThickness
Thickness of the arrows used to show the gradient and model orientation.
Definition: vpMbTracker.h:223
vpMbHiddenFaces< vpMbtPolygon > m_projectionErrorFaces
Set of faces describing the object, used for projection error.
Definition: vpMbTracker.h:208
std::vector< vpMbtDistanceCylinder * > m_projectionErrorCylinders
Distance cylinder primitives for projection error.
Definition: vpMbTracker.h:204
virtual void setProjectionErrorComputation(const bool &flag)
Definition: vpMbTracker.h:570
virtual vpMatrix getCovarianceMatrix() const
Definition: vpMbTracker.h:265