All modules (except ocl and gpu) compiles and pass tests

This commit is contained in:
Andrey Kamaev
2013-03-20 20:13:46 +04:00
parent 762aefd71b
commit 2ad7b97f1c
91 changed files with 606 additions and 604 deletions

View File

@@ -109,7 +109,7 @@ public:
float operator() (const cv::Mat& integrals, const cv::Size& model) const;
friend void write(cv::FileStorage& fs, const std::string&, const ChannelFeature& f);
friend void write(cv::FileStorage& fs, const cv::String&, const ChannelFeature& f);
friend std::ostream& operator<<(std::ostream& out, const ChannelFeature& f);
private:
@@ -117,7 +117,7 @@ private:
int channel;
};
void write(cv::FileStorage& fs, const std::string&, const ChannelFeature& f);
void write(cv::FileStorage& fs, const cv::String&, const ChannelFeature& f);
std::ostream& operator<<(std::ostream& out, const ChannelFeature& m);
// ========================================================================== //
@@ -135,7 +135,7 @@ public:
CV_WRAP virtual int totalChannels() const = 0;
virtual cv::AlgorithmInfo* info() const = 0;
CV_WRAP static cv::Ptr<ChannelFeatureBuilder> create(const std::string& featureType);
CV_WRAP static cv::Ptr<ChannelFeatureBuilder> create(const cv::String& featureType);
};
// ========================================================================== //
@@ -211,7 +211,7 @@ public:
virtual bool train(const Dataset* dataset, const FeaturePool* pool, int weaks, int treeDepth) = 0;
virtual void setRejectThresholds(OutputArray thresholds) = 0;
virtual void write( cv::FileStorage &fs, const FeaturePool* pool, InputArray thresholds) const = 0;
virtual void write( CvFileStorage* fs, std::string name) const = 0;
virtual void write( CvFileStorage* fs, cv::String name) const = 0;
};
CV_EXPORTS bool initModule_softcascade(void);

View File

@@ -190,7 +190,7 @@ struct ChannelStorage
enum {HOG_BINS = 6, HOG_LUV_BINS = 10};
ChannelStorage(const cv::Mat& colored, int shr, std::string featureTypeStr) : shrinkage(shr)
ChannelStorage(const cv::Mat& colored, int shr, cv::String featureTypeStr) : shrinkage(shr)
{
model_height = cvRound(colored.rows / (float)shrinkage);
if (featureTypeStr == "ICF") featureTypeStr = "HOG6MagLuv";
@@ -240,7 +240,7 @@ struct cv::softcascade::Detector::Fields
typedef std::vector<SOctave>::iterator octIt_t;
typedef std::vector<Detection> dvector;
std::string featureTypeStr;
cv::String featureTypeStr;
void detectAt(const int dx, const int dy, const Level& level, const ChannelStorage& storage, dvector& detections) const
{
@@ -364,14 +364,14 @@ struct cv::softcascade::Detector::Fields
static const char *const FEATURE_FORMAT = "featureFormat";
// only Ada Boost supported
std::string stageTypeStr = (std::string)root[SC_STAGE_TYPE];
cv::String stageTypeStr = (cv::String)root[SC_STAGE_TYPE];
CV_Assert(stageTypeStr == SC_BOOST);
std::string fformat = (std::string)root[FEATURE_FORMAT];
cv::String fformat = (cv::String)root[FEATURE_FORMAT];
bool useBoxes = (fformat == "BOX");
// only HOG-like integral channel features supported
featureTypeStr = (std::string)root[SC_FEATURE_TYPE];
featureTypeStr = (cv::String)root[SC_FEATURE_TYPE];
CV_Assert(featureTypeStr == SC_ICF || featureTypeStr == SC_HOG6_MAG_LUV);
origObjWidth = (int)root[SC_ORIG_W];

View File

@@ -136,17 +136,17 @@ struct cv::softcascade::SCascade::Fields
static const char *const SC_F_RECT = "rect";
// only Ada Boost supported
std::string stageTypeStr = (std::string)root[SC_STAGE_TYPE];
cv::String stageTypeStr = (cv::String)root[SC_STAGE_TYPE];
CV_Assert(stageTypeStr == SC_BOOST);
// only HOG-like integral channel features supported
std::string featureTypeStr = (std::string)root[SC_FEATURE_TYPE];
cv::String featureTypeStr = (cv::String)root[SC_FEATURE_TYPE];
CV_Assert(featureTypeStr == SC_ICF);
int origWidth = (int)root[SC_ORIG_W];
int origHeight = (int)root[SC_ORIG_H];
std::string fformat = (std::string)root[SC_FEATURE_FORMAT];
cv::String fformat = (cv::String)root[SC_FEATURE_FORMAT];
bool useBoxes = (fformat == "BOX");
ushort shrinkage = cv::saturate_cast<ushort>((int)root[SC_SHRINKAGE]);

View File

@@ -122,7 +122,7 @@ CV_INIT_ALGORITHM(HOG6MagLuv, "ChannelFeatureBuilder.HOG6MagLuv", );
ChannelFeatureBuilder::~ChannelFeatureBuilder() {}
cv::Ptr<ChannelFeatureBuilder> ChannelFeatureBuilder::create(const std::string& featureType)
cv::Ptr<ChannelFeatureBuilder> ChannelFeatureBuilder::create(const cv::String& featureType)
{
return Algorithm::create<ChannelFeatureBuilder>("ChannelFeatureBuilder." + featureType);
}
@@ -158,7 +158,7 @@ float ChannelFeature::operator() (const cv::Mat& integrals, const cv::Size& mode
return (float)(a - b + c - d);
}
void cv::softcascade::write(cv::FileStorage& fs, const std::string&, const ChannelFeature& f)
void cv::softcascade::write(cv::FileStorage& fs, const cv::String&, const ChannelFeature& f)
{
fs << "{" << "channel" << f.channel << "rect" << f.bb << "}";
}

View File

@@ -69,7 +69,7 @@ public:
virtual bool train(const Dataset* dataset, const FeaturePool* pool, int weaks, int treeDepth);
virtual void setRejectThresholds(OutputArray thresholds);
virtual void write( cv::FileStorage &fs, const FeaturePool* pool, InputArray thresholds) const;
virtual void write( CvFileStorage* fs, std::string name) const;
virtual void write( CvFileStorage* fs, cv::String name) const;
protected:
virtual float predict( InputArray _sample, InputArray _votes, bool raw_mode, bool return_sum ) const;
virtual bool train( const cv::Mat& trainData, const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),
@@ -436,7 +436,7 @@ float BoostedSoftCascadeOctave::predict( const Mat& _sample, const cv::Range ran
return CvBoost::predict(&sample, 0, 0, range, false, true);
}
void BoostedSoftCascadeOctave::write( CvFileStorage* fs, std::string _name) const
void BoostedSoftCascadeOctave::write( CvFileStorage* fs, cv::String _name) const
{
CvBoost::write(fs, _name.c_str());
}

View File

@@ -53,7 +53,7 @@ namespace {
using namespace cv::softcascade;
typedef vector<string> svector;
typedef vector<cv::String> svector;
class ScaledDataset : public Dataset
{
public: