ViSP  2.10.0
vpMbtXmlParser.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtXmlParser.h 5054 2014-12-11 17:50:44Z strinh $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Load XML parameters of the Model based tracker (using edges).
36  *
37  * Authors:
38  * Nicolas Melchior
39  * Romain Tallonneau
40  * Eric Marchand
41  * Aurelien Yol
42  *
43  *****************************************************************************/
44 
50 #ifndef vpMbtXmlParser_HH
51 #define vpMbtXmlParser_HH
52 
53 #include <visp/vpConfig.h>
54 
55 #ifdef VISP_HAVE_XML2
56 
57 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */
58 
59 #include <visp/vpMbXmlParser.h>
60 #include <visp/vpMe.h>
61 
70 class VISP_EXPORT vpMbtXmlParser: virtual public vpMbXmlParser
71 {
72 protected:
73  typedef enum{
82  mu1,
83  mu2,
87  lod,
91  last
92  } dataToParseMb;
93 
97  bool useLod;
102 
103 
104 public:
105 
106  vpMbtXmlParser();
107  virtual ~vpMbtXmlParser();
108 
114  inline bool getLodState() const {
115  return useLod;
116  }
117 
118  void getMe(vpMe& _ecm) const { _ecm = this->m_ecm;}
119 
125  inline double getMinLineLengthThreshold() const {
126  return minLineLengthThreshold;
127  }
128 
134  inline double getMinPolygonAreaThreshold() const {
135  return minPolygonAreaThreshold;
136  }
137 
138  void parse(const char * filename);
139 
140  virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node);
141  void read_ecm (xmlDocPtr doc, xmlNodePtr node);
142  void read_sample (xmlDocPtr doc, xmlNodePtr node);
143  void read_mask (xmlDocPtr doc, xmlNodePtr node);
144  void read_range (xmlDocPtr doc, xmlNodePtr node);
145  void read_contrast (xmlDocPtr doc, xmlNodePtr node);
146  void read_lod (xmlDocPtr doc, xmlNodePtr node);
147 
148  void setMovingEdge(const vpMe &_ecm){ m_ecm = _ecm; }
149 
150  void writeMainClass(xmlNodePtr node);
151 
152 protected:
153  void init();
154 
155 };
156 
157 #endif
158 
159 #endif /* NMBTXMLPARSER_H_ */
160 
161 
162 
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
double minLineLengthThreshold
Minimum line length to track a segment when LOD is enabled.
void getMe(vpMe &_ecm) const
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)
Contains predetermined masks for sites and holds moving edges tracking parameters.
Definition: vpMe.h:70
bool useLod
If true, the LOD is enabled, otherwise it is not.
bool getLodState() const
vpMe m_ecm
Moving edges parameters.
void writeMainClass(xmlNodePtr node)
double getMinPolygonAreaThreshold() const
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
Definition: vpMbXmlParser.h:67
void parse(const char *filename)
double minPolygonAreaThreshold
Minimum polygon area to track a face when LOD is enabled.
void setMovingEdge(const vpMe &_ecm)
double getMinLineLengthThreshold() const