Visual Servoing Platform  version 3.2.0
vpMbtKltXmlParser.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 parameters of the Model based tracker (using point features).
33  *
34  * Authors:
35  * Aurelien Yol
36  *
37  *****************************************************************************/
38 
44 #ifndef vpMbtKltXmlParser_HH
45 #define vpMbtKltXmlParser_HH
46 
47 #include <visp3/core/vpConfig.h>
48 
49 #ifdef VISP_HAVE_XML2
50 
51 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */
52 
53 #include <visp3/mbt/vpMbXmlParser.h>
54 
63 class VISP_EXPORT vpMbtKltXmlParser : virtual public vpMbXmlParser
64 {
65 protected:
67  unsigned int maskBorder;
69  unsigned int maxFeatures;
71  unsigned int winSize;
73  double qualityValue;
75  double minDist;
77  double harrisParam;
79  unsigned int blockSize;
81  unsigned int pyramidLevels;
82 
83  typedef enum {
85  mask_border,
86  max_features,
87  window_size,
88  quality,
89  min_distance,
90  harris,
91  size_block,
92  pyramid_lvl,
93  last
94  } dataToParseMbKlt;
95 
96 public:
100  virtual ~vpMbtKltXmlParser();
101 
107  inline unsigned int getBlockSize() const { return blockSize; }
108 
114  inline double getHarrisParam() const { return harrisParam; }
115 
121  inline unsigned int getMaskBorder() const { return maskBorder; }
122 
128  inline unsigned int getMaxFeatures() const { return maxFeatures; }
129 
135  inline double getMinDistance() const { return minDist; }
136 
142  inline unsigned int getPyramidLevels() const { return pyramidLevels; }
143 
149  inline double getQuality() const { return qualityValue; }
150 
156  inline unsigned int getWindowSize() const { return winSize; }
157 
158  virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node);
159  void read_klt(xmlDocPtr doc, xmlNodePtr node);
160 
166  inline void setBlockSize(const unsigned int &bs) { blockSize = bs; }
167 
173  inline void setHarrisParam(const double &hp) { harrisParam = hp; }
174 
180  inline void setMaskBorder(const unsigned int &mb) { maskBorder = mb; }
181 
187  inline void setMaxFeatures(const unsigned int &mF) { maxFeatures = mF; }
188 
194  inline void setMinDistance(const double &mD) { minDist = mD; }
195 
201  inline void setPyramidLevels(const unsigned int &pL) { pyramidLevels = pL; }
202 
208  inline void setQuality(const double &q) { qualityValue = q; }
209 
215  inline void setWindowSize(const unsigned int &w) { winSize = w; }
216 
217  void writeMainClass(xmlNodePtr node);
219 
220 protected:
223  void init();
225 };
226 
227 #endif
228 
229 #endif
vpMbXmlParser
Parse an Xml file to extract configuration parameters of a mbtConfig object.
Definition: vpMbXmlParser.h:64
vpMbXmlParser::init
void init()
Definition: vpMbXmlParser.cpp:68
vpMbXmlParser::last
Definition: vpMbXmlParser.h:109
vpMbXmlParser::writeMainClass
void writeMainClass(xmlNodePtr node)
Definition: vpMbXmlParser.cpp:97
vpMbtKltXmlParser
Parse an Xml file to extract configuration parameters of a Mbt Klt object.
Definition: vpMbtKltXmlParser.h:62
vpMbXmlParser::readMainClass
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)
Definition: vpMbXmlParser.cpp:109