ViSP  2.10.0
vpXmlConfigParserKeyPoint.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2014 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://www.irisa.fr/lagadic/visp/visp.html 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  * http://www.irisa.fr/lagadic
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  * XML parser to load configuration for vpKeyPoint class.
33  *
34  * Authors:
35  * Souriya Trinh
36  *
37  *****************************************************************************/
38 
46 #ifndef __vpXmlConfigParserKeyPoint_h__
47 #define __vpXmlConfigParserKeyPoint_h__
48 
49 #include <visp/vpConfig.h>
50 
51 #ifdef VISP_HAVE_XML2
52 
53 #include <iostream>
54 #include <stdlib.h>
55 
56 #include <libxml/xmlmemory.h> // Functions of libxml.
57 
58 #include <visp/vpXmlParser.h>
59 
60 
61 class VISP_EXPORT vpXmlConfigParserKeyPoint: public vpXmlParser
62 {
63 
64 public:
66  typedef enum {
67  conf,
71  name,
87  ransac_consensus_percentage
88  } vpNodeIdentifier;
89 
91  typedef enum {
96  noFilterMatching
97  } vpMatchingMethodEnum;
98 
99 private :
101  std::string m_detectorName;
103  std::string m_extractorName;
105  std::string m_matcherName;
107  double m_matchingFactorThreshold;
109  vpMatchingMethodEnum m_matchingMethod;
111  double m_matchingRatioThreshold;
113  int m_nbRansacIterations;
115  int m_nbRansacMinInlierCount;
117  double m_ransacConsensusPercentage;
119  double m_ransacReprojectionError;
121  double m_ransacThreshold;
123  //it is based on a fixed number.
124  bool m_useRansacConsensusPercentage;
126  bool m_useRansacVVS;
127 
128 
129 public:
130 
132 
138  inline std::string getDetectorName() const {
139  return m_detectorName;
140  }
141 
147  inline std::string getExtractorName() const {
148  return m_extractorName;
149  }
155  inline std::string getMatcherName() const {
156  return m_matcherName;
157  }
163  inline double getMatchingFactorThreshold() const {
164  return m_matchingFactorThreshold;
165  }
166 
173  return m_matchingMethod;
174  }
175 
181  inline double getMatchingRatioThreshold() const {
182  return m_matchingRatioThreshold;
183  }
184 
190  inline int getNbRansacIterations() const {
191  return m_nbRansacIterations;
192  }
193 
199  inline int getNbRansacMinInlierCount() const {
200  return m_nbRansacMinInlierCount;
201  }
202 
208  inline double getRansacConsensusPercentage() const {
209  return m_ransacConsensusPercentage;
210  }
211 
217  inline double getRansacReprojectionError() const {
218  return m_ransacReprojectionError;
219  }
220 
226  inline double getRansacThreshold() const {
227  return m_ransacThreshold;
228  }
229 
235  inline bool getUseRansacConsensusPercentage() const {
236  return m_useRansacConsensusPercentage;
237  }
238 
245  inline bool getUseRansacVVSPoseEstimation() const {
246  return m_useRansacVVS;
247  }
248 
254  void parse(const std::string &filename);
255 
256 
257 private:
258 
259  void init();
260  void read_detector(xmlDocPtr doc, xmlNodePtr node);
261  void read_extractor(xmlDocPtr doc, xmlNodePtr node);
262  void read_matcher(xmlDocPtr doc, xmlNodePtr node);
263  virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node);
264  void read_ransac(xmlDocPtr doc, xmlNodePtr node);
265  virtual void writeMainClass(xmlNodePtr ){};
266 
267 };
268 #endif //VISP_HAVE_XML2
269 #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:178
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
vpMatchingMethodEnum getMatchingMethod() const
void parse(const std::string &filename)