41 #include <visp/vpConfig.h>
48 #include <libxml/xmlmemory.h>
50 #include <visp/vpMbtKltXmlParser.h>
58 : maskBorder(0), maxFeatures(0), winSize(0), qualityValue(0.), minDist(0.),
59 harrisParam(0.), blockSize(0), pyramidLevels(0)
99 std::string file = filename;
124 bool camera_node =
false;
125 bool face_node =
false;
126 bool klt_node =
false;
128 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
129 if(dataNode->type == XML_ELEMENT_NODE){
130 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
131 if(iter_data !=
nodeMap.end()){
132 switch (iter_data->second){
154 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<
" (default)" <<std::endl;
155 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<
" (default)" <<std::endl;
156 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<
" (default)" <<std::endl;
157 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<
" (default)" <<std::endl;
161 std::cout <<
"face : Angle Appear : "<<
angleAppear <<
" (default)" <<std::endl;
162 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<
" (default)" <<std::endl;
166 std::cout <<
"klt : Mask Border : "<<
maskBorder <<
" (default)" <<std::endl;
167 std::cout <<
"klt : Max Features : "<<
maxFeatures <<
" (default)" <<std::endl;
168 std::cout <<
"klt : Windows Size : "<<
winSize <<
" (default)" <<std::endl;
169 std::cout <<
"klt : Quality : "<<
qualityValue <<
" (default)" <<std::endl;
170 std::cout <<
"klt : Min Distance : "<<
minDist <<
" (default)" <<std::endl;
171 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<
" (default)" <<std::endl;
172 std::cout <<
"klt : Block Size : "<<
blockSize <<
" (default)" <<std::endl;
173 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<
" (default)" <<std::endl;
188 bool mask_border_node =
false;
189 bool max_features_node =
false;
190 bool window_size_node =
false;
191 bool quality_node =
false;
192 bool min_distance_node =
false;
193 bool harris_node =
false;
194 bool size_block_node =
false;
195 bool pyramid_lvl_node =
false;
197 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
198 if(dataNode->type == XML_ELEMENT_NODE){
199 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
200 if(iter_data !=
nodeMap.end()){
201 switch (iter_data->second){
204 mask_border_node =
true;
208 max_features_node =
true;
212 window_size_node =
true;
220 min_distance_node =
true;
228 size_block_node =
true;
232 pyramid_lvl_node =
true;
242 if(!mask_border_node)
243 std::cout <<
"klt : Mask Border : "<<
maskBorder <<
" (default)" <<std::endl;
245 std::cout <<
"klt : Mask Border : "<<
maskBorder <<std::endl;
247 if(!max_features_node)
248 std::cout <<
"klt : Max Features : "<<
maxFeatures <<
" (default)" <<std::endl;
250 std::cout <<
"klt : Max Features : "<<
maxFeatures <<std::endl;
252 if(!window_size_node)
253 std::cout <<
"klt : Windows Size : "<<
winSize <<
" (default)" <<std::endl;
255 std::cout <<
"klt : Windows Size : "<<
winSize <<std::endl;
258 std::cout <<
"klt : Quality : "<<
qualityValue <<
" (default)" <<std::endl;
260 std::cout <<
"klt : Quality : "<<
qualityValue <<std::endl;
262 if(!min_distance_node)
263 std::cout <<
"klt : Min Distance : "<<
minDist <<
" (default)" <<std::endl;
265 std::cout <<
"klt : Min Distance : "<<
minDist <<std::endl;
268 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<
" (default)" <<std::endl;
270 std::cout <<
"klt : Harris Parameter : "<<
harrisParam <<std::endl;
273 std::cout <<
"klt : Block Size : "<<
blockSize <<
" (default)" <<std::endl;
275 std::cout <<
"klt : Block Size : "<<
blockSize <<std::endl;
277 if(!pyramid_lvl_node)
278 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<
" (default)" <<std::endl;
280 std::cout <<
"klt : Pyramid Levels : "<<
pyramidLevels <<std::endl;
unsigned int winSize
Windows size.
vpCameraParameters cam
Camera parameters.
void parse(const char *filename)
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 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
void writeMainClass(xmlNodePtr node)
void parse(const std::string &filename)