From c5b57d0c5800da6903f9f50ee0c4e45df3f9944e Mon Sep 17 00:00:00 2001 From: Daniel Angelov Date: Fri, 5 Sep 2014 15:38:35 +0300 Subject: [PATCH] Enclose code in ccalib namespace. Switch defines to consts. --- modules/ccalib/include/opencv2/ccalib.hpp | 4 ++-- modules/ccalib/src/ccalib.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/ccalib/include/opencv2/ccalib.hpp b/modules/ccalib/include/opencv2/ccalib.hpp index 780613cdc..53285e2be 100644 --- a/modules/ccalib/include/opencv2/ccalib.hpp +++ b/modules/ccalib/include/opencv2/ccalib.hpp @@ -49,7 +49,7 @@ #include -namespace cv{ +namespace cv{ namespace ccalib{ class CV_EXPORTS CustomPattern : public Algorithm { @@ -144,6 +144,6 @@ private: void refineKeypointsPos(const Mat& img, std::vector& kp); }; -} // cv +}} // namespace ccalib, cv #endif diff --git a/modules/ccalib/src/ccalib.cpp b/modules/ccalib/src/ccalib.cpp index 5b1b48408..861fbedb2 100644 --- a/modules/ccalib/src/ccalib.cpp +++ b/modules/ccalib/src/ccalib.cpp @@ -55,17 +55,17 @@ #include #include +namespace cv{ namespace ccalib{ + using namespace std; -#define MIN_CONTOUR_AREA_PX 100 -#define MIN_CONTOUR_AREA_RATIO 0.2 -#define MAX_CONTOUR_AREA_RATIO 5 +const int MIN_CONTOUR_AREA_PX = 100; +const float MIN_CONTOUR_AREA_RATIO = 0.2; +const float MAX_CONTOUR_AREA_RATIO = 5.0; -#define MIN_POINTS_FOR_H 10 +const int MIN_POINTS_FOR_H = 10; -#define MAX_PROJ_ERROR_PX 5.0 - -namespace cv{ +const float MAX_PROJ_ERROR_PX = 5.0; CustomPattern::CustomPattern() { @@ -487,8 +487,8 @@ void CustomPattern::drawOrientation(InputOutputArray image, InputArray tvec, Inp img.copyTo(image); } -} // namespace cv +}} // namespace ccalib, cv -#endif //_CPP +#endif // __OPENCV_CCALIB_CPP__ #endif // cplusplus