Visual Servoing Platform  version 3.0.0
vpXmlConfigParserKeyPoint.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * XML parser to load configuration for vpKeyPoint class.
32  *
33  * Authors:
34  * Souriya Trinh
35  *
36  *****************************************************************************/
37 
45 #ifndef __vpXmlConfigParserKeyPoint_h__
46 #define __vpXmlConfigParserKeyPoint_h__
47 
48 #include <visp3/core/vpConfig.h>
49 
50 #ifdef VISP_HAVE_XML2
51 
52 #include <iostream>
53 #include <stdlib.h>
54 
55 #include <libxml/xmlmemory.h> // Functions of libxml.
56 
57 #include <visp3/core/vpXmlParser.h>
58 
63 class VISP_EXPORT vpXmlConfigParserKeyPoint: public vpXmlParser
64 {
65 
66 public:
68  typedef enum {
69  conf,
73  name,
89  ransac_consensus_percentage
90  } vpNodeIdentifier;
91 
93  typedef enum {
98  noFilterMatching
99  } vpMatchingMethodEnum;
100 
101 private :
103  std::string m_detectorName;
105  std::string m_extractorName;
107  std::string m_matcherName;
109  double m_matchingFactorThreshold;
111  vpMatchingMethodEnum m_matchingMethod;
113  double m_matchingRatioThreshold;
115  int m_nbRansacIterations;
117  int m_nbRansacMinInlierCount;
119  double m_ransacConsensusPercentage;
121  double m_ransacReprojectionError;
123  double m_ransacThreshold;
125  //it is based on a fixed number.
126  bool m_useRansacConsensusPercentage;
128  bool m_useRansacVVS;
129 
130 
131 public:
132 
134 
140  inline std::string getDetectorName() const {
141  return m_detectorName;
142  }
143 
149  inline std::string getExtractorName() const {
150  return m_extractorName;
151  }
157  inline std::string getMatcherName() const {
158  return m_matcherName;
159  }
165  inline double getMatchingFactorThreshold() const {
166  return m_matchingFactorThreshold;
167  }
168 
175  return m_matchingMethod;
176  }
177 
183  inline double getMatchingRatioThreshold() const {
184  return m_matchingRatioThreshold;
185  }
186 
192  inline int getNbRansacIterations() const {
193  return m_nbRansacIterations;
194  }
195 
201  inline int getNbRansacMinInlierCount() const {
202  return m_nbRansacMinInlierCount;
203  }
204 
210  inline double getRansacConsensusPercentage() const {
211  return m_ransacConsensusPercentage;
212  }
213 
219  inline double getRansacReprojectionError() const {
220  return m_ransacReprojectionError;
221  }
222 
228  inline double getRansacThreshold() const {
229  return m_ransacThreshold;
230  }
231 
237  inline bool getUseRansacConsensusPercentage() const {
238  return m_useRansacConsensusPercentage;
239  }
240 
247  inline bool getUseRansacVVSPoseEstimation() const {
248  return m_useRansacVVS;
249  }
250 
256  void parse(const std::string &filename);
257 
258 
259 private:
260 
261  void init();
262  void read_detector(xmlDocPtr doc, xmlNodePtr node);
263  void read_extractor(xmlDocPtr doc, xmlNodePtr node);
264  void read_matcher(xmlDocPtr doc, xmlNodePtr node);
265  virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node);
266  void read_ransac(xmlDocPtr doc, xmlNodePtr node);
267  virtual void writeMainClass(xmlNodePtr ){};
268 
269 };
270 #endif //VISP_HAVE_XML2
271 #endif
virtual void writeMainClass(xmlNodePtr node)=0
This class intends to simplify the creation of xml parser based on the libxml2 third party library...
Definition: vpXmlParser.h:174
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
vpMatchingMethodEnum getMatchingMethod() const
void parse(const std::string &filename)