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