diff --git a/modules/core/include/visp3/core/vpEigenConversion.h b/modules/core/include/visp3/core/vpEigenConversion.h index 165e3325f5..0d04be4dbe 100644 --- a/modules/core/include/visp3/core/vpEigenConversion.h +++ b/modules/core/include/visp3/core/vpEigenConversion.h @@ -41,6 +41,7 @@ #include #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) +// The following macro forces us to us #define VISP_EIGEN_CONVERSION_NAMESPACE vp #else #define VISP_EIGEN_CONVERSION_NAMESPACE VISP_NAMESPACE_NAME @@ -50,38 +51,38 @@ namespace VISP_EIGEN_CONVERSION_NAMESPACE { #ifdef VISP_HAVE_EIGEN3 /* Eigen to ViSP */ -VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, vpMatrix &dst); +VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, VISP_NAMESPACE_ADDRESSING vpMatrix &dst); -VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, vpHomogeneousMatrix &dst); +VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, VISP_NAMESPACE_ADDRESSING vpHomogeneousMatrix &dst); -template void eigen2visp(const Eigen::Quaternion &src, vpQuaternionVector &dst) +template void eigen2visp(const Eigen::Quaternion &src, VISP_NAMESPACE_ADDRESSING vpQuaternionVector &dst) { dst.build(src.x(), src.y(), src.z(), src.w()); } -template void eigen2visp(const Eigen::AngleAxis &src, vpThetaUVector &dst) +template void eigen2visp(const Eigen::AngleAxis &src, VISP_NAMESPACE_ADDRESSING vpThetaUVector &dst) { dst.build(src.angle() * src.axis()(0), src.angle() * src.axis()(1), src.angle() * src.axis()(2)); } -VISP_EXPORT void eigen2visp(const Eigen::VectorXd &src, vpColVector &dst); +VISP_EXPORT void eigen2visp(const Eigen::VectorXd &src, VISP_NAMESPACE_ADDRESSING vpColVector &dst); -VISP_EXPORT void eigen2visp(const Eigen::RowVectorXd &src, vpRowVector &dst); +VISP_EXPORT void eigen2visp(const Eigen::RowVectorXd &src, VISP_NAMESPACE_ADDRESSING vpRowVector &dst); /* ViSP to Eigen */ -template void visp2eigen(const vpMatrix &src, Eigen::MatrixBase &dst) +template void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpMatrix &src, Eigen::MatrixBase &dst) { dst = Eigen::Map >(src.data, src.getRows(), src.getCols()); } -template void visp2eigen(const vpHomogeneousMatrix &src, Eigen::MatrixBase &dst) +template void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpHomogeneousMatrix &src, Eigen::MatrixBase &dst) { dst = Eigen::Map >(src.data, src.getRows(), src.getCols()); } -template void visp2eigen(const vpQuaternionVector &src, Eigen::Quaternion &dst) +template void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpQuaternionVector &src, Eigen::Quaternion &dst) { dst.w() = static_cast(src.w()); dst.x() = static_cast(src.x()); @@ -89,7 +90,7 @@ template void visp2eigen(const vpQuaternionVector &src, Eigen::Q dst.z() = static_cast(src.z()); } -template void visp2eigen(const vpThetaUVector &src, Eigen::AngleAxis &dst) +template void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpThetaUVector &src, Eigen::AngleAxis &dst) { dst.angle() = static_cast(src.getTheta()); dst.axis()(0) = static_cast(src.getU()[0]); @@ -97,9 +98,9 @@ template void visp2eigen(const vpThetaUVector &src, Eigen::Angle dst.axis()(2) = static_cast(src.getU()[2]); } -VISP_EXPORT void visp2eigen(const vpColVector &src, Eigen::VectorXd &dst); +VISP_EXPORT void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpColVector &src, Eigen::VectorXd &dst); -VISP_EXPORT void visp2eigen(const vpRowVector &src, Eigen::RowVectorXd &dst); +VISP_EXPORT void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpRowVector &src, Eigen::RowVectorXd &dst); #endif } // namespace vp #endif diff --git a/modules/core/include/visp3/core/vpHinkley.h b/modules/core/include/visp3/core/vpHinkley.h index 5c07f0fea1..1b78905f8b 100644 --- a/modules/core/include/visp3/core/vpHinkley.h +++ b/modules/core/include/visp3/core/vpHinkley.h @@ -42,6 +42,11 @@ #include #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + +#if defined(ENABLE_VISP_NAMESPACE) +namespace VISP_NAMESPACE_NAME +{ +#endif /*! \class vpHinkley \deprecated This class is deprecated. You should rather use vpStatisticalTestHinkley. @@ -166,5 +171,8 @@ class VISP_EXPORT vpHinkley double Tk; double Nk; }; +#if defined(ENABLE_VISP_NAMESPACE) +} +#endif #endif #endif diff --git a/modules/core/include/visp3/core/vpIoTools.h b/modules/core/include/visp3/core/vpIoTools.h index d5bc19a294..f20bb6ea30 100644 --- a/modules/core/include/visp3/core/vpIoTools.h +++ b/modules/core/include/visp3/core/vpIoTools.h @@ -56,7 +56,7 @@ #include #if VISP_CXX_STANDARD > VISP_CXX_STANDARD_98 -namespace VISP_NAMESPACE_NAME +namespace visp { // https://github.com/BinomialLLC/basis_universal/blob/ad9386a4a1cf2a248f7bbd45f543a7448db15267/encoder/basisu_miniz.h#L665 static inline unsigned long vp_mz_crc32(unsigned long crc, const unsigned char *ptr, size_t buf_len) diff --git a/modules/core/src/math/matrix/vpEigenConversion.cpp b/modules/core/src/math/matrix/vpEigenConversion.cpp index ee2e306856..bf2236cfa7 100644 --- a/modules/core/src/math/matrix/vpEigenConversion.cpp +++ b/modules/core/src/math/matrix/vpEigenConversion.cpp @@ -39,24 +39,24 @@ namespace VISP_EIGEN_CONVERSION_NAMESPACE { #ifdef VISP_HAVE_EIGEN3 /* Eigen to ViSP */ -void eigen2visp(const Eigen::MatrixXd &src, vpMatrix &dst) +void eigen2visp(const Eigen::MatrixXd &src, VISP_NAMESPACE_ADDRESSING vpMatrix &dst) { dst.resize(static_cast(src.rows()), static_cast(src.cols()), false, false); Eigen::Map >(&dst.data[0], src.rows(), src.cols()) = src; } -void eigen2visp(const Eigen::MatrixXd &src, vpHomogeneousMatrix &dst) +void eigen2visp(const Eigen::MatrixXd &src, VISP_NAMESPACE_ADDRESSING vpHomogeneousMatrix &dst) { if ((src.rows() != 4) || (src.cols() != 4)) { - throw vpException(vpException::dimensionError, "Input Eigen Matrix must be of size (4,4)!"); + throw VISP_NAMESPACE_ADDRESSING vpException(VISP_NAMESPACE_ADDRESSING vpException::dimensionError, "Input Eigen Matrix must be of size (4,4)!"); } Eigen::Map >(&dst.data[0], src.rows(), src.cols()) = src; } -void eigen2visp(const Eigen::VectorXd &src, vpColVector &dst) +void eigen2visp(const Eigen::VectorXd &src, VISP_NAMESPACE_ADDRESSING vpColVector &dst) { dst.resize(static_cast(src.rows())); #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300) @@ -70,7 +70,7 @@ void eigen2visp(const Eigen::VectorXd &src, vpColVector &dst) } } -void eigen2visp(const Eigen::RowVectorXd &src, vpRowVector &dst) +void eigen2visp(const Eigen::RowVectorXd &src, VISP_NAMESPACE_ADDRESSING vpRowVector &dst) { dst.resize(static_cast(src.cols())); #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300) @@ -84,9 +84,9 @@ void eigen2visp(const Eigen::RowVectorXd &src, vpRowVector &dst) } } -void visp2eigen(const vpColVector &src, Eigen::VectorXd &dst) { dst = Eigen::VectorXd::Map(src.data, src.size()); } +void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpColVector &src, Eigen::VectorXd &dst) { dst = Eigen::VectorXd::Map(src.data, src.size()); } -void visp2eigen(const vpRowVector &src, Eigen::RowVectorXd &dst) +void visp2eigen(const VISP_NAMESPACE_ADDRESSING vpRowVector &src, Eigen::RowVectorXd &dst) { dst = Eigen::RowVectorXd::Map(src.data, src.size()); } diff --git a/modules/core/src/tools/file/vpIoTools.cpp b/modules/core/src/tools/file/vpIoTools.cpp index 028e8fe80d..fe530afa1c 100644 --- a/modules/core/src/tools/file/vpIoTools.cpp +++ b/modules/core/src/tools/file/vpIoTools.cpp @@ -126,13 +126,13 @@ using namespace buminiz; #include -char VISP_NAMESPACE_ADDRESSING cnpy::BigEndianTest() +char visp::cnpy::BigEndianTest() { int x = 1; return (((reinterpret_cast(&x))[0]) ? '<' : '>'); } -char VISP_NAMESPACE_ADDRESSING cnpy::map_type(const std::type_info &t) +char visp::cnpy::map_type(const std::type_info &t) { if (t == typeid(float)) { return 'f'; } if (t == typeid(double)) { return 'f'; } @@ -159,7 +159,7 @@ char VISP_NAMESPACE_ADDRESSING cnpy::map_type(const std::type_info &t) else { return '?'; } } -void VISP_NAMESPACE_ADDRESSING cnpy::parse_npy_header(unsigned char *buffer, size_t &word_size, std::vector &shape, bool &fortran_order) +void visp::cnpy::parse_npy_header(unsigned char *buffer, size_t &word_size, std::vector &shape, bool &fortran_order) { uint16_t header_len = *reinterpret_cast(buffer+8); std::string header(reinterpret_cast(buffer+9), header_len); @@ -194,7 +194,7 @@ void VISP_NAMESPACE_ADDRESSING cnpy::parse_npy_header(unsigned char *buffer, siz word_size = atoi(str_ws.substr(0, loc2).c_str()); } -void VISP_NAMESPACE_ADDRESSING cnpy::parse_npy_header(FILE *fp, size_t &word_size, std::vector &shape, bool &fortran_order) +void visp::cnpy::parse_npy_header(FILE *fp, size_t &word_size, std::vector &shape, bool &fortran_order) { char buffer[256]; size_t res = fread(buffer, sizeof(char), 11, fp); @@ -250,7 +250,7 @@ void VISP_NAMESPACE_ADDRESSING cnpy::parse_npy_header(FILE *fp, size_t &word_siz word_size = atoi(str_ws.substr(0, loc2).c_str()); } -void VISP_NAMESPACE_ADDRESSING cnpy::parse_zip_footer(FILE *fp, uint16_t &nrecs, size_t &global_header_size, size_t &global_header_offset) +void visp::cnpy::parse_zip_footer(FILE *fp, uint16_t &nrecs, size_t &global_header_size, size_t &global_header_offset) { std::vector footer(22); fseek(fp, -22, SEEK_END); @@ -274,14 +274,14 @@ void VISP_NAMESPACE_ADDRESSING cnpy::parse_zip_footer(FILE *fp, uint16_t &nrecs, UNUSED(comment_len); assert(comment_len == 0); } -VISP_NAMESPACE_ADDRESSING cnpy::NpyArray load_the_npy_file(FILE *fp) +visp::cnpy::NpyArray load_the_npy_file(FILE *fp) { std::vector shape; size_t word_size; bool fortran_order; - VISP_NAMESPACE_ADDRESSING cnpy::parse_npy_header(fp, word_size, shape, fortran_order); + visp::cnpy::parse_npy_header(fp, word_size, shape, fortran_order); - VISP_NAMESPACE_ADDRESSING cnpy::NpyArray arr(shape, word_size, fortran_order); + visp::cnpy::NpyArray arr(shape, word_size, fortran_order); size_t nread = fread(arr.data(), 1, arr.num_bytes(), fp); if (nread != arr.num_bytes()) { throw std::runtime_error("load_the_npy_file: failed fread"); @@ -289,7 +289,7 @@ VISP_NAMESPACE_ADDRESSING cnpy::NpyArray load_the_npy_file(FILE *fp) return arr; } -VISP_NAMESPACE_ADDRESSING cnpy::NpyArray load_the_npz_array(FILE *fp, uint32_t compr_bytes, uint32_t uncompr_bytes) +visp::cnpy::NpyArray load_the_npz_array(FILE *fp, uint32_t compr_bytes, uint32_t uncompr_bytes) { std::vector buffer_compr(compr_bytes); std::vector buffer_uncompr(uncompr_bytes); @@ -321,9 +321,9 @@ VISP_NAMESPACE_ADDRESSING cnpy::NpyArray load_the_npz_array(FILE *fp, uint32_t c std::vector shape; size_t word_size; bool fortran_order; - VISP_NAMESPACE_ADDRESSING cnpy::parse_npy_header(&buffer_uncompr[0], word_size, shape, fortran_order); + visp::cnpy::parse_npy_header(&buffer_uncompr[0], word_size, shape, fortran_order); - VISP_NAMESPACE_ADDRESSING cnpy::NpyArray array(shape, word_size, fortran_order); + visp::cnpy::NpyArray array(shape, word_size, fortran_order); size_t offset = uncompr_bytes - array.num_bytes(); memcpy(array.data(), &buffer_uncompr[0]+offset, array.num_bytes()); @@ -339,7 +339,7 @@ VISP_NAMESPACE_ADDRESSING cnpy::NpyArray load_the_npz_array(FILE *fp, uint32_t c \warning This function has only been tested on little endian platform. \note Original library: cnpy with MIT license. */ -VISP_NAMESPACE_ADDRESSING cnpy::npz_t VISP_NAMESPACE_ADDRESSING cnpy::npz_load(std::string fname) +visp::cnpy::npz_t visp::cnpy::npz_load(std::string fname) { FILE *fp = fopen(fname.c_str(), "rb"); @@ -347,7 +347,7 @@ VISP_NAMESPACE_ADDRESSING cnpy::npz_t VISP_NAMESPACE_ADDRESSING cnpy::npz_load(s throw std::runtime_error("npz_load: Error! Unable to open file "+fname+"!"); } - VISP_NAMESPACE_ADDRESSING cnpy::npz_t arrays; + visp::cnpy::npz_t arrays; bool quit = false; while (!quit) { std::vector local_header(30); @@ -404,7 +404,7 @@ VISP_NAMESPACE_ADDRESSING cnpy::npz_t VISP_NAMESPACE_ADDRESSING cnpy::npz_load(s \warning This function has only been tested on little endian platform. \note Original library: cnpy with MIT license. */ -VISP_NAMESPACE_ADDRESSING cnpy::NpyArray VISP_NAMESPACE_ADDRESSING cnpy::npz_load(std::string fname, std::string varname) +visp::cnpy::NpyArray visp::cnpy::npz_load(std::string fname, std::string varname) { FILE *fp = fopen(fname.c_str(), "rb"); @@ -469,7 +469,7 @@ VISP_NAMESPACE_ADDRESSING cnpy::NpyArray VISP_NAMESPACE_ADDRESSING cnpy::npz_loa \warning This function has only been tested on little endian platform. \note Original library: cnpy with MIT license. */ -VISP_NAMESPACE_ADDRESSING cnpy::NpyArray VISP_NAMESPACE_ADDRESSING cnpy::npy_load(std::string fname) +visp::cnpy::NpyArray visp::cnpy::npy_load(std::string fname) { FILE *fp = fopen(fname.c_str(), "rb"); diff --git a/modules/imgproc/include/visp3/imgproc/vpContours.h b/modules/imgproc/include/visp3/imgproc/vpContours.h index adb76b0f94..bd1d422684 100644 --- a/modules/imgproc/include/visp3/imgproc/vpContours.h +++ b/modules/imgproc/include/visp3/imgproc/vpContours.h @@ -160,7 +160,7 @@ struct vpDirection { vpDirection direction; int directionSize = static_cast(LAST_DIRECTION); - int idx = vpMath::modulo(static_cast(m_direction) - 1, directionSize); + int idx = VISP_NAMESPACE_ADDRESSING vpMath::modulo(static_cast(m_direction) - 1, directionSize); direction.m_direction = vpDirectionType(idx); return direction; @@ -172,17 +172,17 @@ struct vpDirection * @param point Current point coordinate. * @return Next point coordinate along the contour. */ - vpImagePoint active(const vpImage &I, const vpImagePoint &point) + VISP_NAMESPACE_ADDRESSING vpImagePoint active(const VISP_NAMESPACE_ADDRESSING vpImage &I, const VISP_NAMESPACE_ADDRESSING vpImagePoint &point) { int yy = static_cast(point.get_i() + m_diry[static_cast(m_direction)]); int xx = static_cast(point.get_j() + m_dirx[static_cast(m_direction)]); if ((xx < 0) || (xx >= static_cast(I.getWidth())) || (yy < 0) || (yy >= static_cast(I.getHeight()))) { - return vpImagePoint(-1, -1); + return VISP_NAMESPACE_ADDRESSING vpImagePoint(-1, -1); } int pixel = I[yy][xx]; - return pixel != 0 ? vpImagePoint(yy, xx) : vpImagePoint(-1, -1); + return pixel != 0 ? VISP_NAMESPACE_ADDRESSING vpImagePoint(yy, xx) : VISP_NAMESPACE_ADDRESSING vpImagePoint(-1, -1); } }; @@ -218,7 +218,7 @@ struct vpContour //! Parent contour vpContour *m_parent; //! Vector of points belonging to the contour - std::vector m_points; + std::vector m_points; /*! * Default constructor. @@ -319,7 +319,7 @@ struct vpContour * \param contours : Detected contours. * \param grayValue : Drawing grayscale color. */ -VISP_EXPORT void drawContours(vpImage &I, const std::vector > &contours, +VISP_EXPORT void drawContours(VISP_NAMESPACE_ADDRESSING vpImage &I, const std::vector > &contours, unsigned char grayValue = 255); /*! @@ -331,8 +331,8 @@ VISP_EXPORT void drawContours(vpImage &I, const std::vector &I, const std::vector > &contours, - const vpColor &color); +VISP_EXPORT void drawContours(VISP_NAMESPACE_ADDRESSING vpImage &I, const std::vector > &contours, + const VISP_NAMESPACE_ADDRESSING vpColor &color); /*! * \ingroup group_imgproc_contours @@ -345,8 +345,8 @@ VISP_EXPORT void drawContours(vpImage &I, const std::vector &I_original, vpContour &contours, - std::vector > &contourPts, +VISP_EXPORT void findContours(const VISP_NAMESPACE_ADDRESSING vpImage &I_original, vpContour &contours, + std::vector > &contourPts, const vpContourRetrievalType &retrievalMode = CONTOUR_RETR_TREE); } // namespace diff --git a/modules/imgproc/include/visp3/imgproc/vpImgproc.h b/modules/imgproc/include/visp3/imgproc/vpImgproc.h index 677d8a925f..b0bf57ed12 100644 --- a/modules/imgproc/include/visp3/imgproc/vpImgproc.h +++ b/modules/imgproc/include/visp3/imgproc/vpImgproc.h @@ -196,7 +196,7 @@ VISP_EXPORT vpGammaColorHandling vpGammaColorHandlingFromString(const std::strin * \param alpha : Multiplication coefficient. * \param beta : Constant value added to the old intensity. */ -VISP_EXPORT void adjust(vpImage &I, double alpha, double beta); +VISP_EXPORT void adjust(VISP_NAMESPACE_ADDRESSING vpImage &I, double alpha, double beta); /*! * \ingroup group_imgproc_brightness @@ -209,7 +209,7 @@ VISP_EXPORT void adjust(vpImage &I, double alpha, double beta); * \param alpha : Multiplication coefficient. * \param beta : Constant value added to the old intensity. */ -VISP_EXPORT void adjust(const vpImage &I1, vpImage &I2, double alpha, double beta); +VISP_EXPORT void adjust(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, double alpha, double beta); /*! * \ingroup group_imgproc_brightness @@ -221,7 +221,7 @@ VISP_EXPORT void adjust(const vpImage &I1, vpImage * \param alpha : Multiplication coefficient. * \param beta : Constant value added to the old intensity. */ -VISP_EXPORT void adjust(vpImage &I, const double alpha, double beta); +VISP_EXPORT void adjust(VISP_NAMESPACE_ADDRESSING vpImage &I, const double alpha, double beta); /*! * \ingroup group_imgproc_brightness @@ -234,7 +234,7 @@ VISP_EXPORT void adjust(vpImage &I, const double alpha, double beta); * \param alpha : Multiplication coefficient. * \param beta : Constant value added to the old intensity. */ -VISP_EXPORT void adjust(const vpImage &I1, vpImage &I2, double alpha, double beta); +VISP_EXPORT void adjust(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, double alpha, double beta); /*! * \ingroup group_imgproc_brightness @@ -265,7 +265,7 @@ VISP_EXPORT void adjust(const vpImage &I1, vpImage &I2, double a * boxes of the given block size only and interpolates for locations in * between. */ -VISP_EXPORT void clahe(const vpImage &I1, vpImage &I2, int blockRadius = 150, +VISP_EXPORT void clahe(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, int blockRadius = 150, int bins = 256, float slope = 3.0f, bool fast = true); /*! @@ -295,7 +295,7 @@ VISP_EXPORT void clahe(const vpImage &I1, vpImage * boxes of the given block size only and interpolates for locations in * between. */ -VISP_EXPORT void clahe(const vpImage &I1, vpImage &I2, int blockRadius = 150, int bins = 256, +VISP_EXPORT void clahe(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, int blockRadius = 150, int bins = 256, float slope = 3.0f, bool fast = true); /*! @@ -308,7 +308,7 @@ VISP_EXPORT void clahe(const vpImage &I1, vpImage &I2, int block * \param I : The grayscale image to apply histogram equalization. * \param p_mask : If set, a boolean mask to take into account only the points for which the mask is true. */ -VISP_EXPORT void equalizeHistogram(vpImage &I, const vpImage *p_mask = nullptr); +VISP_EXPORT void equalizeHistogram(VISP_NAMESPACE_ADDRESSING vpImage &I, const VISP_NAMESPACE_ADDRESSING vpImage *p_mask = nullptr); /*! * \ingroup group_imgproc_histogram @@ -321,8 +321,8 @@ VISP_EXPORT void equalizeHistogram(vpImage &I, const vpImage &I1, vpImage &I2, - const vpImage *p_mask = nullptr); +VISP_EXPORT void equalizeHistogram(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, + const VISP_NAMESPACE_ADDRESSING vpImage *p_mask = nullptr); /*! * \ingroup group_imgproc_histogram @@ -337,7 +337,7 @@ VISP_EXPORT void equalizeHistogram(const vpImage &I1, vpImage &I, bool useHSV = false); +VISP_EXPORT void equalizeHistogram(VISP_NAMESPACE_ADDRESSING vpImage &I, bool useHSV = false); /*! * \ingroup group_imgproc_histogram @@ -353,7 +353,7 @@ VISP_EXPORT void equalizeHistogram(vpImage &I, bool useHSV = false); * value channel (in HSV space), otherwise the histogram equalization is * performed independently on the RGB channels. */ -VISP_EXPORT void equalizeHistogram(const vpImage &I1, vpImage &I2, bool useHSV = false); +VISP_EXPORT void equalizeHistogram(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, bool useHSV = false); /*! * \ingroup group_imgproc_gamma @@ -370,8 +370,8 @@ VISP_EXPORT void equalizeHistogram(const vpImage &I1, vpImage &I * \param[in] p_mask : If different from nullptr, permits to indicate which points must be taken into account by setting * them to true. */ -VISP_EXPORT void gammaCorrection(vpImage &I, const float &gamma, const vpGammaMethod &method = GAMMA_MANUAL, - const vpImage *p_mask = nullptr); +VISP_EXPORT void gammaCorrection(VISP_NAMESPACE_ADDRESSING vpImage &I, const float &gamma, const vpGammaMethod &method = GAMMA_MANUAL, + const VISP_NAMESPACE_ADDRESSING vpImage *p_mask = nullptr); /*! * \ingroup group_imgproc_gamma @@ -389,8 +389,8 @@ VISP_EXPORT void gammaCorrection(vpImage &I, const float &gamma, * \param[in] p_mask : If different from nullptr, permits to indicate which points must be taken into account by setting * them to true. */ -VISP_EXPORT void gammaCorrection(const vpImage &I1, vpImage &I2, const float &gamma, - const vpGammaMethod &method = GAMMA_MANUAL, const vpImage *p_mask = nullptr); +VISP_EXPORT void gammaCorrection(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, const float &gamma, + const vpGammaMethod &method = GAMMA_MANUAL, const VISP_NAMESPACE_ADDRESSING vpImage *p_mask = nullptr); /*! * \ingroup group_imgproc_gamma @@ -405,8 +405,8 @@ VISP_EXPORT void gammaCorrection(const vpImage &I1, vpImage &I, const float &gamma, const vpGammaColorHandling &colorHandling = GAMMA_RGB, - const vpGammaMethod &method = GAMMA_MANUAL, const vpImage *p_mask = nullptr); +VISP_EXPORT void gammaCorrection(VISP_NAMESPACE_ADDRESSING vpImage &I, const float &gamma, const vpGammaColorHandling &colorHandling = GAMMA_RGB, + const vpGammaMethod &method = GAMMA_MANUAL, const VISP_NAMESPACE_ADDRESSING vpImage *p_mask = nullptr); /*! * \ingroup group_imgproc_gamma @@ -422,9 +422,9 @@ VISP_EXPORT void gammaCorrection(vpImage &I, const float &gamma, const v * \param[in] p_mask : If different from nullptr, permits to indicate which points must be taken into account by setting * them to true. */ -VISP_EXPORT void gammaCorrection(const vpImage &I1, vpImage &I2, const float &gamma, +VISP_EXPORT void gammaCorrection(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, const float &gamma, const vpGammaColorHandling &colorHandling = GAMMA_RGB, - const vpGammaMethod &method = GAMMA_MANUAL, const vpImage *p_mask = nullptr); + const vpGammaMethod &method = GAMMA_MANUAL, const VISP_NAMESPACE_ADDRESSING vpImage *p_mask = nullptr); /*! * \ingroup group_imgproc_retinex @@ -447,7 +447,7 @@ VISP_EXPORT void gammaCorrection(const vpImage &I1, vpImage &I2, * \param kernelSize : Kernel size for the gaussian blur * operation. If -1, the kernel size is calculated from the image size. */ -VISP_EXPORT void retinex(vpImage &I, int scale = 240, int scaleDiv = 3, int level = RETINEX_UNIFORM, +VISP_EXPORT void retinex(VISP_NAMESPACE_ADDRESSING vpImage &I, int scale = 240, int scaleDiv = 3, int level = RETINEX_UNIFORM, double dynamic = 1.2, int kernelSize = -1); /*! @@ -472,7 +472,7 @@ VISP_EXPORT void retinex(vpImage &I, int scale = 240, int scaleDiv = 3, * \param kernelSize : Kernel size for the gaussian blur * operation. If -1, the kernel size is calculated from the image size. */ -VISP_EXPORT void retinex(const vpImage &I1, vpImage &I2, int scale = 240, int scaleDiv = 3, +VISP_EXPORT void retinex(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2, int scale = 240, int scaleDiv = 3, int level = RETINEX_UNIFORM, double dynamic = 1.2, int kernelSize = -1); /*! @@ -482,7 +482,7 @@ VISP_EXPORT void retinex(const vpImage &I1, vpImage &I2, int sca * * \param I : The grayscale image to stretch the contrast. */ -VISP_EXPORT void stretchContrast(vpImage &I); +VISP_EXPORT void stretchContrast(VISP_NAMESPACE_ADDRESSING vpImage &I); /*! * \ingroup group_imgproc_contrast @@ -492,7 +492,7 @@ VISP_EXPORT void stretchContrast(vpImage &I); * \param I1 : The first input grayscale image. * \param I2 : The second output grayscale image. */ -VISP_EXPORT void stretchContrast(const vpImage &I1, vpImage &I2); +VISP_EXPORT void stretchContrast(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2); /*! * \ingroup group_imgproc_contrast @@ -501,7 +501,7 @@ VISP_EXPORT void stretchContrast(const vpImage &I1, vpImage &I); +VISP_EXPORT void stretchContrast(VISP_NAMESPACE_ADDRESSING vpImage &I); /*! * \ingroup group_imgproc_contrast @@ -511,7 +511,7 @@ VISP_EXPORT void stretchContrast(vpImage &I); * \param I1 : The first input color image. * \param I2 : The second output color image. */ -VISP_EXPORT void stretchContrast(const vpImage &I1, vpImage &I2); +VISP_EXPORT void stretchContrast(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2); /*! * \ingroup group_imgproc_contrast @@ -521,7 +521,7 @@ VISP_EXPORT void stretchContrast(const vpImage &I1, vpImage &I2) * * \param I : The color image to stretch the contrast in the HSV color space. */ -VISP_EXPORT void stretchContrastHSV(vpImage &I); +VISP_EXPORT void stretchContrastHSV(VISP_NAMESPACE_ADDRESSING vpImage &I); /*! * \ingroup group_imgproc_contrast @@ -532,7 +532,7 @@ VISP_EXPORT void stretchContrastHSV(vpImage &I); * \param I1 : The first input color image. * \param I2 : The second output color image. */ -VISP_EXPORT void stretchContrastHSV(const vpImage &I1, vpImage &I2); +VISP_EXPORT void stretchContrastHSV(const VISP_NAMESPACE_ADDRESSING vpImage &I1, VISP_NAMESPACE_ADDRESSING vpImage &I2); /*! * \ingroup group_imgproc_sharpening @@ -543,7 +543,7 @@ VISP_EXPORT void stretchContrastHSV(const vpImage &I1, vpImage & * \param sigma : Standard deviation for Gaussian kernel. * \param weight : Weight (between [0 - 1[) for the sharpening process. */ -VISP_EXPORT void unsharpMask(vpImage &I, float sigma, double weight = 0.6); +VISP_EXPORT void unsharpMask(VISP_NAMESPACE_ADDRESSING vpImage &I, float sigma, double weight = 0.6); /*! * \ingroup group_imgproc_sharpening @@ -555,7 +555,7 @@ VISP_EXPORT void unsharpMask(vpImage &I, float sigma, double weig * \param sigma : Standard deviation for Gaussian kernel. * \param weight : Weight (between [0 - 1[) for the sharpening process. */ -VISP_EXPORT void unsharpMask(const vpImage &I, vpImage &Ires, float sigma, +VISP_EXPORT void unsharpMask(const VISP_NAMESPACE_ADDRESSING vpImage &I, VISP_NAMESPACE_ADDRESSING vpImage &Ires, float sigma, double weight = 0.6); /*! @@ -567,7 +567,7 @@ VISP_EXPORT void unsharpMask(const vpImage &I, vpImage &I, float sigma, double weight = 0.6); +VISP_EXPORT void unsharpMask(VISP_NAMESPACE_ADDRESSING vpImage &I, float sigma, double weight = 0.6); /*! * \ingroup group_imgproc_sharpening @@ -579,7 +579,7 @@ VISP_EXPORT void unsharpMask(vpImage &I, float sigma, double weight = 0. * \param sigma : Standard deviation for Gaussian kernel. * \param weight : Weight (between [0 - 1[) for the sharpening process. */ -VISP_EXPORT void unsharpMask(const vpImage &I, vpImage &Ires, float sigma, double weight = 0.6); +VISP_EXPORT void unsharpMask(const VISP_NAMESPACE_ADDRESSING vpImage &I, VISP_NAMESPACE_ADDRESSING vpImage &Ires, float sigma, double weight = 0.6); /*! * \ingroup group_imgproc_connected_components @@ -591,8 +591,8 @@ VISP_EXPORT void unsharpMask(const vpImage &I, vpImage &Ires, fl * \param nbComponents : Number of connected components. * \param connexity : Type of connexity. */ -VISP_EXPORT void connectedComponents(const vpImage &I, vpImage &labels, int &nbComponents, - const vpImageMorphology::vpConnexityType &connexity = vpImageMorphology::CONNEXITY_4); +VISP_EXPORT void connectedComponents(const VISP_NAMESPACE_ADDRESSING vpImage &I, VISP_NAMESPACE_ADDRESSING vpImage &labels, int &nbComponents, + const VISP_NAMESPACE_ADDRESSING vpImageMorphology::vpConnexityType &connexity = VISP_NAMESPACE_ADDRESSING vpImageMorphology::CONNEXITY_4); /*! * \ingroup group_imgproc_morph @@ -601,10 +601,10 @@ VISP_EXPORT void connectedComponents(const vpImage &I, vpImage &I +VISP_EXPORT void fillHoles(VISP_NAMESPACE_ADDRESSING vpImage &I #if USE_OLD_FILL_HOLE , - const vpImageMorphology::vpConnexityType &connexity = vpImageMorphology::CONNEXITY_4 + const VISP_NAMESPACE_ADDRESSING vpImageMorphology::vpConnexityType &connexity = VISP_NAMESPACE_ADDRESSING vpImageMorphology::CONNEXITY_4 #endif ); @@ -619,9 +619,9 @@ VISP_EXPORT void fillHoles(vpImage &I * \param newValue : New value to flood fill. * \param connexity : Type of connexity. */ -VISP_EXPORT void floodFill(vpImage &I, const vpImagePoint &seedPoint, const unsigned char oldValue, +VISP_EXPORT void floodFill(VISP_NAMESPACE_ADDRESSING vpImage &I, const VISP_NAMESPACE_ADDRESSING vpImagePoint &seedPoint, const unsigned char oldValue, const unsigned char newValue, - const vpImageMorphology::vpConnexityType &connexity = vpImageMorphology::CONNEXITY_4); + const VISP_NAMESPACE_ADDRESSING vpImageMorphology::vpConnexityType &connexity = VISP_NAMESPACE_ADDRESSING vpImageMorphology::CONNEXITY_4); /*! * \ingroup group_imgproc_morph @@ -641,9 +641,9 @@ VISP_EXPORT void floodFill(vpImage &I, const vpImagePoint &seedPo * \param h_kp1 : Image morphologically reconstructed. * \param connexity : Type of connexity. */ -VISP_EXPORT void reconstruct(const vpImage &marker, const vpImage &mask, - vpImage &h_kp1 /*alias I */, - const vpImageMorphology::vpConnexityType &connexity = vpImageMorphology::CONNEXITY_4); +VISP_EXPORT void reconstruct(const VISP_NAMESPACE_ADDRESSING vpImage &marker, const VISP_NAMESPACE_ADDRESSING vpImage &mask, + VISP_NAMESPACE_ADDRESSING vpImage &h_kp1 /*alias I */, + const VISP_NAMESPACE_ADDRESSING vpImageMorphology::vpConnexityType &connexity = VISP_NAMESPACE_ADDRESSING vpImageMorphology::CONNEXITY_4); /*! * \ingroup group_imgproc_threshold @@ -655,7 +655,7 @@ VISP_EXPORT void reconstruct(const vpImage &marker, const vpImage * \param backgroundValue : Value to set to the background. * \param foregroundValue : Value to set to the foreground. */ -VISP_EXPORT unsigned char autoThreshold(vpImage &I, const vpAutoThresholdMethod &method, +VISP_EXPORT unsigned char autoThreshold(VISP_NAMESPACE_ADDRESSING vpImage &I, const vpAutoThresholdMethod &method, const unsigned char backgroundValue = 0, const unsigned char foregroundValue = 255); diff --git a/modules/imgproc/src/vpCLAHE.cpp b/modules/imgproc/src/vpCLAHE.cpp index 88ed860bb0..2095ff78d0 100644 --- a/modules/imgproc/src/vpCLAHE.cpp +++ b/modules/imgproc/src/vpCLAHE.cpp @@ -86,6 +86,10 @@ namespace VISP_NAMESPACE_NAME #endif { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif + int fastRound(float value) { return static_cast(value + 0.5f); } void clipHistogram(const std::vector &hist, std::vector &clippedHist, int limit) diff --git a/modules/imgproc/src/vpConnectedComponents.cpp b/modules/imgproc/src/vpConnectedComponents.cpp index 00f98acff8..7e6350ce98 100644 --- a/modules/imgproc/src/vpConnectedComponents.cpp +++ b/modules/imgproc/src/vpConnectedComponents.cpp @@ -45,6 +45,9 @@ namespace vp namespace VISP_NAMESPACE_NAME #endif { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif void getNeighbors(const vpImage &I, std::queue &listOfNeighbors, unsigned int i, unsigned int j, const vpImageMorphology::vpConnexityType &connexity) diff --git a/modules/imgproc/src/vpContours.cpp b/modules/imgproc/src/vpContours.cpp index c67aa67516..c89002e704 100644 --- a/modules/imgproc/src/vpContours.cpp +++ b/modules/imgproc/src/vpContours.cpp @@ -76,6 +76,9 @@ namespace vp namespace VISP_NAMESPACE_NAME #endif { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif bool fromTo(const vpImagePoint &from, const vpImagePoint &to, vpDirection &direction) { diff --git a/modules/imgproc/src/vpFloodFill.cpp b/modules/imgproc/src/vpFloodFill.cpp index 3bfca2b9ce..ae92fc0638 100644 --- a/modules/imgproc/src/vpFloodFill.cpp +++ b/modules/imgproc/src/vpFloodFill.cpp @@ -72,6 +72,9 @@ namespace vp namespace VISP_NAMESPACE_NAME #endif { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif void floodFill(vpImage &I, const vpImagePoint &seedPoint, const unsigned char oldValue, const unsigned char newValue, const vpImageMorphology::vpConnexityType &connexity) diff --git a/modules/imgproc/src/vpImgproc.cpp b/modules/imgproc/src/vpImgproc.cpp index 91ebeb8f9c..6d3480f2ed 100644 --- a/modules/imgproc/src/vpImgproc.cpp +++ b/modules/imgproc/src/vpImgproc.cpp @@ -66,6 +66,9 @@ namespace VISP_IMGPROC_NAMESPACE { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif std::string vpGammaMethodList(const std::string &pref, const std::string &sep, const std::string &suf) { diff --git a/modules/imgproc/src/vpMorph.cpp b/modules/imgproc/src/vpMorph.cpp index f6b652819f..16b50d2a95 100644 --- a/modules/imgproc/src/vpMorph.cpp +++ b/modules/imgproc/src/vpMorph.cpp @@ -45,6 +45,9 @@ namespace vp namespace VISP_NAMESPACE_NAME #endif { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif void fillHoles(vpImage &I #if USE_OLD_FILL_HOLE @@ -94,8 +97,8 @@ void fillHoles(vpImage &I for (unsigned int i = 0; i < I.getHeight(); ++i) { for (unsigned int j = 0; j < I.getWidth(); ++j) { I[i][j] = 255 - I_reconstruct[i + 1][j + 1]; - } } +} #else // Create flood fill mask vpImage flood_fill_mask(I.getHeight() + 2, I.getWidth() + 2, 0); diff --git a/modules/imgproc/src/vpRetinex.cpp b/modules/imgproc/src/vpRetinex.cpp index 248d9260ed..b4ce7dd61a 100644 --- a/modules/imgproc/src/vpRetinex.cpp +++ b/modules/imgproc/src/vpRetinex.cpp @@ -97,6 +97,10 @@ namespace VISP_NAMESPACE_NAME #define MAX_RETINEX_SCALES 8 +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif + std::vector retinexScalesDistribution(int scaleDiv, int level, int scale) { std::vector scales(MAX_RETINEX_SCALES); diff --git a/modules/imgproc/src/vpThreshold.cpp b/modules/imgproc/src/vpThreshold.cpp index 9b9d531adc..2841c641c6 100644 --- a/modules/imgproc/src/vpThreshold.cpp +++ b/modules/imgproc/src/vpThreshold.cpp @@ -46,6 +46,9 @@ namespace vp namespace VISP_NAMESPACE_NAME #endif { +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(ENABLE_VISP_NAMESPACE) +using namespace VISP_NAMESPACE_NAME; +#endif bool isBimodal(const std::vector &hist_float) {