37 #include <visp3/core/vpConfig.h>
44 #include <libxml/xmlmemory.h>
46 #include <visp3/mbt/vpMbtKltXmlParser.h>
54 : maskBorder(0), maxFeatures(0), winSize(0), qualityValue(0.), minDist(0.),
55 harrisParam(0.), blockSize(0), pyramidLevels(0)
95 std::string file = filename;
120 bool camera_node =
false;
121 bool face_node =
false;
122 bool klt_node =
false;
123 bool lod_node =
false;
125 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
126 if(dataNode->type == XML_ELEMENT_NODE){
127 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
128 if(iter_data !=
nodeMap.end()){
129 switch (iter_data->second){
155 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<
" (default)" <<std::endl;
156 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<
" (default)" <<std::endl;
157 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<
" (default)" <<std::endl;
158 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<
" (default)" <<std::endl;
162 std::cout <<
"face : Angle Appear : "<<
angleAppear <<
" (default)" <<std::endl;
163 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<
" (default)" <<std::endl;
167 std::cout <<
"klt : Mask Border : "<<
maskBorder <<
" (default)" <<std::endl;
168 std::cout <<
"klt : Max Features : "<<
maxFeatures <<
" (default)" <<std::endl;
169 std::cout <<
"klt : Windows Size : "<<
winSize <<
" (default)" <<std::endl;
170 std::cout <<
"klt : Quality : "<<
qualityValue <<
" (default)" <<std::endl;
171 std::cout <<
"klt : Min Distance : "<<
minDist <<
" (default)" <<std::endl;
172 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<
" (default)" <<std::endl;
173 std::cout <<
"klt : Block Size : "<<
blockSize <<
" (default)" <<std::endl;
174 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<
" (default)" <<std::endl;
178 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
195 bool mask_border_node =
false;
196 bool max_features_node =
false;
197 bool window_size_node =
false;
198 bool quality_node =
false;
199 bool min_distance_node =
false;
200 bool harris_node =
false;
201 bool size_block_node =
false;
202 bool pyramid_lvl_node =
false;
204 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
205 if(dataNode->type == XML_ELEMENT_NODE){
206 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
207 if(iter_data !=
nodeMap.end()){
208 switch (iter_data->second){
211 mask_border_node =
true;
215 max_features_node =
true;
219 window_size_node =
true;
227 min_distance_node =
true;
235 size_block_node =
true;
239 pyramid_lvl_node =
true;
249 if(!mask_border_node)
250 std::cout <<
"klt : Mask Border : "<<
maskBorder <<
" (default)" <<std::endl;
252 std::cout <<
"klt : Mask Border : "<<
maskBorder <<std::endl;
254 if(!max_features_node)
255 std::cout <<
"klt : Max Features : "<<
maxFeatures <<
" (default)" <<std::endl;
257 std::cout <<
"klt : Max Features : "<<
maxFeatures <<std::endl;
259 if(!window_size_node)
260 std::cout <<
"klt : Windows Size : "<<
winSize <<
" (default)" <<std::endl;
262 std::cout <<
"klt : Windows Size : "<<
winSize <<std::endl;
265 std::cout <<
"klt : Quality : "<<
qualityValue <<
" (default)" <<std::endl;
267 std::cout <<
"klt : Quality : "<<
qualityValue <<std::endl;
269 if(!min_distance_node)
270 std::cout <<
"klt : Min Distance : "<<
minDist <<
" (default)" <<std::endl;
272 std::cout <<
"klt : Min Distance : "<<
minDist <<std::endl;
275 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<
" (default)" <<std::endl;
277 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<std::endl;
280 std::cout <<
"klt : Block Size : "<<
blockSize <<
" (default)" <<std::endl;
282 std::cout <<
"klt : Block Size : "<<
blockSize <<std::endl;
284 if(!pyramid_lvl_node)
285 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<
" (default)" <<std::endl;
287 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<std::endl;
290 #elif !defined(VISP_BUILD_SHARED_LIBS)
292 void dummy_vpMbtKltXmlParser() {};
unsigned int winSize
Windows size.
vpCameraParameters cam
Camera parameters.
void parse(const char *filename)
void read_lod(xmlDocPtr doc, xmlNodePtr node)
double minDist
Minimum distance between klt points.
unsigned int maskBorder
Border of the mask used on Klt points.
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 harrisParam
Harris free parameters.
double angleDisappear
Angle to determine if a face disappeared.
unsigned int maxFeatures
Maximum of Klt features.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)
void read_camera(xmlDocPtr doc, xmlNodePtr node)
unsigned int pyramidLevels
Number of pyramid levels.
void read_face(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
double minPolygonAreaThreshold
Minimum polygon area to track a face when LOD is enabled.
void writeMainClass(xmlNodePtr node)
bool useLod
If true, the LOD is enabled, otherwise it is not.
void parse(const std::string &filename)