41 #include <visp/vpConfig.h>
48 #include <libxml/xmlmemory.h>
50 #include <visp/vpMbtKltXmlParser.h>
108 std::string file = filename;
133 bool klt_node =
false;
134 bool camera_node =
false;
135 bool face_node =
false;
137 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
138 if(dataNode->type == XML_ELEMENT_NODE){
139 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
140 if(iter_data !=
nodeMap.end()){
141 switch (iter_data->second){
163 std::cout <<
"WARNING: KLT Node not specified, default values used" << std::endl;
166 std::cout <<
"WARNING: CAMERA Node not specified, default values used" << std::endl;
169 std::cout <<
"WARNING: FACE Node not specified, default values used" << std::endl;
183 bool angle_appear_node =
false;
184 bool angle_disappear_node =
false;
186 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
187 if(dataNode->type == XML_ELEMENT_NODE){
188 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
189 if(iter_data !=
nodeMap.end()){
190 switch (iter_data->second){
193 angle_appear_node =
true;
197 angle_disappear_node =
true;
207 if(!angle_appear_node)
208 std::cout <<
"WARNING: In FACE Node, ANGLE_APPEAR Node not specified, default value used : " <<
angleAppear << std::endl;
210 std::cout <<
"face : Angle Appear "<<
angleAppear <<std::endl;
212 if(!angle_disappear_node)
213 std::cout <<
"WARNING: In FACE Node, ANGLE_DESAPPEAR Node not specified, default value used : " <<
angleDisappear << std::endl;
215 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<std::endl;
229 bool mask_border_node =
false;
230 bool max_features_node =
false;
231 bool window_size_node =
false;
232 bool quality_node =
false;
233 bool min_distance_node =
false;
234 bool harris_node =
false;
235 bool size_block_node =
false;
236 bool pyramid_lvl_node =
false;
238 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
239 if(dataNode->type == XML_ELEMENT_NODE){
240 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
241 if(iter_data !=
nodeMap.end()){
242 switch (iter_data->second){
245 mask_border_node =
true;
249 max_features_node =
true;
253 window_size_node =
true;
261 min_distance_node =
true;
269 size_block_node =
true;
273 pyramid_lvl_node =
true;
283 if(!mask_border_node)
284 std::cout <<
"WARNING: In KLT Node, MASK_BORDER Node not specified, default value used : " <<
maskBorder << std::endl;
286 std::cout <<
"klt : Mask Border : "<<
maskBorder <<std::endl;
288 if(!max_features_node)
289 std::cout <<
"WARNING: In KLT Node, MAX_FEATURES Node not specified, default value used : " <<
maxFeatures << std::endl;
291 std::cout <<
"klt : Max Features : "<<
maxFeatures <<std::endl;
293 if(!window_size_node)
294 std::cout <<
"WARNING: In KLT Node, WINDOW_SIZE Node not specified, default value used : " <<
winSize << std::endl;
296 std::cout <<
"klt : Windows Size : "<<
winSize <<std::endl;
299 std::cout <<
"WARNING: In KLT Node, QUALITY Node not specified, default value used : " <<
qualityValue << std::endl;
301 std::cout <<
"klt : Quality : "<<
qualityValue <<std::endl;
303 if(!min_distance_node)
304 std::cout <<
"WARNING: In KLT Node, MIN_DISTANCE Node not specified, default value used : " <<
minDist << std::endl;
306 std::cout <<
"klt : Min Distance : "<<
minDist <<std::endl;
309 std::cout <<
"WARNING: In KLT Node, HARRIS Node not specified, default value used : " <<
harrisParam << std::endl;
311 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<std::endl;
314 std::cout <<
"WARNING: In KLT Node, SIZE_BLOCK Node not specified, default value used : " <<
blockSize << std::endl;
316 std::cout <<
"klt : Block Size : "<<
blockSize <<std::endl;
318 if(!pyramid_lvl_node)
319 std::cout <<
"WARNING: In KLT Node, PYRAMID_LVL Node not specified, default value used : " <<
pyramidLevels << std::endl;
321 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<std::endl;
335 bool height_node =
false;
336 bool width_node =
false;
337 bool u0_node =
false;
338 bool v0_node =
false;
339 bool px_node =
false;
340 bool py_node =
false;
350 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
351 if(dataNode->type == XML_ELEMENT_NODE){
352 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
353 if(iter_data !=
nodeMap.end()){
354 switch (iter_data->second){
390 std::cout <<
"WARNING: In CAMERA Node, HEIGHT Node not specified, default value used" << std::endl;
393 std::cout <<
"WARNING: In CAMERA Node, WIDTH Node not specified, default value used" << std::endl;
396 std::cout <<
"WARNING: In CAMERA Node, u0 Node not specified, default value used : " << this->
cam.
get_u0() << std::endl;
398 std::cout <<
"camera : u0 "<< this->
cam.
get_u0() <<std::endl;
401 std::cout <<
"WARNING: In CAMERA Node, v0 Node not specified, default value used : " << this->
cam.
get_v0() << std::endl;
403 std::cout <<
"camera : v0 "<< this->
cam.
get_v0() <<std::endl;
406 std::cout <<
"WARNING: In CAMERA Node, px Node not specified, default value used : " << this->
cam.
get_px() << std::endl;
408 std::cout <<
"camera : px "<< this->
cam.
get_px() <<std::endl;
411 std::cout <<
"WARNING: In CAMERA Node, py Node not specified, default value used : " << this->
cam.
get_py() << std::endl;
413 std::cout <<
"camera : py "<< this->
cam.
get_py() <<std::endl;
unsigned int winSize
Windows size.
void setMainTag(const std::string &tag)
void parse(const char *filename)
double minDist
Minimum distance between klt points.
unsigned int maskBorder
Border of the mask used on Klt points.
error that can be emited by ViSP classes.
double angleAppear
Angle to determine if a face appeared.
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.
void readMainClass(xmlDocPtr doc, xmlNodePtr node)
void read_camera(xmlDocPtr doc, xmlNodePtr node)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
void read_face(xmlDocPtr doc, xmlNodePtr node)
unsigned int pyramidLevels
Number of pyramid levels.
int xmlReadIntChild(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
vpCameraParameters cam
Camera parameters.
void writeMainClass(xmlNodePtr node)
void parse(const std::string &filename)