Commit 43061d75 authored by Vlad Shakhuro's avatar Vlad Shakhuro

Add cv::adas namespace

parent b33977d9
...@@ -42,6 +42,11 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -42,6 +42,11 @@ the use of this software, even if advised of the possibility of such damage.
#ifndef __OPENCV_ADAS_ACFFEATURE_HPP__ #ifndef __OPENCV_ADAS_ACFFEATURE_HPP__
#define __OPENCV_ADAS_ACFFEATURE_HPP__ #define __OPENCV_ADAS_ACFFEATURE_HPP__
namespace cv
{
namespace adas
{
class ACFFeature class ACFFeature
{ {
public: public:
...@@ -59,9 +64,9 @@ private: ...@@ -59,9 +64,9 @@ private:
}; };
/* Save ACFFeature to FileStorage */ /* Save ACFFeature to FileStorage */
cv::FileStorage& operator<< (cv::FileStorage& out, const ACFFeature& feature); FileStorage& operator<< (FileStorage& out, const ACFFeature& feature);
/* Load ACFFeature from FileStorage */ /* Load ACFFeature from FileStorage */
cv::FileStorage& operator>> (cv::FileStorage& in, ACFFeature& feature); FileStorage& operator>> (FileStorage& in, ACFFeature& feature);
/* Compute channel pyramid for acf features /* Compute channel pyramid for acf features
...@@ -73,8 +78,8 @@ Returns computed channels in vectors N x CH, ...@@ -73,8 +78,8 @@ Returns computed channels in vectors N x CH,
N — number of scales (outer vector), N — number of scales (outer vector),
CH — number of channels (inner vectors) CH — number of channels (inner vectors)
*/ */
std::vector<std::vector<cv::Mat_<int>>> std::vector<std::vector<Mat_<int>>>
computeChannels(const cv::Mat& image, const ScaleParams& params); computeChannels(const Mat& image, const ScaleParams& params);
class ACFFeatureEvaluator class ACFFeatureEvaluator
{ {
...@@ -83,7 +88,7 @@ public: ...@@ -83,7 +88,7 @@ public:
ACFFeatureEvaluator(const std::vector<ACFFeature>& features); ACFFeatureEvaluator(const std::vector<ACFFeature>& features);
/* Set channels for feature evaluation */ /* Set channels for feature evaluation */
void setChannels(const std::vector<cv::Mat_<int>>& channels); void setChannels(const std::vector<Mat_<int>>& channels);
/* Set window position */ /* Set window position */
void setPosition(Size position); void setPosition(Size position);
...@@ -96,13 +101,13 @@ public: ...@@ -96,13 +101,13 @@ public:
Returns matrix-column of features Returns matrix-column of features
*/ */
cv::Mat_<int> evaluateAll() const; Mat_<int> evaluateAll() const;
private: private:
/* Features to evaluate */ /* Features to evaluate */
std::vector<ACFFeature> features_; std::vector<ACFFeature> features_;
/* Channels for feature evaluation */ /* Channels for feature evaluation */
std::vector<cv::Mat_<int>> channels std::vector<Mat_<int>> channels
/* Channels window position */ /* Channels window position */
Size position_; Size position_;
}; };
...@@ -121,4 +126,7 @@ Returns vector of distinct acf features ...@@ -121,4 +126,7 @@ Returns vector of distinct acf features
std::vector<ACFFeature> std::vector<ACFFeature>
generateFeatures(Size window_size, size_t count = UINT_MAX, int seed = 0); generateFeatures(Size window_size, size_t count = UINT_MAX, int seed = 0);
} /* namespace adas */
} /* namespace cv */
#endif /* __OPENCV_ADAS_ACFFEATURE_HPP__ */ #endif /* __OPENCV_ADAS_ACFFEATURE_HPP__ */
...@@ -42,6 +42,11 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -42,6 +42,11 @@ the use of this software, even if advised of the possibility of such damage.
#ifndef __OPENCV_ADAS_ICFDETECTOR_HPP__ #ifndef __OPENCV_ADAS_ICFDETECTOR_HPP__
#define __OPENCV_ADAS_ICFDETECTOR_HPP__ #define __OPENCV_ADAS_ICFDETECTOR_HPP__
namespace cv
{
namespace adas
{
class ICFDetector class ICFDetector
{ {
public: public:
...@@ -94,4 +99,7 @@ public: ...@@ -94,4 +99,7 @@ public:
bool save(const std::string& filename); bool save(const std::string& filename);
}; };
} /* namespace adas */
} /* namespace cv */
#endif /* __OPENCV_ADAS_ICFDETECTOR_HPP__ */ #endif /* __OPENCV_ADAS_ICFDETECTOR_HPP__ */
...@@ -42,6 +42,11 @@ the use of this software, even if advised of the possibility of such damage. ...@@ -42,6 +42,11 @@ the use of this software, even if advised of the possibility of such damage.
#ifndef __OPENCV_ADAS_WALDBOOST_HPP__ #ifndef __OPENCV_ADAS_WALDBOOST_HPP__
#define __OPENCV_ADAS_WALDBOOST_HPP__ #define __OPENCV_ADAS_WALDBOOST_HPP__
namespace cv
{
namespace adas
{
class Stump class Stump
{ {
public: public:
...@@ -54,7 +59,7 @@ public: ...@@ -54,7 +59,7 @@ public:
Returns chosen feature index. Feature enumeration starts from 0 Returns chosen feature index. Feature enumeration starts from 0
*/ */
int train(const cv::Mat_<int>& data, const cv::Mat_<int>& labels); int train(const Mat_<int>& data, const Mat_<int>& labels);
/* Predict object class given /* Predict object class given
...@@ -76,9 +81,9 @@ private: ...@@ -76,9 +81,9 @@ private:
}; };
/* Save Stump to FileStorage */ /* Save Stump to FileStorage */
cv::FileStorage& operator<< (cv::FileStorage& out, const Stump& classifier); FileStorage& operator<< (FileStorage& out, const Stump& classifier);
/* Load Stump from FileStorage */ /* Load Stump from FileStorage */
cv::FileStorage& operator>> (cv::FileStorage& in, Stump& classifier); FileStorage& operator>> (FileStorage& in, Stump& classifier);
class WaldBoost class WaldBoost
{ {
...@@ -96,8 +101,8 @@ public: ...@@ -96,8 +101,8 @@ public:
Returns feature indices chosen for cascade. Returns feature indices chosen for cascade.
Feature enumeration starts from 0 Feature enumeration starts from 0
*/ */
std::vector<int> train(const cv::Mat_<int>& data, std::vector<int> train(const Mat_<int>& data,
const cv::Mat_<int>& labels); const Mat_<int>& labels);
/* Predict object class given object that can compute object features /* Predict object class given object that can compute object features
...@@ -120,8 +125,11 @@ private: ...@@ -120,8 +125,11 @@ private:
}; };
/* Save WaldBoost to FileStorage */ /* Save WaldBoost to FileStorage */
cv::FileStorage& operator<< (cv::FileStorage& out, const WaldBoost& classifier); FileStorage& operator<< (FileStorage& out, const WaldBoost& classifier);
/* Load WaldBoost from FileStorage */ /* Load WaldBoost from FileStorage */
cv::FileStorage& operator>> (cv::FileStorage& in, WaldBoost& classifier); FileStorage& operator>> (FileStorage& in, WaldBoost& classifier);
} /* namespace adas */
} /* namespace cv */
#endif /* __OPENCV_ADAS_WALDBOOST_HPP__ */ #endif /* __OPENCV_ADAS_WALDBOOST_HPP__ */
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