44 #include <visp/vpConfig.h>
52 #include <libxml/xmlmemory.h>
54 #include <visp/vpMbtXmlParser.h>
105 std::string file = filename;
130 bool camera_node =
false;
131 bool face_node =
false;
132 bool ecm_node =
false;
133 bool sample_node =
false;
135 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
136 if(dataNode->type == XML_ELEMENT_NODE){
137 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
138 if(iter_data !=
nodeMap.end()){
139 switch (iter_data->second){
165 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<
" (default)" <<std::endl;
166 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<
" (default)" <<std::endl;
167 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<
" (default)" <<std::endl;
168 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<
" (default)" <<std::endl;
172 std::cout <<
"face : Angle Appear : "<<
angleAppear <<
" (default)" <<std::endl;
173 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<
" (default)" <<std::endl;
177 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<
" (default)" <<std::endl;
178 std::cout <<
"ecm : mask : nb_mask : "<< this->
m_ecm.
getMaskNumber() <<
" (default)" <<std::endl;
179 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<
" (default)" <<std::endl;
180 std::cout <<
"ecm : contrast : threshold : " << this->
m_ecm.
getThreshold()<<
" (default)" <<std::endl;
181 std::cout <<
"ecm : contrast : mu1 : " << this->
m_ecm.
getMu1()<<
" (default)" <<std::endl;
182 std::cout <<
"ecm : contrast : mu2 : " << this->
m_ecm.
getMu2()<<
" (default)" <<std::endl;
186 std::cout <<
"sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<
" (default)" << std::endl;
203 bool mask_node =
false;
204 bool range_node =
false;
205 bool contrast_node =
false;
207 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
208 if(dataNode->type == XML_ELEMENT_NODE){
209 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
210 if(iter_data !=
nodeMap.end()){
211 switch (iter_data->second){
222 contrast_node =
true;
233 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<
" (default)" <<std::endl;
234 std::cout <<
"ecm : mask : nb_mask : "<< this->
m_ecm.
getMaskNumber() <<
" (default)" <<std::endl;
238 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<
" (default)" <<std::endl;
242 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<
" (default)" <<std::endl;
243 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<
" (default)" <<std::endl;
244 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<
" (default)" <<std::endl;
259 bool step_node =
false;
260 bool nb_sample_node =
false;
266 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
267 if(dataNode->type == XML_ELEMENT_NODE){
268 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
269 if(iter_data !=
nodeMap.end()){
270 switch (iter_data->second){
277 nb_sample_node =
true;
291 std::cout <<
"sample : sample_step : "<< this->
m_ecm.
getSampleStep()<<
" (default)" << std::endl;
312 bool size_node =
false;
313 bool nb_mask_node =
false;
319 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
320 if(dataNode->type == XML_ELEMENT_NODE){
321 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
322 if(iter_data !=
nodeMap.end()){
323 switch (iter_data->second){
344 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<
" (default)" <<std::endl;
346 std::cout <<
"ecm : mask : size : "<< this->
m_ecm.
getMaskSize() <<std::endl;
349 std::cout <<
"ecm : mask : nb_mask : "<< this->
m_ecm.
getMaskNumber() <<
" (default)" <<std::endl;
365 bool tracking_node =
false;
370 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
371 if(dataNode->type == XML_ELEMENT_NODE){
372 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
373 if(iter_data !=
nodeMap.end()){
374 switch (iter_data->second){
377 tracking_node =
true;
390 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<
" (default)" <<std::endl;
392 std::cout <<
"ecm : range : tracking : "<< this->
m_ecm.
getRange()<<std::endl;
407 bool edge_threshold_node =
false;
408 bool mu1_node =
false;
409 bool mu2_node =
false;
416 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
417 if(dataNode->type == XML_ELEMENT_NODE){
418 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
419 if(iter_data !=
nodeMap.end()){
420 switch (iter_data->second){
423 edge_threshold_node =
true;
445 if(!edge_threshold_node)
446 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<
" (default)" <<std::endl;
448 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold()<<std::endl;
451 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<
" (default)" <<std::endl;
453 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1()<<std::endl;
456 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<
" (default)" <<std::endl;
458 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2()<<std::endl;
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_range(xmlDocPtr doc, xmlNodePtr node)
void setMaskNumber(const unsigned int &a)
void setSampleStep(const double &s)
void setNbTotalSample(const int &nb)
double angleAppear
Angle to determine if a face appeared.
error that can be emited by ViSP classes.
double xmlReadDoubleChild(xmlDocPtr doc, xmlNodePtr node)
double angleDisappear
Angle to determine if a face disappeared.
void setMu1(const double &mu_1)
int getNbTotalSample() const
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
void parse(const std::string &filename)