41 #include <visp3/core/vpConfig.h> 48 #include <libxml/xmlmemory.h> 50 #include <visp3/mbt/vpMbtXmlParser.h> 103 bool camera_node =
false;
104 bool face_node =
false;
105 bool ecm_node =
false;
106 bool lod_node =
false;
108 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
109 if (dataNode->type == XML_ELEMENT_NODE) {
110 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
111 if (iter_data !=
nodeMap.end()) {
112 switch (iter_data->second) {
142 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
143 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
144 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
145 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
149 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
150 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
154 std::cout <<
"ecm : mask : size : " << this->
m_ecm.
getMaskSize() <<
" (default)" << std::endl;
155 std::cout <<
"ecm : mask : nb_mask : " << this->
m_ecm.
getMaskNumber() <<
" (default)" << std::endl;
156 std::cout <<
"ecm : range : tracking : " << this->
m_ecm.
getRange() <<
" (default)" << std::endl;
157 std::cout <<
"ecm : contrast : threshold : " << this->
m_ecm.
getThreshold() <<
" (default)" << std::endl;
158 std::cout <<
"ecm : contrast : mu1 : " << this->
m_ecm.
getMu1() <<
" (default)" << std::endl;
159 std::cout <<
"ecm : contrast : mu2 : " << this->
m_ecm.
getMu2() <<
" (default)" << std::endl;
160 std::cout <<
"ecm : sample : sample_step : " << this->
m_ecm.
getSampleStep() <<
" (default)" << std::endl;
164 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
180 bool mask_node =
false;
181 bool range_node =
false;
182 bool contrast_node =
false;
183 bool sample_node =
false;
185 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
186 if (dataNode->type == XML_ELEMENT_NODE) {
187 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
188 if (iter_data !=
nodeMap.end()) {
189 switch (iter_data->second) {
200 contrast_node =
true;
216 std::cout <<
"ecm : mask : size : " << this->
m_ecm.
getMaskSize() <<
" (default)" << std::endl;
217 std::cout <<
"ecm : mask : nb_mask : " << this->
m_ecm.
getMaskNumber() <<
" (default)" << std::endl;
221 std::cout <<
"ecm : range : tracking : " << this->
m_ecm.
getRange() <<
" (default)" << std::endl;
224 if (!contrast_node) {
225 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold() <<
" (default)" << std::endl;
226 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1() <<
" (default)" << std::endl;
227 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2() <<
" (default)" << std::endl;
231 std::cout <<
"ecm : sample : sample_step : " << this->
m_ecm.
getSampleStep() <<
" (default)" << std::endl;
245 bool step_node =
false;
250 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
251 if (dataNode->type == XML_ELEMENT_NODE) {
252 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
253 if (iter_data !=
nodeMap.end()) {
254 switch (iter_data->second) {
272 std::cout <<
"ecm : sample : sample_step : " << this->
m_ecm.
getSampleStep() <<
" (default)" << std::endl;
274 std::cout <<
"ecm : sample : sample_step : " << this->
m_ecm.
getSampleStep() << std::endl;
287 bool step_node =
false;
294 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
295 if (dataNode->type == XML_ELEMENT_NODE) {
296 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
297 if (iter_data !=
nodeMap.end()) {
298 switch (iter_data->second) {
320 std::cout <<
"[DEPRECATED] sample : sample_step : " << this->
m_ecm.
getSampleStep() <<
" (default)" << std::endl;
322 std::cout <<
"[DEPRECATED] sample : sample_step : " << this->
m_ecm.
getSampleStep() << std::endl;
331 std::cout <<
" WARNING : This node (sample) is deprecated." << std::endl;
332 std::cout <<
" It should be moved in the ecm node (ecm : sample)." << std::endl;
345 bool size_node =
false;
346 bool nb_mask_node =
false;
352 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
353 if (dataNode->type == XML_ELEMENT_NODE) {
354 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
355 if (iter_data !=
nodeMap.end()) {
356 switch (iter_data->second) {
378 "parameter should be different " 379 "from zero in xml file"));
383 std::cout <<
"ecm : mask : size : " << this->
m_ecm.
getMaskSize() <<
" (default)" << std::endl;
385 std::cout <<
"ecm : mask : size : " << this->
m_ecm.
getMaskSize() << std::endl;
388 std::cout <<
"ecm : mask : nb_mask : " << this->
m_ecm.
getMaskNumber() <<
" (default)" << std::endl;
403 bool tracking_node =
false;
408 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
409 if (dataNode->type == XML_ELEMENT_NODE) {
410 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
411 if (iter_data !=
nodeMap.end()) {
412 switch (iter_data->second) {
415 tracking_node =
true;
429 std::cout <<
"ecm : range : tracking : " << this->
m_ecm.
getRange() <<
" (default)" << std::endl;
431 std::cout <<
"ecm : range : tracking : " << this->
m_ecm.
getRange() << std::endl;
444 bool edge_threshold_node =
false;
445 bool mu1_node =
false;
446 bool mu2_node =
false;
453 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
454 if (dataNode->type == XML_ELEMENT_NODE) {
455 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
456 if (iter_data !=
nodeMap.end()) {
457 switch (iter_data->second) {
460 edge_threshold_node =
true;
483 if (!edge_threshold_node)
484 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold() <<
" (default)" << std::endl;
486 std::cout <<
"ecm : contrast : threshold " << this->
m_ecm.
getThreshold() << std::endl;
489 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1() <<
" (default)" << std::endl;
491 std::cout <<
"ecm : contrast : mu1 " << this->
m_ecm.
getMu1() << std::endl;
494 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2() <<
" (default)" << std::endl;
496 std::cout <<
"ecm : contrast : mu2 " << this->
m_ecm.
getMu2() << std::endl;
499 #elif !defined(VISP_BUILD_SHARED_LIBS) 502 void dummy_vpMbtXmlParser(){};
virtual ~vpMbtXmlParser()
void writeMainClass(xmlNodePtr node)
Used to indicate that a value is not in the allowed range.
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 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.