Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpXmlConfigParserKeyPoint.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 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 
67 class VISP_EXPORT vpXmlConfigParserKeyPoint: public vpXmlParser
68 {
69 
70 public:
72  typedef enum {
73  conf,
77  name,
93  ransac_consensus_percentage
94  } vpNodeIdentifier;
95 
97  typedef enum {
102  noFilterMatching
103  } vpMatchingMethodEnum;
104 
105 private :
107  std::string m_detectorName;
109  std::string m_extractorName;
111  std::string m_matcherName;
113  double m_matchingFactorThreshold;
115  vpMatchingMethodEnum m_matchingMethod;
117  double m_matchingRatioThreshold;
119  int m_nbRansacIterations;
121  int m_nbRansacMinInlierCount;
123  double m_ransacConsensusPercentage;
125  double m_ransacReprojectionError;
127  double m_ransacThreshold;
129  //it is based on a fixed number.
130  bool m_useRansacConsensusPercentage;
132  bool m_useRansacVVS;
133 
134 
135 public:
136 
140 
146  inline std::string getDetectorName() const {
147  return m_detectorName;
148  }
149 
155  inline std::string getExtractorName() const {
156  return m_extractorName;
157  }
163  inline std::string getMatcherName() const {
164  return m_matcherName;
165  }
171  inline double getMatchingFactorThreshold() const {
172  return m_matchingFactorThreshold;
173  }
174 
181  return m_matchingMethod;
182  }
183 
189  inline double getMatchingRatioThreshold() const {
190  return m_matchingRatioThreshold;
191  }
192 
198  inline int getNbRansacIterations() const {
199  return m_nbRansacIterations;
200  }
201 
207  inline int getNbRansacMinInlierCount() const {
208  return m_nbRansacMinInlierCount;
209  }
210 
216  inline double getRansacConsensusPercentage() const {
217  return m_ransacConsensusPercentage;
218  }
219 
225  inline double getRansacReprojectionError() const {
226  return m_ransacReprojectionError;
227  }
228 
234  inline double getRansacThreshold() const {
235  return m_ransacThreshold;
236  }
237 
243  inline bool getUseRansacConsensusPercentage() const {
244  return m_useRansacConsensusPercentage;
245  }
246 
253  inline bool getUseRansacVVSPoseEstimation() const {
254  return m_useRansacVVS;
255  }
256 
262  void parse(const std::string &filename);
263 
264 
265 private:
266 
267  void init();
268  void read_detector(xmlDocPtr doc, xmlNodePtr node);
269  void read_extractor(xmlDocPtr doc, xmlNodePtr node);
270  void read_matcher(xmlDocPtr doc, xmlNodePtr node);
271  virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node);
272  void read_ransac(xmlDocPtr doc, xmlNodePtr node);
273  virtual void writeMainClass(xmlNodePtr ){};
274 
275 };
276 #endif //VISP_HAVE_XML2
277 #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:175
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
virtual ~vpXmlConfigParserKeyPoint()
Default destructor.
vpMatchingMethodEnum getMatchingMethod() const
void parse(const std::string &filename)