42 #include <visp3/mbt/vpMbtXmlGenericParser.h> 43 #include <visp3/core/vpIoTools.h> 47 #if defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV) 50 double eps = std::numeric_limits<double>::epsilon();
52 std::string filename = visp_images_dir +
"/xml/chateau.xml";
74 std::cerr <<
"Issue when parsing xml: " << filename <<
" (ME)" << std::endl;
78 if (xml.getKltMaskBorder() != 5 ||
79 xml.getKltMaxFeatures() != 10000 ||
80 xml.getKltWindowSize() != 5 ||
84 xml.getKltBlockSize() != 3 ||
85 xml.getKltPyramidLevels() != 3) {
86 std::cerr <<
"Issue when parsing xml: " << filename <<
" (KLT)" << std::endl;
93 xml.getCameraParameters(cam);
95 std::cerr <<
"Issue when parsing xml: " << filename <<
" (cam)" << std::endl;
103 !xml.getFovClipping()) {
104 std::cerr <<
"Issue when parsing xml: " << filename <<
" (visibility)" << std::endl;
110 std::string filename = visp_images_dir +
"/xml/chateau.xml";
114 xml.getProjectionErrorMe(me_proj);
116 xml.getProjectionErrorKernelSize() != 3) {
117 std::cerr <<
"Issue when parsing xml: " << filename <<
" (projection error)" << std::endl;
123 std::string filename = visp_images_dir +
"/xml/chateau_depth.xml";
127 if (xml.getDepthNormalFeatureEstimationMethod() != 0 ||
128 xml.getDepthNormalPclPlaneEstimationMethod() != 2 ||
129 xml.getDepthNormalPclPlaneEstimationRansacMaxIter() != 200 ||
130 !
vpMath::equal(xml.getDepthNormalPclPlaneEstimationRansacThreshold(), 0.001, eps) ||
131 xml.getDepthNormalSamplingStepX() != 2 ||
132 xml.getDepthNormalSamplingStepY() != 2) {
133 std::cerr <<
"Issue when parsing xml: " << filename <<
" (depth normal)" << std::endl;
137 if (xml.getDepthDenseSamplingStepX() != 4 ||
138 xml.getDepthDenseSamplingStepY() != 4) {
139 std::cerr <<
"Issue when parsing xml: " << filename <<
" (depth dense)" << std::endl;
146 xml.getCameraParameters(cam);
147 if (cam != cam_ref) {
148 std::cerr <<
"Issue when parsing xml: " << filename <<
" (cam)" << std::endl;
156 !xml.getFovClipping()) {
157 std::cerr <<
"Issue when parsing xml: " << filename <<
" (visibility)" << std::endl;
162 #elif !(defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV)) 163 std::cout <<
"Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
unsigned int getRange() const
unsigned int getMaskSize() const
unsigned int getMaskNumber() const
void setMaskNumber(const unsigned int &a)
static bool equal(double x, double y, double s=0.001)
void setSampleStep(const double &s)
void setMu1(const double &mu_1)
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
double getThreshold() const
void setMaskSize(const unsigned int &a)
Generic class defining intrinsic camera parameters.
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
void setMu2(const double &mu_2)
void setThreshold(const double &t)
void setRange(const unsigned int &r)
double getSampleStep() const