Commit 09286322 authored by Vlad Shakhuro's avatar Vlad Shakhuro

Add namespaces

parent 5992dedf
...@@ -44,8 +44,8 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -44,8 +44,8 @@ the use of this software, even if advised of the possibility of such damage.
#include "precomp.hpp" #include "precomp.hpp"
using namespace std; namespace cv {
using namespace cv; namespace xobjdetect {
float calcNormFactor( const Mat& sum, const Mat& sqSum ) float calcNormFactor( const Mat& sum, const Mat& sqSum )
{ {
...@@ -63,9 +63,9 @@ float calcNormFactor( const Mat& sum, const Mat& sqSum ) ...@@ -63,9 +63,9 @@ float calcNormFactor( const Mat& sum, const Mat& sqSum )
CvParams::CvParams() : name( "params" ) {} CvParams::CvParams() : name( "params" ) {}
void CvParams::printDefaults() const void CvParams::printDefaults() const
{ cout << "--" << name << "--" << endl; } { std::cout << "--" << name << "--" << std::endl; }
void CvParams::printAttrs() const {} void CvParams::printAttrs() const {}
bool CvParams::scanAttr( const string, const string ) { return false; } bool CvParams::scanAttr( const std::string, const std::string ) { return false; }
//---------------------------- FeatureParams -------------------------------------- //---------------------------- FeatureParams --------------------------------------
...@@ -126,3 +126,6 @@ Ptr<CvFeatureEvaluator> CvFeatureEvaluator::create() ...@@ -126,3 +126,6 @@ Ptr<CvFeatureEvaluator> CvFeatureEvaluator::create()
{ {
return Ptr<CvFeatureEvaluator>(new CvLBPEvaluator); return Ptr<CvFeatureEvaluator>(new CvLBPEvaluator);
} }
}
}
...@@ -45,7 +45,8 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -45,7 +45,8 @@ the use of this software, even if advised of the possibility of such damage.
#include "precomp.hpp" #include "precomp.hpp"
using namespace cv; namespace cv {
namespace xobjdetect {
CvLBPFeatureParams::CvLBPFeatureParams() CvLBPFeatureParams::CvLBPFeatureParams()
{ {
...@@ -122,3 +123,6 @@ void CvLBPEvaluator::Feature::write(FileStorage &fs) const ...@@ -122,3 +123,6 @@ void CvLBPEvaluator::Feature::write(FileStorage &fs) const
{ {
fs << CC_RECT << "[:" << rect.x << rect.y << rect.width << rect.height << "]"; fs << CC_RECT << "[:" << rect.x << rect.y << rect.width << rect.height << "]";
} }
}
}
...@@ -49,6 +49,10 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -49,6 +49,10 @@ the use of this software, even if advised of the possibility of such damage.
#define LBPF_NAME "lbpFeatureParams" #define LBPF_NAME "lbpFeatureParams"
namespace cv {
namespace xobjdetect {
struct CvLBPFeatureParams : CvFeatureParams struct CvLBPFeatureParams : CvFeatureParams
{ {
CvLBPFeatureParams(); CvLBPFeatureParams();
...@@ -106,4 +110,7 @@ inline uchar CvLBPEvaluator::Feature::calc(const cv::Mat &_sum) ...@@ -106,4 +110,7 @@ inline uchar CvLBPEvaluator::Feature::calc(const cv::Mat &_sum)
(psum[p[4]] - psum[p[5]] - psum[p[8]] + psum[p[9]] >= cval ? 1 : 0)); // 3 (psum[p[4]] - psum[p[5]] - psum[p[8]] + psum[p[9]] >= cval ? 1 : 0)); // 3
} }
}
}
#endif #endif
...@@ -70,6 +70,9 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -70,6 +70,9 @@ the use of this software, even if advised of the possibility of such damage.
(p3) = (rect).x + (rect).width - (rect).height \ (p3) = (rect).x + (rect).width - (rect).height \
+ (step) * ((rect).y + (rect).width + (rect).height); + (step) * ((rect).y + (rect).width + (rect).height);
namespace cv {
namespace xobjdetect {
float calcNormFactor( const cv::Mat& sum, const cv::Mat& sqSum ); float calcNormFactor( const cv::Mat& sum, const cv::Mat& sqSum );
template<class Feature> template<class Feature>
...@@ -142,4 +145,7 @@ protected: ...@@ -142,4 +145,7 @@ protected:
cv::Mat cls; cv::Mat cls;
}; };
}
}
#endif #endif
...@@ -44,8 +44,8 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -44,8 +44,8 @@ the use of this software, even if advised of the possibility of such damage.
#include "precomp.hpp" #include "precomp.hpp"
namespace cv namespace cv {
{ namespace xobjdetect {
static void compute_cdf(const Mat1b& data, static void compute_cdf(const Mat1b& data,
const Mat1f& weights, const Mat1f& weights,
...@@ -395,4 +395,5 @@ WaldBoost::~WaldBoost() ...@@ -395,4 +395,5 @@ WaldBoost::~WaldBoost()
{ {
} }
}; }
}
...@@ -48,6 +48,7 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -48,6 +48,7 @@ the use of this software, even if advised of the possibility of such damage.
#include "precomp.hpp" #include "precomp.hpp"
namespace cv { namespace cv {
namespace xobjdetect {
class WaldBoost { class WaldBoost {
public: public:
...@@ -83,6 +84,7 @@ private: ...@@ -83,6 +84,7 @@ private:
std::vector<float> cascade_thresholds_; std::vector<float> cascade_thresholds_;
}; };
}
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment