38 #include <visp3/core/vpConfig.h> 45 #include <libxml/xmlmemory.h> 47 #include <visp3/mbt/vpMbtKltXmlParser.h> 54 : maskBorder(0), maxFeatures(0), winSize(0), qualityValue(0.), minDist(0.), harrisParam(0.), blockSize(0),
91 std::string file = filename;
114 bool camera_node =
false;
115 bool face_node =
false;
116 bool klt_node =
false;
117 bool lod_node =
false;
119 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
120 if (dataNode->type == XML_ELEMENT_NODE) {
121 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
122 if (iter_data !=
nodeMap.end()) {
123 switch (iter_data->second) {
150 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
151 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
152 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
153 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
157 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
158 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
162 std::cout <<
"klt : Mask Border : " <<
maskBorder <<
" (default)" << std::endl;
163 std::cout <<
"klt : Max Features : " <<
maxFeatures <<
" (default)" << std::endl;
164 std::cout <<
"klt : Windows Size : " <<
winSize <<
" (default)" << std::endl;
165 std::cout <<
"klt : Quality : " <<
qualityValue <<
" (default)" << std::endl;
166 std::cout <<
"klt : Min Distance : " <<
minDist <<
" (default)" << std::endl;
167 std::cout <<
"klt : Harris Parameter : " <<
harrisParam <<
" (default)" << std::endl;
168 std::cout <<
"klt : Block Size : " <<
blockSize <<
" (default)" << std::endl;
169 std::cout <<
"klt : Pyramid Levels : " <<
pyramidLevels <<
" (default)" << std::endl;
173 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
189 bool mask_border_node =
false;
190 bool max_features_node =
false;
191 bool window_size_node =
false;
192 bool quality_node =
false;
193 bool min_distance_node =
false;
194 bool harris_node =
false;
195 bool size_block_node =
false;
196 bool pyramid_lvl_node =
false;
198 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
199 if (dataNode->type == XML_ELEMENT_NODE) {
200 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
201 if (iter_data !=
nodeMap.end()) {
202 switch (iter_data->second) {
205 mask_border_node =
true;
209 max_features_node =
true;
213 window_size_node =
true;
221 min_distance_node =
true;
229 size_block_node =
true;
233 pyramid_lvl_node =
true;
244 if (!mask_border_node)
245 std::cout <<
"klt : Mask Border : " <<
maskBorder <<
" (default)" << std::endl;
247 std::cout <<
"klt : Mask Border : " <<
maskBorder << std::endl;
249 if (!max_features_node)
250 std::cout <<
"klt : Max Features : " <<
maxFeatures <<
" (default)" << std::endl;
252 std::cout <<
"klt : Max Features : " <<
maxFeatures << std::endl;
254 if (!window_size_node)
255 std::cout <<
"klt : Windows Size : " <<
winSize <<
" (default)" << std::endl;
257 std::cout <<
"klt : Windows Size : " <<
winSize << std::endl;
260 std::cout <<
"klt : Quality : " <<
qualityValue <<
" (default)" << std::endl;
262 std::cout <<
"klt : Quality : " <<
qualityValue << std::endl;
264 if (!min_distance_node)
265 std::cout <<
"klt : Min Distance : " <<
minDist <<
" (default)" << std::endl;
267 std::cout <<
"klt : Min Distance : " <<
minDist << std::endl;
270 std::cout <<
"klt : Harris Parameter : " <<
harrisParam <<
" (default)" << std::endl;
272 std::cout <<
"klt : Harris Parameter : " <<
harrisParam << std::endl;
274 if (!size_block_node)
275 std::cout <<
"klt : Block Size : " <<
blockSize <<
" (default)" << std::endl;
277 std::cout <<
"klt : Block Size : " <<
blockSize << std::endl;
279 if (!pyramid_lvl_node)
280 std::cout <<
"klt : Pyramid Levels : " <<
pyramidLevels <<
" (default)" << std::endl;
282 std::cout <<
"klt : Pyramid Levels : " <<
pyramidLevels << std::endl;
285 #elif !defined(VISP_BUILD_SHARED_LIBS) 288 void dummy_vpMbtKltXmlParser(){};
unsigned int winSize
Windows size.
vpCameraParameters cam
Camera parameters.
void parse(const char *filename)
void read_lod(xmlDocPtr doc, xmlNodePtr node)
double minDist
Minimum distance between klt points.
unsigned int maskBorder
Border of the mask used on Klt points.
double angleAppear
Angle to determine if a face appeared.
error that can be emited by ViSP classes.
double minLineLengthThreshold
Minimum line length to track a segment when LOD is enabled.
double xmlReadDoubleChild(xmlDocPtr doc, xmlNodePtr node)
double harrisParam
Harris free parameters.
double angleDisappear
Angle to determine if a face disappeared.
unsigned int maxFeatures
Maximum of Klt features.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)
void read_camera(xmlDocPtr doc, xmlNodePtr node)
unsigned int pyramidLevels
Number of pyramid levels.
void read_face(xmlDocPtr doc, xmlNodePtr node)
unsigned int blockSize
Block size.
unsigned int xmlReadUnsignedIntChild(xmlDocPtr doc, xmlNodePtr node)
void read_klt(xmlDocPtr doc, xmlNodePtr node)
double qualityValue
Quality of the Klt points.
virtual ~vpMbtKltXmlParser()
std::map< std::string, int > nodeMap
double minPolygonAreaThreshold
Minimum polygon area to track a face when LOD is enabled.
void writeMainClass(xmlNodePtr node)
bool useLod
If true, the LOD is enabled, otherwise it is not.
void parse(const std::string &filename)