Visual Servoing Platform  version 3.6.1 under development (2024-07-15)
vpMbtXmlGenericParser.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 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 https://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  * Load XML Parameter for Model Based Tracker.
33  *
34 *****************************************************************************/
35 
42 #ifndef _vpMbtXmlGenericParser_h_
43 #define _vpMbtXmlGenericParser_h_
44 
45 #include <visp3/core/vpConfig.h>
46 
47 #if defined(VISP_HAVE_PUGIXML)
48 #include <visp3/core/vpCameraParameters.h>
49 #include <visp3/mbt/vpMbtFaceDepthNormal.h>
50 #include <visp3/me/vpMe.h>
51 
62 class VISP_EXPORT vpMbtXmlGenericParser
63 {
64 public:
66  {
67  EDGE_PARSER = 1 << 0,
69  KLT_PARSER = 1 << 1,
70  DEPTH_NORMAL_PARSER = 1 << 2,
72  DEPTH_DENSE_PARSER = 1 << 3,
74  PROJECTION_ERROR_PARSER = 0
75  };
76 
77 public:
78  vpMbtXmlGenericParser(int type = EDGE_PARSER);
79  virtual ~vpMbtXmlGenericParser();
80 
81  double getAngleAppear() const;
82  double getAngleDisappear() const;
83 
84  void getCameraParameters(vpCameraParameters &cam) const;
85 
86  void getEdgeMe(vpMe &ecm) const;
87 
88  unsigned int getDepthDenseSamplingStepX() const;
89  unsigned int getDepthDenseSamplingStepY() const;
90 
91  vpMbtFaceDepthNormal::vpFeatureEstimationType getDepthNormalFeatureEstimationMethod() const;
92  int getDepthNormalPclPlaneEstimationMethod() const;
93  int getDepthNormalPclPlaneEstimationRansacMaxIter() const;
94  double getDepthNormalPclPlaneEstimationRansacThreshold() const;
95  unsigned int getDepthNormalSamplingStepX() const;
96  unsigned int getDepthNormalSamplingStepY() const;
97 
98  double getFarClippingDistance() const;
99  bool getFovClipping() const;
100 
101  unsigned int getKltBlockSize() const;
102  double getKltHarrisParam() const;
103  unsigned int getKltMaskBorder() const;
104  unsigned int getKltMaxFeatures() const;
105  double getKltMinDistance() const;
106  unsigned int getKltPyramidLevels() const;
107  double getKltQuality() const;
108  unsigned int getKltWindowSize() const;
109 
110  bool getLodState() const;
111  double getLodMinLineLengthThreshold() const;
112  double getLodMinPolygonAreaThreshold() const;
113 
114  double getNearClippingDistance() const;
115 
116  void getProjectionErrorMe(vpMe &me) const;
117 
118  unsigned int getProjectionErrorKernelSize() const;
119 
120  bool hasFarClippingDistance() const;
121  bool hasNearClippingDistance() const;
122 
123  void parse(const std::string &filename);
124 
125  void setAngleAppear(const double &aappear);
126  void setAngleDisappear(const double &adisappear);
127 
128  void setCameraParameters(const vpCameraParameters &cam);
129 
130  void setDepthDenseSamplingStepX(unsigned int stepX);
131  void setDepthDenseSamplingStepY(unsigned int stepY);
132 
133  void setDepthNormalFeatureEstimationMethod(const vpMbtFaceDepthNormal::vpFeatureEstimationType &method);
134  void setDepthNormalPclPlaneEstimationMethod(int method);
135  void setDepthNormalPclPlaneEstimationRansacMaxIter(int maxIter);
136  void setDepthNormalPclPlaneEstimationRansacThreshold(double threshold);
137  void setDepthNormalSamplingStepX(unsigned int stepX);
138  void setDepthNormalSamplingStepY(unsigned int stepY);
139 
140  void setEdgeMe(const vpMe &ecm);
141 
142  void setFarClippingDistance(const double &fclip);
143 
144  void setKltBlockSize(const unsigned int &bs);
145  void setKltHarrisParam(const double &hp);
146  void setKltMaskBorder(const unsigned int &mb);
147  void setKltMaxFeatures(const unsigned int &mF);
148  void setKltMinDistance(const double &mD);
149  void setKltPyramidLevels(const unsigned int &pL);
150  void setKltQuality(const double &q);
151  void setKltWindowSize(const unsigned int &w);
152 
153  void setNearClippingDistance(const double &nclip);
154 
155  void setProjectionErrorMe(const vpMe &me);
156  void setProjectionErrorKernelSize(const unsigned int &size);
157 
158  void setVerbose(bool verbose);
159 
160 private:
161  vpMbtXmlGenericParser(const vpMbtXmlGenericParser &); // noncopyable
162  vpMbtXmlGenericParser &operator=(const vpMbtXmlGenericParser &); //
163 
164  // PIMPL idiom
165  class Impl;
166  Impl *m_impl;
167 };
168 END_VISP_NAMESPACE
169 #endif
170 #endif
Generic class defining intrinsic camera parameters.
Parse an Xml file to extract configuration parameters of a mbtConfig object.
Definition: vpMe.h:134