ViSP
 All Classes Functions Variables Enumerations Enumerator Friends Groups Pages
vpMbtKltXmlParser.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtKltXmlParser.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 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  * Read MBT KLT Tracker information in an XML file
36  *
37  * Authors:
38  * Aurelien Yol
39  *
40  *****************************************************************************/
41 
46 #ifndef vpMbtKltXmlParser_HH
47 #define vpMbtKltXmlParser_HH
48 
49 #include <visp/vpConfig.h>
50 
51 #ifdef VISP_HAVE_XML2
52 
53 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */
54 
55 #include <visp/vpXmlParser.h>
56 #include <visp/vpCameraParameters.h>
57 
66 class VISP_EXPORT vpMbtKltXmlParser: public vpXmlParser
67 {
68 protected:
70  unsigned int maskBorder;
72  unsigned int maxFeatures;
74  unsigned int winSize;
76  double qualityValue;
78  double minDist;
80  double harrisParam;
82  unsigned int blockSize;
84  unsigned int pyramidLevels;
86  double angleAppear;
91 
92  typedef enum{
94  klt,
109  u0,
110  v0,
111  px,
112  py
113  } dataToParse;
114 
115 
116 public:
117 
119  virtual ~vpMbtKltXmlParser();
120 
126  inline double getAngleAppear() const {return angleAppear;}
127 
133  inline double getAngleDisappear() const {return angleDisappear;}
134 
140  inline unsigned int getBlockSize() const {return blockSize;}
141 
147  void getCameraParameters(vpCameraParameters& _cam) const { _cam = cam;}
148 
154  inline double getHarrisParam() const {return harrisParam;}
155 
161  inline unsigned int getMaskBorder() const {return maskBorder;}
162 
168  inline unsigned int getMaxFeatures() const {return maxFeatures;}
169 
175  inline double getMinDistance() const {return minDist;}
176 
182  inline unsigned int getPyramidLevels() const {return pyramidLevels;}
183 
189  inline double getQuality() const {return qualityValue;}
190 
196  inline unsigned int getWindowSize() const {return winSize;}
197 
198  void parse(const char * filename);
199 
200  void readMainClass(xmlDocPtr doc, xmlNodePtr node);
201  void read_camera (xmlDocPtr doc, xmlNodePtr node);
202  void read_klt(xmlDocPtr doc, xmlNodePtr node);
203  void read_face(xmlDocPtr doc, xmlNodePtr node);
204 
210  inline void setAngleAppear(const double &aappear) {angleAppear = aappear;}
211 
217  inline void setAngleDisappear(const double &adisappear) {angleDisappear = adisappear;}
218 
224  inline void setBlockSize(const unsigned int &bs) {blockSize = bs;}
225 
231  void setCameraParameters(const vpCameraParameters& _cam) {cam = _cam;}
232 
238  inline void setHarrisParam(const double &hp) {harrisParam = hp;}
239 
245  inline void setMaskBorder(const unsigned int &mb) {maskBorder = mb;}
246 
252  inline void setMaxFeatures(const unsigned int &mF) {maxFeatures = mF;}
253 
259  inline void setMinDistance(const double &mD) {minDist = mD;}
260 
266  inline void setPyramidLevels(const unsigned int &pL) {pyramidLevels = pL;}
267 
273  inline void setQuality(const double &q) {qualityValue = q;}
274 
280  inline void setWindowSize(const unsigned int &w) {winSize = w;}
281 
282  void writeMainClass(xmlNodePtr node);
283 
284 protected:
285  void init();
286 
287 };
288 
289 #endif
290 
291 #endif
292 
293 
294