40 #include <visp3/core/vpConfig.h>
48 #include <libxml/xmlmemory.h>
50 #include <visp3/mbt/vpMbtXmlParser.h>
100 std::string file = filename;
125 bool camera_node =
false;
126 bool face_node =
false;
127 bool ecm_node =
false;
128 bool lod_node =
false;
130 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
131 if(dataNode->type == XML_ELEMENT_NODE){
132 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
133 if(iter_data !=
nodeMap.end()){
134 switch (iter_data->second){
163 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<
" (default)" <<std::endl;
164 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<
" (default)" <<std::endl;
165 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<
" (default)" <<std::endl;
166 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<
" (default)" <<std::endl;
170 std::cout <<
"face : Angle Appear : "<<
angleAppear <<
" (default)" <<std::endl;
171 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<
" (default)" <<std::endl;
175 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<
" (default)" <<std::endl;
176 std::cout <<
"ecm : mask : nb_mask : "<< this->
m_ecm.
getMaskNumber() <<
" (default)" <<std::endl;
177 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<
" (default)" <<std::endl;
178 std::cout <<
"ecm : contrast : threshold : " << this->
m_ecm.
getThreshold()<<
" (default)" <<std::endl;
179 std::cout <<
"ecm : contrast : mu1 : " << this->
m_ecm.
getMu1()<<
" (default)" <<std::endl;
180 std::cout <<
"ecm : contrast : mu2 : " << this->
m_ecm.
getMu2()<<
" (default)" <<std::endl;
181 std::cout <<
"ecm : sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<
" (default)" << std::endl;
185 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
203 bool mask_node =
false;
204 bool range_node =
false;
205 bool contrast_node =
false;
206 bool sample_node =
false;
208 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
209 if(dataNode->type == XML_ELEMENT_NODE){
210 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
211 if(iter_data !=
nodeMap.end()){
212 switch (iter_data->second){
223 contrast_node =
true;
238 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<
" (default)" <<std::endl;
239 std::cout <<
"ecm : mask : nb_mask : "<< this->
m_ecm.
getMaskNumber() <<
" (default)" <<std::endl;
243 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<
" (default)" <<std::endl;
247 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<
" (default)" <<std::endl;
248 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<
" (default)" <<std::endl;
249 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<
" (default)" <<std::endl;
253 std::cout <<
"ecm : sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<
" (default)" << std::endl;
268 bool step_node =
false;
273 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
274 if(dataNode->type == XML_ELEMENT_NODE){
275 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
276 if(iter_data !=
nodeMap.end()){
277 switch (iter_data->second){
294 std::cout <<
"ecm : sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<
" (default)" << std::endl;
310 bool step_node =
false;
317 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
318 if(dataNode->type == XML_ELEMENT_NODE){
319 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
320 if(iter_data !=
nodeMap.end()){
321 switch (iter_data->second){
342 std::cout <<
"[DEPRECATED] sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<
" (default)" << std::endl;
344 std::cout <<
"[DEPRECATED] sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<std::endl;
351 std::cout <<
" WARNING : This node (sample) is deprecated." << std::endl;
352 std::cout <<
" It should be moved in the ecm node (ecm : sample)." << std::endl;
366 bool size_node =
false;
367 bool nb_mask_node =
false;
373 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
374 if(dataNode->type == XML_ELEMENT_NODE){
375 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
376 if(iter_data !=
nodeMap.end()){
377 switch (iter_data->second){
401 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<
" (default)" <<std::endl;
403 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<std::endl;
406 std::cout <<
"ecm : mask : nb_mask : "<< this->
m_ecm.
getMaskNumber() <<
" (default)" <<std::endl;
422 bool tracking_node =
false;
427 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
428 if(dataNode->type == XML_ELEMENT_NODE){
429 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
430 if(iter_data !=
nodeMap.end()){
431 switch (iter_data->second){
434 tracking_node =
true;
447 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<
" (default)" <<std::endl;
449 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<std::endl;
464 bool edge_threshold_node =
false;
465 bool mu1_node =
false;
466 bool mu2_node =
false;
473 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
474 if(dataNode->type == XML_ELEMENT_NODE){
475 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
476 if(iter_data !=
nodeMap.end()){
477 switch (iter_data->second){
480 edge_threshold_node =
true;
502 if(!edge_threshold_node)
503 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<
" (default)" <<std::endl;
505 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<std::endl;
508 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<
" (default)" <<std::endl;
510 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<std::endl;
513 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<
" (default)" <<std::endl;
515 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<std::endl;
518 #elif !defined(VISP_BUILD_SHARED_LIBS)
520 void dummy_vpMbtXmlParser() {};
virtual ~vpMbtXmlParser()
void writeMainClass(xmlNodePtr node)
unsigned int getRange() const
unsigned int getMaskSize() const
void read_contrast(xmlDocPtr doc, xmlNodePtr node)
vpCameraParameters cam
Camera parameters.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)
unsigned int getMaskNumber() const
void read_lod(xmlDocPtr doc, xmlNodePtr node)
void read_range(xmlDocPtr doc, xmlNodePtr node)
void setMaskNumber(const unsigned int &a)
void setSampleStep(const double &s)
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 angleDisappear
Angle to determine if a face disappeared.
void setMu1(const double &mu_1)
void read_sample_deprecated(xmlDocPtr doc, xmlNodePtr node)
double getThreshold() const
void read_camera(xmlDocPtr doc, xmlNodePtr node)
vpMe m_ecm
Moving edges parameters.
void setMaskSize(const unsigned int &a)
int xmlReadIntChild(xmlDocPtr doc, xmlNodePtr node)
void read_face(xmlDocPtr doc, xmlNodePtr node)
void parse(const char *filename)
void read_sample(xmlDocPtr doc, xmlNodePtr node)
unsigned int xmlReadUnsignedIntChild(xmlDocPtr doc, xmlNodePtr node)
void setMu2(const double &mu_2)
void read_mask(xmlDocPtr doc, xmlNodePtr node)
void setThreshold(const double &t)
void read_ecm(xmlDocPtr doc, xmlNodePtr node)
void setRange(const unsigned int &r)
double getSampleStep() const
std::map< std::string, int > nodeMap
double minPolygonAreaThreshold
Minimum polygon area to track a face when LOD is enabled.
bool useLod
If true, the LOD is enabled, otherwise it is not.
void parse(const std::string &filename)