diff --git a/modules/core/include/visp3/core/vpMatrix.h b/modules/core/include/visp3/core/vpMatrix.h index 9e70dd87d0..e46930374c 100644 --- a/modules/core/include/visp3/core/vpMatrix.h +++ b/modules/core/include/visp3/core/vpMatrix.h @@ -41,6 +41,7 @@ #ifndef _vpMatrix_H_ #define _vpMatrix_H_ +#include #if defined(ENABLE_VISP_NAMESPACE) namespace VISP_NAMESPACE_NAME { @@ -57,7 +58,6 @@ class vpForceTwistMatrix; #endif #include -#include #include #include #include diff --git a/modules/core/test/image-with-dataset/testGaussianFilter.cpp b/modules/core/test/image-with-dataset/testGaussianFilter.cpp index 0b014ac38b..8051517ad0 100644 --- a/modules/core/test/image-with-dataset/testGaussianFilter.cpp +++ b/modules/core/test/image-with-dataset/testGaussianFilter.cpp @@ -33,18 +33,14 @@ * *****************************************************************************/ -#include - -#ifdef ENABLE_VISP_NAMESPACE -using namespace VISP_NAMESPACE_NAME; -#endif - /*! \example testGaussianFilter.cpp \brief Test Gaussian filter. */ +#include + #if defined(VISP_HAVE_SIMDLIB) && defined(VISP_HAVE_CATCH2) && (VISP_HAVE_DATASET_VERSION >= 0x030400) #define CATCH_CONFIG_RUNNER #include @@ -53,6 +49,10 @@ using namespace VISP_NAMESPACE_NAME; #include #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + TEST_CASE("Test vpGaussianFilter (unsigned char)") { const std::string filepath = vpIoTools::createFilePath(vpIoTools::getViSPImagesDataPath(), "Klimt/Klimt.pgm"); diff --git a/modules/core/test/math/testEigenConversion.cpp b/modules/core/test/math/testEigenConversion.cpp index 3400c627a1..88a9204165 100644 --- a/modules/core/test/math/testEigenConversion.cpp +++ b/modules/core/test/math/testEigenConversion.cpp @@ -74,11 +74,11 @@ TEST_CASE("vpMatrix <--> Eigen::MatrixXd/Matrix3Xd conversion", "[eigen_conversi { Eigen::MatrixXd eigen_m; - vp::visp2eigen(visp_m, eigen_m); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_m, eigen_m); std::cout << "Eigen MatrixXd:\n" << eigen_m << std::endl; vpMatrix visp_m2; - vp::eigen2visp(eigen_m, visp_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m, visp_m2); std::cout << "ViSP vpMatrix:\n" << visp_m2 << std::endl; REQUIRE(visp_m == visp_m2); @@ -86,11 +86,11 @@ TEST_CASE("vpMatrix <--> Eigen::MatrixXd/Matrix3Xd conversion", "[eigen_conversi } { Eigen::Matrix3Xd eigen_m; - vp::visp2eigen(visp_m, eigen_m); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_m, eigen_m); std::cout << "Eigen Matrix3Xd:\n" << eigen_m << std::endl; vpMatrix visp_m2; - vp::eigen2visp(eigen_m, visp_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m, visp_m2); std::cout << "ViSP vpMatrix:\n" << visp_m2 << std::endl; REQUIRE(visp_m == visp_m2); @@ -114,18 +114,18 @@ TEST_CASE("Eigen::MatrixXd <--> vpMatrix conversion", "[eigen_conversion]") std::cout << "Eigen Matrix (row major: " << eigen_m.IsRowMajor << "):\n" << eigen_m << std::endl; vpMatrix visp_m; - vp::eigen2visp(eigen_m, visp_m); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m, visp_m); std::cout << "ViSP vpMatrix:\n" << visp_m << std::endl; Eigen::MatrixXd eigen_m2; - vp::visp2eigen(visp_m, eigen_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_m, eigen_m2); std::cout << "Eigen MatrixXd (row major: " << eigen_m2.IsRowMajor << "):\n" << eigen_m2 << std::endl; vpMatrix visp_m2; - vp::eigen2visp(eigen_m2, visp_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m2, visp_m2); REQUIRE(visp_m == visp_m2); std::cout << std::endl; - } +} TEST_CASE("Eigen::MatrixX4d <--> vpMatrix conversion", "[eigen_conversion]") { @@ -143,18 +143,18 @@ TEST_CASE("Eigen::MatrixX4d <--> vpMatrix conversion", "[eigen_conversion]") std::cout << "Eigen MatrixX4d (row major: " << eigen_m.IsRowMajor << "):\n" << eigen_m << std::endl; vpMatrix visp_m; - vp::eigen2visp(eigen_m, visp_m); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m, visp_m); std::cout << "ViSP vpMatrix:\n" << visp_m << std::endl; Eigen::MatrixX4d eigen_m2; - vp::visp2eigen(visp_m, eigen_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_m, eigen_m2); std::cout << "Eigen MatrixX4d (row major: " << eigen_m2.IsRowMajor << "):\n" << eigen_m2 << std::endl; vpMatrix visp_m2; - vp::eigen2visp(eigen_m2, visp_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m2, visp_m2); REQUIRE(visp_m == visp_m2); std::cout << std::endl; - } +} TEST_CASE("Eigen::Matrix <--> vpMatrix conversion", "[eigen_conversion]") { @@ -172,18 +172,18 @@ TEST_CASE("Eigen::Matrix <--> vpMatrix conve std::cout << "Eigen Matrix (RowMajor):\n" << eigen_m << std::endl; vpMatrix visp_m; - vp::eigen2visp(eigen_m, visp_m); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m, visp_m); std::cout << "ViSP vpMatrix:\n" << visp_m << std::endl; Eigen::MatrixXd eigen_m2; - vp::visp2eigen(visp_m, eigen_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_m, eigen_m2); std::cout << "Eigen MatrixXd (row major: " << eigen_m2.IsRowMajor << "):\n" << eigen_m2 << std::endl; vpMatrix visp_m2; - vp::eigen2visp(eigen_m2, visp_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m2, visp_m2); REQUIRE(visp_m == visp_m2); std::cout << std::endl; - } +} TEST_CASE("Eigen::Matrix <--> vpMatrix conversion", "[eigen_conversion]") { @@ -201,28 +201,28 @@ TEST_CASE("Eigen::Matrix <--> vpMatrix conve std::cout << "Eigen Matrix (ColMajor):\n" << eigen_m << std::endl; vpMatrix visp_m; - vp::eigen2visp(eigen_m, visp_m); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m, visp_m); std::cout << "ViSP vpMatrix:\n" << visp_m << std::endl; Eigen::MatrixXd eigen_m2; - vp::visp2eigen(visp_m, eigen_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_m, eigen_m2); std::cout << "Eigen MatrixXd (row major: " << eigen_m2.IsRowMajor << "):\n" << eigen_m2 << std::endl; vpMatrix visp_m2; - vp::eigen2visp(eigen_m2, visp_m2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_m2, visp_m2); REQUIRE(visp_m == visp_m2); std::cout << std::endl; - } +} TEST_CASE("vpHomogeneousMatrix <--> Eigen::Matrix4d conversion", "[eigen_conversion]") { vpHomogeneousMatrix visp_cMo(0.1, 0.2, 0.3, 0.1, 0.2, 0.3); Eigen::Matrix4d eigen_cMo; - vp::visp2eigen(visp_cMo, eigen_cMo); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_cMo, eigen_cMo); std::cout << "Eigen Matrix4d cMo:\n" << eigen_cMo << std::endl; vpHomogeneousMatrix visp_cMo2; - vp::eigen2visp(eigen_cMo, visp_cMo2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_cMo, visp_cMo2); std::cout << "ViSP vpHomogeneousMatrix cMo:\n" << visp_cMo2 << std::endl; REQUIRE(visp_cMo == visp_cMo2); std::cout << std::endl; @@ -232,12 +232,12 @@ TEST_CASE("vpHomogeneousMatrix <--> Eigen::Matrix4f + double casting conversion" { vpHomogeneousMatrix visp_cMo; // identity for float to double casting Eigen::Matrix4d eigen_cMo_tmp; - vp::visp2eigen(visp_cMo, eigen_cMo_tmp); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_cMo, eigen_cMo_tmp); Eigen::Matrix4f eigen_cMo = eigen_cMo_tmp.cast(); std::cout << "Eigen Matrix4f cMo:\n" << eigen_cMo << std::endl; vpHomogeneousMatrix visp_cMo2; - vp::eigen2visp(eigen_cMo.cast(), visp_cMo2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_cMo.cast(), visp_cMo2); std::cout << "ViSP vpHomogeneousMatrix cMo:\n" << visp_cMo2 << std::endl; REQUIRE(visp_cMo == visp_cMo2); std::cout << std::endl; @@ -247,11 +247,11 @@ TEST_CASE("vpQuaternionVector <--> Eigen::Quaternionf conversion", "[eigen_conve { vpQuaternionVector visp_quaternion(0, 1, 2, 3); Eigen::Quaternionf eigen_quaternion; - vp::visp2eigen(visp_quaternion, eigen_quaternion); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_quaternion, eigen_quaternion); std::cout << "Eigen quaternion: " << eigen_quaternion << std::endl; vpQuaternionVector visp_quaternion2; - vp::eigen2visp(eigen_quaternion, visp_quaternion2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_quaternion, visp_quaternion2); std::cout << "ViSP quaternion: " << visp_quaternion2.t() << std::endl; REQUIRE(visp_quaternion == visp_quaternion2); std::cout << std::endl; @@ -261,11 +261,11 @@ TEST_CASE("vpThetaUVector <--> Eigen::AngleAxisf conversion", "[eigen_conversion { vpThetaUVector visp_thetau(0, 1, 2); Eigen::AngleAxisf eigen_angle_axis; - vp::visp2eigen(visp_thetau, eigen_angle_axis); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_thetau, eigen_angle_axis); std::cout << "Eigen AngleAxis: " << eigen_angle_axis << std::endl; vpThetaUVector visp_thetau2; - vp::eigen2visp(eigen_angle_axis, visp_thetau2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_angle_axis, visp_thetau2); std::cout << "ViSP AngleAxis: " << visp_thetau2.t() << std::endl; REQUIRE(visp_thetau == visp_thetau2); std::cout << std::endl; @@ -276,11 +276,11 @@ TEST_CASE("vpColVector <--> Eigen::VectorXd conversion", "[eigen_conversion]") vpColVector visp_col(4, 4); visp_col = 10; Eigen::VectorXd eigen_col; - vp::visp2eigen(visp_col, eigen_col); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_col, eigen_col); std::cout << "Eigen VectorXd: " << eigen_col.transpose() << std::endl; vpColVector visp_col2; - vp::eigen2visp(eigen_col, visp_col2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_col, visp_col2); std::cout << "ViSP vpColVector: " << visp_col2.t() << std::endl; REQUIRE(visp_col == visp_col2); std::cout << std::endl; @@ -291,11 +291,11 @@ TEST_CASE("vpRowVector <--> Eigen::RowVectorXd conversion", "[eigen_conversion]" vpRowVector visp_row(4, 10); visp_row = 10; Eigen::RowVectorXd eigen_row; - vp::visp2eigen(visp_row, eigen_row); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_row, eigen_row); std::cout << "Eigen RowVectorXd: " << eigen_row << std::endl; vpRowVector visp_row2; - vp::eigen2visp(eigen_row, visp_row2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_row, visp_row2); std::cout << "ViSP vpRowVector: " << visp_row2 << std::endl; REQUIRE(visp_row == visp_row2); std::cout << std::endl; @@ -306,15 +306,15 @@ TEST_CASE("Eigen::RowVector4d <--> vpRowVector conversion", "[eigen_conversion]" Eigen::RowVector4d eigen_row; eigen_row << 9, 8, 7, 6; vpRowVector visp_row; - vp::eigen2visp(eigen_row, visp_row); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_row, visp_row); std::cout << "ViSP vpRowVector: " << visp_row << std::endl; Eigen::RowVector4d eigen_row2; - vp::visp2eigen(visp_row, eigen_row2); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_row, eigen_row2); std::cout << "Eigen RowVector4d: " << eigen_row2 << std::endl; vpRowVector visp_row2; - vp::eigen2visp(eigen_row2, visp_row2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_row2, visp_row2); REQUIRE(visp_row == visp_row2); std::cout << std::endl; } @@ -324,11 +324,11 @@ TEST_CASE("vpRowVector <--> Eigen::RowVector4d conversion", "[eigen_conversion]" vpRowVector visp_row(4, 10); visp_row = 10; Eigen::RowVector4d eigen_row; - vp::visp2eigen(visp_row, eigen_row); + VISP_EIGEN_CONVERSION_NAMESPACE::visp2eigen(visp_row, eigen_row); std::cout << "Eigen RowVector4d: " << eigen_row << std::endl; vpRowVector visp_row2; - vp::eigen2visp(eigen_row, visp_row2); + VISP_EIGEN_CONVERSION_NAMESPACE::eigen2visp(eigen_row, visp_row2); std::cout << "ViSP vpRowVector: " << visp_row2 << std::endl; REQUIRE(visp_row == visp_row2); std::cout << std::endl; diff --git a/modules/imgproc/include/visp3/imgproc/vpContours.h b/modules/imgproc/include/visp3/imgproc/vpContours.h index 7252feb2fd..adb76b0f94 100644 --- a/modules/imgproc/include/visp3/imgproc/vpContours.h +++ b/modules/imgproc/include/visp3/imgproc/vpContours.h @@ -74,11 +74,13 @@ #include #include -#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) -namespace vp +#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS +#define VISP_CONTOURS_NAMESPACE vp #else -namespace VISP_NAMESPACE_NAME +#define VISP_CONTOURS_NAMESPACE VISP_NAMESPACE_NAME #endif + +namespace VISP_CONTOURS_NAMESPACE { /*! diff --git a/modules/imgproc/test/with-dataset/testAutoThreshold.cpp b/modules/imgproc/test/with-dataset/testAutoThreshold.cpp index 79e9ae70f9..c4b0cad733 100644 --- a/modules/imgproc/test/with-dataset/testAutoThreshold.cpp +++ b/modules/imgproc/test/with-dataset/testAutoThreshold.cpp @@ -252,7 +252,7 @@ int main(int argc, const char **argv) // Huang double t = vpTime::measureTimeMs(); - double threshold = vp::autoThreshold(I_thresh, vp::AUTO_THRESHOLD_HUANG); + double threshold = VISP_IMGPROC_NAMESPACE::autoThreshold(I_thresh, VISP_IMGPROC_NAMESPACE::AUTO_THRESHOLD_HUANG); t = vpTime::measureTimeMs() - t; std::cout << "\nAutomatic thresholding (Huang): " << threshold << " ; t=" << t << " ms" << std::endl; @@ -263,7 +263,7 @@ int main(int argc, const char **argv) // Intermodes I_thresh = I; t = vpTime::measureTimeMs(); - threshold = vp::autoThreshold(I_thresh, vp::AUTO_THRESHOLD_INTERMODES); + threshold = VISP_IMGPROC_NAMESPACE::autoThreshold(I_thresh, VISP_IMGPROC_NAMESPACE::AUTO_THRESHOLD_INTERMODES); t = vpTime::measureTimeMs() - t; std::cout << "\nAutomatic thresholding (Intermodes): " << threshold << " ; t=" << t << " ms" << std::endl; @@ -274,7 +274,7 @@ int main(int argc, const char **argv) // IsoData I_thresh = I; t = vpTime::measureTimeMs(); - threshold = vp::autoThreshold(I_thresh, vp::AUTO_THRESHOLD_ISODATA); + threshold = VISP_IMGPROC_NAMESPACE::autoThreshold(I_thresh, VISP_IMGPROC_NAMESPACE::AUTO_THRESHOLD_ISODATA); t = vpTime::measureTimeMs() - t; std::cout << "\nAutomatic thresholding (IsoData): " << threshold << " ; t=" << t << " ms" << std::endl; @@ -285,7 +285,7 @@ int main(int argc, const char **argv) // Mean I_thresh = I; t = vpTime::measureTimeMs(); - threshold = vp::autoThreshold(I_thresh, vp::AUTO_THRESHOLD_MEAN); + threshold = VISP_IMGPROC_NAMESPACE::autoThreshold(I_thresh, VISP_IMGPROC_NAMESPACE::AUTO_THRESHOLD_MEAN); t = vpTime::measureTimeMs() - t; std::cout << "\nAutomatic thresholding (Mean): " << threshold << " ; t=" << t << " ms" << std::endl; @@ -296,7 +296,7 @@ int main(int argc, const char **argv) // Otsu I_thresh = I; t = vpTime::measureTimeMs(); - threshold = vp::autoThreshold(I_thresh, vp::AUTO_THRESHOLD_OTSU); + threshold = VISP_IMGPROC_NAMESPACE::autoThreshold(I_thresh, VISP_IMGPROC_NAMESPACE::AUTO_THRESHOLD_OTSU); t = vpTime::measureTimeMs() - t; std::cout << "\nAutomatic thresholding (Otsu): " << threshold << " ; t=" << t << " ms" << std::endl; @@ -307,7 +307,7 @@ int main(int argc, const char **argv) // Triangle I_thresh = I; t = vpTime::measureTimeMs(); - threshold = vp::autoThreshold(I_thresh, vp::AUTO_THRESHOLD_TRIANGLE); + threshold = VISP_IMGPROC_NAMESPACE::autoThreshold(I_thresh, VISP_IMGPROC_NAMESPACE::AUTO_THRESHOLD_TRIANGLE); t = vpTime::measureTimeMs() - t; std::cout << "\nAutomatic thresholding (Triangle): " << threshold << " ; t=" << t << " ms" << std::endl; diff --git a/modules/imgproc/test/with-dataset/testConnectedComponents.cpp b/modules/imgproc/test/with-dataset/testConnectedComponents.cpp index 8b8b8fe2dd..6c06ac98ea 100644 --- a/modules/imgproc/test/with-dataset/testConnectedComponents.cpp +++ b/modules/imgproc/test/with-dataset/testConnectedComponents.cpp @@ -295,7 +295,7 @@ int main(int argc, const char **argv) vpImage labels_connex4; int nbComponents = 0; double t = vpTime::measureTimeMs(); - vp::connectedComponents(I, labels_connex4, nbComponents, vpImageMorphology::CONNEXITY_4); + VISP_IMGPROC_NAMESPACE::connectedComponents(I, labels_connex4, nbComponents, vpImageMorphology::CONNEXITY_4); t = vpTime::measureTimeMs() - t; std::cout << "\n4-connexity connected components:" << std::endl; std::cout << "Time: " << t << " ms" << std::endl; @@ -303,7 +303,7 @@ int main(int argc, const char **argv) vpImage labels_connex8; t = vpTime::measureTimeMs(); - vp::connectedComponents(I, labels_connex8, nbComponents, vpImageMorphology::CONNEXITY_8); + VISP_IMGPROC_NAMESPACE::connectedComponents(I, labels_connex8, nbComponents, vpImageMorphology::CONNEXITY_8); t = vpTime::measureTimeMs() - t; std::cout << "\n8-connexity connected components:" << std::endl; std::cout << "Time: " << t << " ms" << std::endl; diff --git a/modules/imgproc/test/with-dataset/testContours.cpp b/modules/imgproc/test/with-dataset/testContours.cpp index 60f263c317..439135cc8f 100644 --- a/modules/imgproc/test/with-dataset/testContours.cpp +++ b/modules/imgproc/test/with-dataset/testContours.cpp @@ -171,15 +171,15 @@ void printImage(const vpImage &I, const std::string &name) } } -void displayContourInfo(const vp::vpContour &contour, int level) +void displayContourInfo(const VISP_CONTOURS_NAMESPACE::vpContour &contour, int level) { std::cout << "\nContour:" << std::endl; std::cout << "\tlevel: " << level << std::endl; - std::cout << "\tcontour type: " << (contour.m_contourType == vp::CONTOUR_OUTER ? "outer contour" : "hole contour") + std::cout << "\tcontour type: " << (contour.m_contourType == VISP_CONTOURS_NAMESPACE::CONTOUR_OUTER ? "outer contour" : "hole contour") << std::endl; std::cout << "\tnb children: " << contour.m_children.size() << std::endl; - for (std::vector::const_iterator it = contour.m_children.begin(); it != contour.m_children.end(); + for (std::vector::const_iterator it = contour.m_children.begin(); it != contour.m_children.end(); ++it) { displayContourInfo(**it, level + 1); } @@ -279,10 +279,10 @@ int main(int argc, const char **argv) std::cout << "Test with image data:" << std::endl; printImage(I_test_data, "I_test_data"); - vp::vpContour vp_contours; + VISP_CONTOURS_NAMESPACE::vpContour vp_contours; std::vector > contours; double t = vpTime::measureTimeMs(); - vp::findContours(I_test_data, vp_contours, contours); + VISP_CONTOURS_NAMESPACE::findContours(I_test_data, vp_contours, contours); t = vpTime::measureTimeMs() - t; displayContourInfo(vp_contours, 0); @@ -304,7 +304,7 @@ int main(int argc, const char **argv) vpImageIo::write(I2, filename); t = vpTime::measureTimeMs(); - vp::findContours(I, vp_contours, contours); + VISP_CONTOURS_NAMESPACE::findContours(I, vp_contours, contours); t = vpTime::measureTimeMs() - t; displayContourInfo(vp_contours, 0); @@ -313,50 +313,50 @@ int main(int argc, const char **argv) // Draw and save vpImage I_draw_contours(I2.getHeight(), I2.getWidth(), 0); - vp::drawContours(I_draw_contours, contours); + VISP_CONTOURS_NAMESPACE::drawContours(I_draw_contours, contours); filename = vpIoTools::createFilePath(opath, "Klimt_contours_extracted.pgm"); vpImageIo::write(I_draw_contours, filename); vpImage I_draw_contours_color(I2.getHeight(), I2.getWidth(), vpRGBa(0, 0, 0)); - vp::drawContours(I_draw_contours_color, contours, vpColor::red); + VISP_CONTOURS_NAMESPACE::drawContours(I_draw_contours_color, contours, vpColor::red); filename = vpIoTools::createFilePath(opath, "Klimt_contours_extracted_color.ppm"); vpImageIo::write(I_draw_contours_color, filename); // Test retrieve list - vp::findContours(I, vp_contours, contours, vp::CONTOUR_RETR_LIST); + VISP_CONTOURS_NAMESPACE::findContours(I, vp_contours, contours, VISP_CONTOURS_NAMESPACE::CONTOUR_RETR_LIST); vpImage I_draw_contours_list(I2.getHeight(), I2.getWidth(), 0); vpImage I_tmp_list(I.getHeight(), I.getWidth(), 0); - vp::drawContours(I_tmp_list, contours); + VISP_CONTOURS_NAMESPACE::drawContours(I_tmp_list, contours); contours.clear(); - for (std::vector::const_iterator it = vp_contours.m_children.begin(); + for (std::vector::const_iterator it = vp_contours.m_children.begin(); it != vp_contours.m_children.end(); ++it) { contours.push_back((*it)->m_points); } - vp::drawContours(I_draw_contours_list, contours); + VISP_CONTOURS_NAMESPACE::drawContours(I_draw_contours_list, contours); std::cout << "(I_tmp_list == I_draw_contours_list)? " << (I_tmp_list == I_draw_contours_list) << std::endl; filename = vpIoTools::createFilePath(opath, "Klimt_contours_extracted_list.pgm"); vpImageIo::write(I_draw_contours_list, filename); // Test retrieve external - vp::findContours(I, vp_contours, contours, vp::CONTOUR_RETR_EXTERNAL); + VISP_CONTOURS_NAMESPACE::findContours(I, vp_contours, contours, VISP_CONTOURS_NAMESPACE::CONTOUR_RETR_EXTERNAL); vpImage I_draw_contours_external(I2.getHeight(), I2.getWidth(), 0); vpImage I_tmp_external(I.getHeight(), I.getWidth(), 0); - vp::drawContours(I_tmp_external, contours); + VISP_CONTOURS_NAMESPACE::drawContours(I_tmp_external, contours); contours.clear(); - for (std::vector::const_iterator it = vp_contours.m_children.begin(); + for (std::vector::const_iterator it = vp_contours.m_children.begin(); it != vp_contours.m_children.end(); ++it) { contours.push_back((*it)->m_points); } - vp::drawContours(I_draw_contours_external, contours); + VISP_CONTOURS_NAMESPACE::drawContours(I_draw_contours_external, contours); std::cout << "(I_tmp_external == I_draw_contours_external)? " << (I_tmp_external == I_draw_contours_external) << std::endl; @@ -369,7 +369,7 @@ int main(int argc, const char **argv) (unsigned char)255); t = vpTime::measureTimeMs(); - vp::fillHoles(I_holes); + VISP_CONTOURS_NAMESPACE::fillHoles(I_holes); t = vpTime::measureTimeMs() - t; std::cout << "\nFill Holes: " << t << " ms" << std::endl; diff --git a/modules/imgproc/test/with-dataset/testFloodFill.cpp b/modules/imgproc/test/with-dataset/testFloodFill.cpp index ba3a449f5f..3078d69496 100644 --- a/modules/imgproc/test/with-dataset/testFloodFill.cpp +++ b/modules/imgproc/test/with-dataset/testFloodFill.cpp @@ -279,21 +279,21 @@ int main(int argc, const char **argv) vpImage I_check_8_connexity(image_data_check_8_connexity, 8, 8, true); // Test flood fill on test data 4-connexity - vp::floodFill(I_test_flood_fill_4_connexity, vpImagePoint(2, 2), 0, 1, vpImageMorphology::CONNEXITY_4); + VISP_IMGPROC_NAMESPACE::floodFill(I_test_flood_fill_4_connexity, vpImagePoint(2, 2), 0, 1, vpImageMorphology::CONNEXITY_4); printImage(I_test_flood_fill_4_connexity, "I_test_flood_fill_4_connexity"); if (I_test_flood_fill_4_connexity != I_check_4_connexity) { - throw vpException(vpException::fatalError, "Problem with vp::floodFill() and 4-connexity!"); + throw vpException(vpException::fatalError, "Problem with VISP_IMGPROC_NAMESPACE::floodFill() and 4-connexity!"); } std::cout << "\n(I_test_flood_fill_4_connexity == I_check_4_connexity)? " << (I_test_flood_fill_4_connexity == I_check_4_connexity) << std::endl; // Test flood fill on test data 8-connexity - vp::floodFill(I_test_flood_fill_8_connexity, vpImagePoint(2, 2), 0, 1, vpImageMorphology::CONNEXITY_8); + VISP_IMGPROC_NAMESPACE::floodFill(I_test_flood_fill_8_connexity, vpImagePoint(2, 2), 0, 1, vpImageMorphology::CONNEXITY_8); printImage(I_test_flood_fill_8_connexity, "I_test_flood_fill_8_connexity"); if (I_test_flood_fill_8_connexity != I_check_8_connexity) { - throw vpException(vpException::fatalError, "Problem with vp::floodFill() and 8-connexity!"); + throw vpException(vpException::fatalError, "Problem with VISP_IMGPROC_NAMESPACE::floodFill() and 8-connexity!"); } std::cout << "\n(I_test_flood_fill_8_connexity == I_check_8_connexity)? " << (I_test_flood_fill_8_connexity == I_check_8_connexity) << std::endl; @@ -313,7 +313,7 @@ int main(int argc, const char **argv) vpImage I_klimt_flood_fill_4_connexity = I_klimt; double t = vpTime::measureTimeMs(); - vp::floodFill(I_klimt_flood_fill_4_connexity, vpImagePoint(seed_y, seed_x), 0, 255, vpImageMorphology::CONNEXITY_4); + VISP_IMGPROC_NAMESPACE::floodFill(I_klimt_flood_fill_4_connexity, vpImagePoint(seed_y, seed_x), 0, 255, vpImageMorphology::CONNEXITY_4); t = vpTime::measureTimeMs() - t; std::cout << "Flood fill on Klimt image (4-connexity): " << t << " ms" << std::endl; @@ -322,7 +322,7 @@ int main(int argc, const char **argv) vpImage I_klimt_flood_fill_8_connexity = I_klimt; t = vpTime::measureTimeMs(); - vp::floodFill(I_klimt_flood_fill_8_connexity, vpImagePoint(seed_y, seed_x), 0, 255, vpImageMorphology::CONNEXITY_8); + VISP_IMGPROC_NAMESPACE::floodFill(I_klimt_flood_fill_8_connexity, vpImagePoint(seed_y, seed_x), 0, 255, vpImageMorphology::CONNEXITY_8); t = vpTime::measureTimeMs() - t; std::cout << "Flood fill on Klimt image (8-connexity): " << t << " ms" << std::endl; filename = vpIoTools::createFilePath(opath, "Klimt_flood_fill_8_connexity.pgm"); diff --git a/modules/imgproc/test/with-dataset/testImgproc.cpp b/modules/imgproc/test/with-dataset/testImgproc.cpp index 9e94047d9c..8cbf71bcab 100644 --- a/modules/imgproc/test/with-dataset/testImgproc.cpp +++ b/modules/imgproc/test/with-dataset/testImgproc.cpp @@ -256,7 +256,7 @@ int main(int argc, const char **argv) double alpha = 1.5, beta = -10.0; vpImage I_color_adjust; double t = vpTime::measureTimeMs(); - vp::adjust(I_color, I_color_adjust, alpha, beta); + VISP_IMGPROC_NAMESPACE::adjust(I_color, I_color_adjust, alpha, beta); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color adjust: " << t << " ms" << std::endl; @@ -267,7 +267,7 @@ int main(int argc, const char **argv) // Equalize Histogram vpImage I_color_equalize_histogram; t = vpTime::measureTimeMs(); - vp::equalizeHistogram(I_color, I_color_equalize_histogram); + VISP_IMGPROC_NAMESPACE::equalizeHistogram(I_color, I_color_equalize_histogram); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color histogram equalization: " << t << " ms" << std::endl; @@ -279,7 +279,7 @@ int main(int argc, const char **argv) vpImage I_color_gamma_correction; float gamma = 2.2f; t = vpTime::measureTimeMs(); - vp::gammaCorrection(I_color, I_color_gamma_correction, gamma); + VISP_IMGPROC_NAMESPACE::gammaCorrection(I_color, I_color_gamma_correction, gamma); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color gamma correction: " << t << " ms" << std::endl; @@ -290,7 +290,7 @@ int main(int argc, const char **argv) // Retinex vpImage I_color_retinex; t = vpTime::measureTimeMs(); - vp::retinex(I_color, I_color_retinex); + VISP_IMGPROC_NAMESPACE::retinex(I_color, I_color_retinex); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color retinex: " << t << " ms" << std::endl; @@ -301,7 +301,7 @@ int main(int argc, const char **argv) // Stretch contrast vpImage I_color_stretch_contrast; t = vpTime::measureTimeMs(); - vp::stretchContrast(I_color, I_color_stretch_contrast); + VISP_IMGPROC_NAMESPACE::stretchContrast(I_color, I_color_stretch_contrast); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color contrast stretching: " << t << " ms" << std::endl; @@ -312,7 +312,7 @@ int main(int argc, const char **argv) // Stretch Contrast HSV vpImage I_color_stretch_contrast_HSV; t = vpTime::measureTimeMs(); - vp::stretchContrastHSV(I_color, I_color_stretch_contrast_HSV); + VISP_IMGPROC_NAMESPACE::stretchContrastHSV(I_color, I_color_stretch_contrast_HSV); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color HSV contrast stretching: " << t << " ms" << std::endl; @@ -324,7 +324,7 @@ int main(int argc, const char **argv) vpImage I_color_unsharp_mask; const float sigma = 1.0f; t = vpTime::measureTimeMs(); - vp::unsharpMask(I_color, I_color_unsharp_mask, sigma); + VISP_IMGPROC_NAMESPACE::unsharpMask(I_color, I_color_unsharp_mask, sigma); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color unsharp mask: " << t << " ms" << std::endl; @@ -335,7 +335,7 @@ int main(int argc, const char **argv) // CLAHE vpImage I_color_clahe; t = vpTime::measureTimeMs(); - vp::clahe(I_color, I_color_clahe, 50); + VISP_IMGPROC_NAMESPACE::clahe(I_color, I_color_clahe, 50); t = vpTime::measureTimeMs() - t; std::cout << "Time to do color CLAHE: " << t << " ms" << std::endl; @@ -359,7 +359,7 @@ int main(int argc, const char **argv) vpImage I_adjust; beta = -20.0; t = vpTime::measureTimeMs(); - vp::adjust(I, I_adjust, alpha, beta); + VISP_IMGPROC_NAMESPACE::adjust(I, I_adjust, alpha, beta); t = vpTime::measureTimeMs() - t; std::cout << "Time to do grayscale adjust: " << t << " ms" << std::endl; @@ -370,7 +370,7 @@ int main(int argc, const char **argv) // Equalize Histogram vpImage I_equalize_histogram; t = vpTime::measureTimeMs(); - vp::equalizeHistogram(I, I_equalize_histogram); + VISP_IMGPROC_NAMESPACE::equalizeHistogram(I, I_equalize_histogram); t = vpTime::measureTimeMs() - t; std::cout << "Time to do grayscale histogram equalization: " << t << " ms" << std::endl; @@ -382,7 +382,7 @@ int main(int argc, const char **argv) vpImage I_gamma_correction; gamma = 1.8f; t = vpTime::measureTimeMs(); - vp::gammaCorrection(I, I_gamma_correction, gamma); + VISP_IMGPROC_NAMESPACE::gammaCorrection(I, I_gamma_correction, gamma); t = vpTime::measureTimeMs() - t; std::cout << "Time to do grayscale gamma correction: " << t << " ms" << std::endl; @@ -393,7 +393,7 @@ int main(int argc, const char **argv) // Stretch contrast vpImage I_stretch_contrast; t = vpTime::measureTimeMs(); - vp::stretchContrast(I, I_stretch_contrast); + VISP_IMGPROC_NAMESPACE::stretchContrast(I, I_stretch_contrast); t = vpTime::measureTimeMs() - t; std::cout << "Time to do grayscale contrast stretching: " << t << " ms" << std::endl; @@ -404,7 +404,7 @@ int main(int argc, const char **argv) // Unsharp Mask vpImage I_unsharp_mask; t = vpTime::measureTimeMs(); - vp::unsharpMask(I, I_unsharp_mask, sigma); + VISP_IMGPROC_NAMESPACE::unsharpMask(I, I_unsharp_mask, sigma); t = vpTime::measureTimeMs() - t; std::cout << "Time to do grayscale unsharp mask: " << t << " ms" << std::endl; @@ -415,7 +415,7 @@ int main(int argc, const char **argv) // CLAHE vpImage I_clahe; t = vpTime::measureTimeMs(); - vp::clahe(I, I_clahe, 50); + VISP_IMGPROC_NAMESPACE::clahe(I, I_clahe, 50); t = vpTime::measureTimeMs() - t; std::cout << "Time to do grayscale CLAHE: " << t << " ms" << std::endl; diff --git a/modules/io/test/testJsonArgumentParser.cpp b/modules/io/test/testJsonArgumentParser.cpp index be315000a0..9a783aea74 100644 --- a/modules/io/test/testJsonArgumentParser.cpp +++ b/modules/io/test/testJsonArgumentParser.cpp @@ -49,6 +49,10 @@ using json = nlohmann::json; //! json namespace shortcut #define CATCH_CONFIG_RUNNER #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + std::pair> convertToArgcAndArgv(const std::vector &args) { std::vector argvs; @@ -93,7 +97,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") json j = loadJson(jsonPath); modify(j); saveJson(j, jsonPath); - }; + }; GIVEN("Some specific arguments") { @@ -139,7 +143,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") THEN("Calling the parser without any argument fails") { const int argc = 1; - const char *argv [] = { + const char *argv[] = { "program" }; @@ -149,7 +153,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") THEN("Calling the parser with only the JSON file works") { const int argc = 3; - const char *argv [] = { + const char *argv[] = { "program", "--config", jsonPath.c_str() @@ -165,7 +169,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") THEN("Calling the parser by specifying the json argument but leaving the file path empty throws an error") { const int argc = 2; - const char *argv [] = { + const char *argv[] = { "program", "--config", }; @@ -176,7 +180,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") const int argc = 3; for (const auto &jsonElem : j.items()) { modifyJson([&jsonElem](json &j) { j.erase(jsonElem.key()); }); - const char *argv [] = { + const char *argv[] = { "program", "--config", jsonPath.c_str() @@ -189,7 +193,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") const int argc = 3; for (const auto &jsonElem : j.items()) { modifyJson([&jsonElem](json &j) { j[jsonElem.key()] = nullptr; }); - const char *argv [] = { + const char *argv[] = { "program", "--config", jsonPath.c_str() @@ -200,7 +204,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") THEN("Calling the parser with an invalid json file path throws an error") { const int argc = 3; - const char *argv [] = { + const char *argv[] = { "program", "--config", "some_invalid_json/file/path.json" @@ -289,7 +293,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") { float bcopy = b; const int argc = 1; - const char *argv [] = { + const char *argv[] = { "program" }; @@ -308,7 +312,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") { float bcopy = b; const int argc = 1; - const char *argv [] = { + const char *argv[] = { "program" }; @@ -351,7 +355,7 @@ SCENARIO("Parsing arguments from JSON file", "[json]") } } -int main(int argc, char *argv []) +int main(int argc, char *argv[]) { Catch::Session session; // There must be exactly one instance session.applyCommandLine(argc, argv); diff --git a/modules/sensor/test/framegrabber/testPylonGrabber.cpp b/modules/sensor/test/framegrabber/testPylonGrabber.cpp index 1d2049346c..569d189928 100644 --- a/modules/sensor/test/framegrabber/testPylonGrabber.cpp +++ b/modules/sensor/test/framegrabber/testPylonGrabber.cpp @@ -138,6 +138,9 @@ int main() #else int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif vpTRACE("Basler Pylon grabber capabilities are not available...\n" "You should install pylon SDK to use this binary."); } diff --git a/modules/tracker/blob/test/tracking-with-dataset/testTrackDot.cpp b/modules/tracker/blob/test/tracking-with-dataset/testTrackDot.cpp index ff04770ebb..443658b5c1 100644 --- a/modules/tracker/blob/test/tracking-with-dataset/testTrackDot.cpp +++ b/modules/tracker/blob/test/tracking-with-dataset/testTrackDot.cpp @@ -64,6 +64,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display); void usage(const char *name, const char *badparam, std::string ipath); @@ -205,8 +209,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -215,9 +219,9 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -237,11 +241,12 @@ int main(int argc, const char **argv) vpCTRACE << "Load: " << filename << std::endl; vpImageIo::read(I, filename); - } catch (...) { + } + catch (...) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; std::cerr << " Check your -i " << ipath << " option " << std::endl - << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; + << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; return EXIT_FAILURE; } @@ -276,7 +281,8 @@ int main(int argc, const char **argv) dot.initTracking(I, ip); if (opt_display) { dot.setGraphics(true); - } else { + } + else { dot.setGraphics(false); } dot.setComputeMoments(true); @@ -299,7 +305,8 @@ int main(int argc, const char **argv) } } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e.getMessage() << std::endl; return EXIT_FAILURE; } diff --git a/modules/tracker/mbt/test/generic-with-dataset/perfGenericTracker.cpp b/modules/tracker/mbt/test/generic-with-dataset/perfGenericTracker.cpp index 94c13ca1a5..a89da3b411 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/perfGenericTracker.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/perfGenericTracker.cpp @@ -49,6 +49,10 @@ #include #endif +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { bool runBenchmark = false; diff --git a/modules/tracker/mbt/test/generic-with-dataset/testGenericTracker.cpp b/modules/tracker/mbt/test/generic-with-dataset/testGenericTracker.cpp index cc551630d4..47d4a6cf99 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/testGenericTracker.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/testGenericTracker.cpp @@ -64,6 +64,10 @@ #define GETOPTARGS "i:dsclt:e:DmCh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { void usage(const char *name, const char *badparam) @@ -709,7 +713,7 @@ int main(int argc, const char *argv[]) "KLT module or OpenCV is not available.\nTest is not run." << std::endl; return EXIT_SUCCESS; - } + } #endif // Test if an input path is set @@ -742,7 +746,7 @@ int main(int argc, const char *argv[]) std::cout << "Test succeed" << std::endl; return EXIT_SUCCESS; - } +} catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; diff --git a/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerCAOParsing.cpp b/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerCAOParsing.cpp index f0163bbcaf..6dbf3e7668 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerCAOParsing.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerCAOParsing.cpp @@ -43,6 +43,10 @@ #define CATCH_CONFIG_RUNNER #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + static std::string ipath = vpIoTools::getViSPImagesDataPath(); TEST_CASE("vpMbGenericTracker load CAO model Linux line ending", "[vpMbGenericTracker CAO parsing]") @@ -64,7 +68,7 @@ TEST_CASE("vpMbGenericTracker load CAO model Linux line ending", "[vpMbGenericTr TEST_CASE("vpMbGenericTracker load CAO model Windows line ending", "[vpMbGenericTracker CAO parsing]") { const std::string cao_filename = - vpIoTools::createFilePath(ipath, "mbt-cao/cylinder_cao_model_windows_line_ending.cao"); + vpIoTools::createFilePath(ipath, "mbt-cao/cylinder_cao_model_windows_line_ending.cao"); vpMbGenericTracker tracker; const bool verbose = true; REQUIRE_NOTHROW(tracker.loadModel(cao_filename, verbose)); diff --git a/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDepth.cpp b/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDepth.cpp index d331aacc41..1f8626364b 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDepth.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDepth.cpp @@ -61,6 +61,10 @@ #define GETOPTARGS "i:dcle:mCh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { void usage(const char *name, const char *badparam) diff --git a/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDeterminist.cpp b/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDeterminist.cpp index 95334199c3..12c818da42 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDeterminist.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/testGenericTrackerDeterminist.cpp @@ -51,6 +51,10 @@ #include #endif +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { bool read_data(int cpt, vpImage &I) diff --git a/modules/tracker/mbt/test/generic-with-dataset/testMbtJsonSettings.cpp b/modules/tracker/mbt/test/generic-with-dataset/testMbtJsonSettings.cpp index bdbdd80fcf..614488462b 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/testMbtJsonSettings.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/testMbtJsonSettings.cpp @@ -49,6 +49,10 @@ using json = nlohmann::json; //! json namespace shortcut #define CATCH_CONFIG_RUNNER #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + vpMbGenericTracker baseTrackerConstructor() { const std::vector names = { "C1", "C2" }; @@ -158,7 +162,7 @@ SCENARIO("MBT JSON Serialization", "[json]") json j = loadJson(jsonPath); modify(j); saveJson(j, jsonPath); - }; + }; REQUIRE_NOTHROW(t1.saveConfigFile(jsonPath)); THEN("Reloading this tracker has the same basic properties") diff --git a/modules/tracker/mbt/test/generic-with-dataset/testMbtXmlGenericParser.cpp b/modules/tracker/mbt/test/generic-with-dataset/testMbtXmlGenericParser.cpp index c78650c1bd..ad109fa5dc 100644 --- a/modules/tracker/mbt/test/generic-with-dataset/testMbtXmlGenericParser.cpp +++ b/modules/tracker/mbt/test/generic-with-dataset/testMbtXmlGenericParser.cpp @@ -44,6 +44,9 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif #if defined(VISP_HAVE_PUGIXML) && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV)) std::string visp_images_dir = vpIoTools::getViSPImagesDataPath(); if (vpIoTools::checkDirectory(visp_images_dir + "/xml")) { @@ -156,7 +159,7 @@ int main() return EXIT_FAILURE; } } - } + } #elif !(defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV)) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; #elif !(defined(VISP_HAVE_PUGIXML)) @@ -165,4 +168,4 @@ int main() std::cout << "Test succeed" << std::endl; return EXIT_SUCCESS; -} + } diff --git a/modules/tracker/mbt/test/testTukeyEstimator.cpp b/modules/tracker/mbt/test/testTukeyEstimator.cpp index 6b9aa248fa..b6ad7c55e0 100644 --- a/modules/tracker/mbt/test/testTukeyEstimator.cpp +++ b/modules/tracker/mbt/test/testTukeyEstimator.cpp @@ -49,6 +49,9 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif size_t nb_elements = 1000; int nb_iterations = 100; double stdev = 0.5, mean = 0.0, noise_threshold = 1e-3; @@ -88,8 +91,8 @@ int main() for (size_t i = 0; i < weights.size(); i++) { if (!vpMath::equal(weights[i], weights_col[(unsigned int)i], noise_threshold)) { std::cerr << "Difference between vpRobust::TUKEY and " - "vpMbtTukeyEstimator (double)!" - << std::endl; + "vpMbtTukeyEstimator (double)!" + << std::endl; std::cerr << "weights_col[" << i << "]=" << weights_col[(unsigned int)i] << std::endl; std::cerr << "weights[" << i << "]=" << weights[i] << std::endl; return EXIT_FAILURE; @@ -128,8 +131,8 @@ int main() for (size_t i = 0; i < weights.size(); i++) { if (!vpMath::equal(weights[i], weights_col[(unsigned int)i], noise_threshold)) { std::cerr << "Difference between vpRobust::TUKEY and " - "vpMbtTukeyEstimator (float)!" - << std::endl; + "vpMbtTukeyEstimator (float)!" + << std::endl; std::cerr << "weights_col[" << i << "]=" << weights_col[(unsigned int)i] << std::endl; std::cerr << "weights[" << i << "]=" << weights[i] << std::endl; return EXIT_FAILURE; @@ -164,8 +167,8 @@ int main() for (size_t i = 0; i < weights.size(); i++) { if (!vpMath::equal(weights[(unsigned int)i], weights_col[(unsigned int)i], noise_threshold)) { std::cerr << "Difference between vpRobust::TUKEY and " - "vpMbtTukeyEstimator (float)!" - << std::endl; + "vpMbtTukeyEstimator (float)!" + << std::endl; std::cerr << "weights_col[" << i << "]=" << weights_col[(unsigned int)i] << std::endl; std::cerr << "weights[" << i << "]=" << weights[(unsigned int)i] << std::endl; return EXIT_FAILURE;