38 #include <visp3/core/vpConfig.h> 45 #include <libxml/xmlmemory.h> 47 #include <visp3/mbt/vpMbtKltXmlParser.h> 54 : maskBorder(0), maxFeatures(0), winSize(0), qualityValue(0.), minDist(0.), harrisParam(0.), blockSize(0),
102 bool camera_node =
false;
103 bool face_node =
false;
104 bool klt_node =
false;
105 bool lod_node =
false;
107 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
108 if (dataNode->type == XML_ELEMENT_NODE) {
109 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
110 if (iter_data !=
nodeMap.end()) {
111 switch (iter_data->second) {
138 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
139 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
140 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
141 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
145 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
146 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
150 std::cout <<
"klt : Mask Border : " <<
maskBorder <<
" (default)" << std::endl;
151 std::cout <<
"klt : Max Features : " <<
maxFeatures <<
" (default)" << std::endl;
152 std::cout <<
"klt : Windows Size : " <<
winSize <<
" (default)" << std::endl;
153 std::cout <<
"klt : Quality : " <<
qualityValue <<
" (default)" << std::endl;
154 std::cout <<
"klt : Min Distance : " <<
minDist <<
" (default)" << std::endl;
155 std::cout <<
"klt : Harris Parameter : " <<
harrisParam <<
" (default)" << std::endl;
156 std::cout <<
"klt : Block Size : " <<
blockSize <<
" (default)" << std::endl;
157 std::cout <<
"klt : Pyramid Levels : " <<
pyramidLevels <<
" (default)" << std::endl;
161 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
177 bool mask_border_node =
false;
178 bool max_features_node =
false;
179 bool window_size_node =
false;
180 bool quality_node =
false;
181 bool min_distance_node =
false;
182 bool harris_node =
false;
183 bool size_block_node =
false;
184 bool pyramid_lvl_node =
false;
186 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
187 if (dataNode->type == XML_ELEMENT_NODE) {
188 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
189 if (iter_data !=
nodeMap.end()) {
190 switch (iter_data->second) {
193 mask_border_node =
true;
197 max_features_node =
true;
201 window_size_node =
true;
209 min_distance_node =
true;
217 size_block_node =
true;
221 pyramid_lvl_node =
true;
232 if (!mask_border_node)
233 std::cout <<
"klt : Mask Border : " <<
maskBorder <<
" (default)" << std::endl;
235 std::cout <<
"klt : Mask Border : " <<
maskBorder << std::endl;
237 if (!max_features_node)
238 std::cout <<
"klt : Max Features : " <<
maxFeatures <<
" (default)" << std::endl;
240 std::cout <<
"klt : Max Features : " <<
maxFeatures << std::endl;
242 if (!window_size_node)
243 std::cout <<
"klt : Windows Size : " <<
winSize <<
" (default)" << std::endl;
245 std::cout <<
"klt : Windows Size : " <<
winSize << std::endl;
248 std::cout <<
"klt : Quality : " <<
qualityValue <<
" (default)" << std::endl;
250 std::cout <<
"klt : Quality : " <<
qualityValue << std::endl;
252 if (!min_distance_node)
253 std::cout <<
"klt : Min Distance : " <<
minDist <<
" (default)" << std::endl;
255 std::cout <<
"klt : Min Distance : " <<
minDist << std::endl;
258 std::cout <<
"klt : Harris Parameter : " <<
harrisParam <<
" (default)" << std::endl;
260 std::cout <<
"klt : Harris Parameter : " <<
harrisParam << std::endl;
262 if (!size_block_node)
263 std::cout <<
"klt : Block Size : " <<
blockSize <<
" (default)" << std::endl;
265 std::cout <<
"klt : Block Size : " <<
blockSize << std::endl;
267 if (!pyramid_lvl_node)
268 std::cout <<
"klt : Pyramid Levels : " <<
pyramidLevels <<
" (default)" << std::endl;
270 std::cout <<
"klt : Pyramid Levels : " <<
pyramidLevels << std::endl;
273 #elif !defined(VISP_BUILD_SHARED_LIBS) 276 void dummy_vpMbtKltXmlParser(){};
unsigned int winSize
Windows size.
vpCameraParameters cam
Camera parameters.
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.