43 #include <visp/vpConfig.h>
51 #include <libxml/xmlmemory.h>
53 #include <visp/vpMbtXmlParser.h>
122 std::string file = filename;
147 bool ecm_node =
false;
148 bool sample_node =
false;
149 bool camera_node =
false;
150 bool face_node =
false;
152 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
153 if(dataNode->type == XML_ELEMENT_NODE){
154 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
155 if(iter_data !=
nodeMap.end()){
156 switch (iter_data->second){
182 std::cout <<
"WARNING: ECM Node not specified, default values used" << std::endl;
185 std::cout <<
"WARNING: SAMPLE Node not specified, default values used" << std::endl;
188 std::cout <<
"WARNING: CAMERA Node not specified, default values used" << std::endl;
191 std::cout <<
"WARNING: FACE Node not specified, default values used" << std::endl;
206 bool mask_node =
false;
207 bool range_node =
false;
208 bool contrast_node =
false;
210 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
211 if(dataNode->type == XML_ELEMENT_NODE){
212 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
213 if(iter_data !=
nodeMap.end()){
214 switch (iter_data->second){
225 contrast_node =
true;
236 std::cout <<
"WARNING: In ECM Node, MASK Node not specified, default values used" << std::endl;
239 std::cout <<
"WARNING: In ECM Node, RANGE Node not specified, default values used" << std::endl;
242 std::cout <<
"WARNING: In ECM Node, CONTRAST Node not specified, default values used" << std::endl;
256 bool step_node =
false;
257 bool nb_sample_node =
false;
263 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
264 if(dataNode->type == XML_ELEMENT_NODE){
265 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
266 if(iter_data !=
nodeMap.end()){
267 switch (iter_data->second){
274 nb_sample_node =
true;
288 std::cout <<
"WARNING: In SAMPLE Node, STEP Node not specified, default value used : " << this->
m_ecm.
getSampleStep() << std::endl;
293 std::cout <<
"WARNING: In SAMPLE Node, NB_SAMPLE Node not specified, default value used : " << this->
m_ecm.
getNbTotalSample() << std::endl;
309 bool height_node =
false;
310 bool width_node =
false;
311 bool u0_node =
false;
312 bool v0_node =
false;
313 bool px_node =
false;
314 bool py_node =
false;
324 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
325 if(dataNode->type == XML_ELEMENT_NODE){
326 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
327 if(iter_data !=
nodeMap.end()){
328 switch (iter_data->second){
364 std::cout <<
"WARNING: In CAMERA Node, HEIGHT Node not specified, default value used" << std::endl;
367 std::cout <<
"WARNING: In CAMERA Node, WIDTH Node not specified, default value used" << std::endl;
370 std::cout <<
"WARNING: In CAMERA Node, u0 Node not specified, default value used : " << this->
cam.
get_u0() << std::endl;
372 std::cout <<
"camera : u0 "<< this->
cam.
get_u0() <<std::endl;
375 std::cout <<
"WARNING: In CAMERA Node, v0 Node not specified, default value used : " << this->
cam.
get_v0() << std::endl;
377 std::cout <<
"camera : v0 "<< this->
cam.
get_v0() <<std::endl;
380 std::cout <<
"WARNING: In CAMERA Node, px Node not specified, default value used : " << this->
cam.
get_px() << std::endl;
382 std::cout <<
"camera : px "<< this->
cam.
get_px() <<std::endl;
385 std::cout <<
"WARNING: In CAMERA Node, py Node not specified, default value used : " << this->
cam.
get_py() << std::endl;
387 std::cout <<
"camera : py "<< this->
cam.
get_py() <<std::endl;
401 bool angle_appear_node =
false;
402 bool angle_disappear_node =
false;
403 bool near_clipping_node =
false;
404 bool far_clipping_node =
false;
405 bool fov_clipping_node =
false;
407 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
408 if(dataNode->type == XML_ELEMENT_NODE){
409 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
410 if(iter_data !=
nodeMap.end()){
411 switch (iter_data->second){
414 angle_appear_node =
true;
418 angle_disappear_node =
true;
422 near_clipping_node =
true;
427 far_clipping_node =
true;
432 fov_clipping_node =
true;
442 if(!angle_appear_node)
443 std::cout <<
"WARNING: In FACE Node, ANGLE_APPEAR Node not specified, default value used : " <<
angleAppear << std::endl;
445 std::cout <<
"face : Angle Appear "<<
angleAppear <<std::endl;
447 if(!angle_disappear_node)
448 std::cout <<
"WARNING: In FACE Node, ANGLE_DESAPPEAR Node not specified, default value used : " <<
angleDisappear << std::endl;
450 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<std::endl;
452 if(!near_clipping_node)
453 std::cout <<
"WARNING: In FACE Node, NEAR_CLIPPING Node not specified, no near clipping used" << std::endl;
455 std::cout <<
"face : Near Clipping : "<<
nearClipping <<std::endl;
457 if(!far_clipping_node)
458 std::cout <<
"WARNING: In FACE Node, FAR_CLIPPING Node not specified, no far clipping used" << std::endl;
460 std::cout <<
"face : Far Clipping : "<<
farClipping <<std::endl;
462 if(!fov_clipping_node)
463 std::cout <<
"WARNING: In FACE Node, FOV_CLIPPING Node not specified, no fov clipping used" << std::endl;
466 std::cout <<
"face : Fov Clipping : True" <<std::endl;
468 std::cout <<
"face : Fov Clipping : False" <<std::endl;
483 bool size_node =
false;
484 bool nb_mask_node =
false;
490 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
491 if(dataNode->type == XML_ELEMENT_NODE){
492 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
493 if(iter_data !=
nodeMap.end()){
494 switch (iter_data->second){
515 std::cout <<
"WARNING: In MASK Node, SIZE Node not specified, default value used : " << this->
m_ecm.
getMaskSize() << std::endl;
520 std::cout <<
"WARNING: In MASK Node, NB_MASK Node not specified, default value used : " << this->
m_ecm.
getMaskNumber() << std::endl;
536 bool tracking_node =
false;
541 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
542 if(dataNode->type == XML_ELEMENT_NODE){
543 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
544 if(iter_data !=
nodeMap.end()){
545 switch (iter_data->second){
548 tracking_node =
true;
561 std::cout <<
"WARNING: In RANGE Node, TRACKING Node not specified, default value used : " << this->
m_ecm.
getRange() << std::endl;
563 std::cout <<
"ecm : range : tracking "<< this->
m_ecm.
getRange()<<std::endl;
578 bool edge_threshold_node =
false;
579 bool mu1_node =
false;
580 bool mu2_node =
false;
587 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
588 if(dataNode->type == XML_ELEMENT_NODE){
589 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
590 if(iter_data !=
nodeMap.end()){
591 switch (iter_data->second){
594 edge_threshold_node =
true;
616 if(!edge_threshold_node)
617 std::cout <<
"WARNING: In CONTRAST Node, EDGE_THRESHOLD Node not specified, default value used : " << this->
m_ecm.
getThreshold() << std::endl;
619 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<std::endl;
622 std::cout <<
"WARNING: In CONTRAST Node, mu1 Node not specified, default value used : " << this->
m_ecm.
getMu1() << std::endl;
624 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<std::endl;
627 std::cout <<
"WARNING: In CONTRAST Node, mu2 Node not specified, default value used : " << this->
m_ecm.
getMu2() << std::endl;
629 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<std::endl;