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

@@ -1887,7 +1887,7 @@ public:
void setVerbose(bool verbose);
void read(const FileNode& node);
void write(FileStorage& fs, const std::string& name=std::string()) const;
void write(FileStorage& fs, const cv::String& name=cv::String()) const;
int radius;
int threshold;
@@ -1918,7 +1918,7 @@ public:
const PatchGenerator& patchGenerator=PatchGenerator());
virtual ~FernClassifier();
virtual void read(const FileNode& n);
virtual void write(FileStorage& fs, const std::string& name=std::string()) const;
virtual void write(FileStorage& fs, const cv::String& name=cv::String()) const;
virtual void trainFromSingleView(const Mat& image,
const std::vector<KeyPoint>& keypoints,
int _patchSize=PATCH_SIZE,
@@ -2062,8 +2062,8 @@ public:
inline void applyQuantization(int num_quant_bits) { makePosteriors2(num_quant_bits); }
// debug
void savePosteriors(std::string url, bool append=false);
void savePosteriors2(std::string url, bool append=false);
void savePosteriors(cv::String url, bool append=false);
void savePosteriors2(cv::String url, bool append=false);
private:
int classes_;
@@ -2181,9 +2181,9 @@ public:
void write(std::ostream &os) const;
// experimental and debug
void saveAllFloatPosteriors(std::string file_url);
void saveAllBytePosteriors(std::string file_url);
void setFloatPosteriorsFromTextfile_176(std::string url);
void saveAllFloatPosteriors(cv::String file_url);
void saveAllBytePosteriors(cv::String file_url);
void setFloatPosteriorsFromTextfile_176(cv::String url);
float countZeroElements();
std::vector<RandomizedTree> trees_;
@@ -2356,7 +2356,7 @@ protected:
CvAffinePose* m_affine_poses; // an array of poses
CvMat** m_transforms; // an array of affine transforms corresponding to poses
std::string m_feature_name; // the name of the feature associated with the descriptor
cv::String m_feature_name; // the name of the feature associated with the descriptor
CvPoint m_center; // the coordinates of the feature (the center of the input image ROI)
int m_pca_dim_high; // the number of descriptor pca components to use for generating affine poses
@@ -2382,7 +2382,7 @@ public:
const char* pca_hr_config = 0, const char* pca_desc_config = 0, int pyr_levels = 1,
int pca_dim_high = 100, int pca_dim_low = 100);
OneWayDescriptorBase(CvSize patch_size, int pose_count, const std::string &pca_filename, const std::string &train_path = std::string(), const std::string &images_list = std::string(),
OneWayDescriptorBase(CvSize patch_size, int pose_count, const cv::String &pca_filename, const cv::String &train_path = cv::String(), const cv::String &images_list = cv::String(),
float _scale_min = 0.7f, float _scale_max=1.5f, float _scale_step=1.2f, int pyr_levels = 1,
int pca_dim_high = 100, int pca_dim_low = 100);
@@ -2516,7 +2516,7 @@ public:
void ConvertDescriptorsArrayToTree(); // Converting pca_descriptors array to KD tree
// GetPCAFilename: get default PCA filename
static std::string GetPCAFilename () { return "pca.yml"; }
static cv::String GetPCAFilename () { return "pca.yml"; }
virtual bool empty() const { return m_train_feature_count <= 0 ? true : false; }
@@ -2568,8 +2568,8 @@ public:
OneWayDescriptorObject(CvSize patch_size, int pose_count, const char* train_path, const char* pca_config,
const char* pca_hr_config = 0, const char* pca_desc_config = 0, int pyr_levels = 1);
OneWayDescriptorObject(CvSize patch_size, int pose_count, const std::string &pca_filename,
const std::string &train_path = std::string (), const std::string &images_list = std::string (),
OneWayDescriptorObject(CvSize patch_size, int pose_count, const cv::String &pca_filename,
const cv::String &train_path = cv::String (), const cv::String &images_list = cv::String (),
float _scale_min = 0.7f, float _scale_max=1.5f, float _scale_step=1.2f, int pyr_levels = 1);
@@ -2633,16 +2633,16 @@ public:
Params( int poseCount = POSE_COUNT,
Size patchSize = Size(PATCH_WIDTH, PATCH_HEIGHT),
std::string pcaFilename = std::string(),
std::string trainPath = std::string(), std::string trainImagesList = std::string(),
cv::String pcaFilename = cv::String(),
cv::String trainPath = cv::String(), cv::String trainImagesList = cv::String(),
float minScale = GET_MIN_SCALE(), float maxScale = GET_MAX_SCALE(),
float stepScale = GET_STEP_SCALE() );
int poseCount;
Size patchSize;
std::string pcaFilename;
std::string trainPath;
std::string trainImagesList;
cv::String pcaFilename;
cv::String trainPath;
cv::String trainImagesList;
float minScale, maxScale, stepScale;
};
@@ -2706,7 +2706,7 @@ public:
int compressionMethod=FernClassifier::COMPRESSION_NONE,
const PatchGenerator& patchGenerator=PatchGenerator() );
Params( const std::string& filename );
Params( const cv::String& filename );
int nclasses;
int patchSize;
@@ -2717,7 +2717,7 @@ public:
int compressionMethod;
PatchGenerator patchGenerator;
std::string filename;
cv::String filename;
};
FernDescriptorMatcher( const Params& params=Params() );
@@ -2759,7 +2759,7 @@ template<typename T>
class CV_EXPORTS CalonderDescriptorExtractor : public DescriptorExtractor
{
public:
CalonderDescriptorExtractor( const std::string& classifierFile );
CalonderDescriptorExtractor( const cv::String& classifierFile );
virtual void read( const FileNode &fn );
virtual void write( FileStorage &fs ) const;
@@ -2777,7 +2777,7 @@ protected:
};
template<typename T>
CalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const std::string& classifier_file)
CalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const cv::String& classifier_file)
{
classifier_.read( classifier_file.c_str() );
}
@@ -2867,7 +2867,7 @@ public:
void setVerbose(bool verbose);
void read(const FileNode& node);
void write(FileStorage& fs, const std::string& name=std::string()) const;
void write(FileStorage& fs, const cv::String& name=cv::String()) const;
bool operator()(const Mat& image, CV_OUT Mat& H, CV_OUT std::vector<Point2f>& corners) const;
bool operator()(const std::vector<Mat>& pyr, const std::vector<KeyPoint>& keypoints,
CV_OUT Mat& H, CV_OUT std::vector<Point2f>& corners,

View File

@@ -626,7 +626,7 @@ void RandomizedTree::write(std::ostream &os) const
}
void RandomizedTree::savePosteriors(std::string url, bool append)
void RandomizedTree::savePosteriors(cv::String url, bool append)
{
std::ofstream file(url.c_str(), (append?std::ios::app:std::ios::out));
for (int i=0; i<num_leaves_; i++) {
@@ -641,7 +641,7 @@ void RandomizedTree::savePosteriors(std::string url, bool append)
file.close();
}
void RandomizedTree::savePosteriors2(std::string url, bool append)
void RandomizedTree::savePosteriors2(cv::String url, bool append)
{
std::ofstream file(url.c_str(), (append?std::ios::app:std::ios::out));
for (int i=0; i<num_leaves_; i++) {
@@ -915,7 +915,7 @@ printf("RTreeClassifier::write: num_quant_bits_=%i\n", num_quant_bits_);
tree_it->write(os);
}
void RTreeClassifier::saveAllFloatPosteriors(std::string url)
void RTreeClassifier::saveAllFloatPosteriors(cv::String url)
{
printf("[DEBUG] writing all float posteriors to %s...\n", url.c_str());
for (int i=0; i<(int)trees_.size(); ++i)
@@ -923,7 +923,7 @@ void RTreeClassifier::saveAllFloatPosteriors(std::string url)
printf("[DEBUG] done\n");
}
void RTreeClassifier::saveAllBytePosteriors(std::string url)
void RTreeClassifier::saveAllBytePosteriors(cv::String url)
{
printf("[DEBUG] writing all byte posteriors to %s...\n", url.c_str());
for (int i=0; i<(int)trees_.size(); ++i)
@@ -932,7 +932,7 @@ void RTreeClassifier::saveAllBytePosteriors(std::string url)
}
void RTreeClassifier::setFloatPosteriorsFromTextfile_176(std::string url)
void RTreeClassifier::setFloatPosteriorsFromTextfile_176(cv::String url)
{
std::ifstream ifs(url.c_str());

View File

@@ -465,7 +465,7 @@ namespace cv{
void OneWayDescriptor::Initialize(int pose_count, IplImage* frontal, const char* feature_name, int norm)
{
m_feature_name = std::string(feature_name);
m_feature_name = cv::String(feature_name);
CvRect roi = cvGetImageROI(frontal);
m_center = rect_center(roi);
@@ -482,7 +482,7 @@ namespace cv{
Initialize(pose_count, frontal, feature_name, 1);
return;
}
m_feature_name = std::string(feature_name);
m_feature_name = cv::String(feature_name);
CvRect roi = cvGetImageROI(frontal);
m_center = rect_center(roi);
@@ -1287,8 +1287,8 @@ namespace cv{
}
OneWayDescriptorBase::OneWayDescriptorBase(CvSize patch_size, int pose_count, const std::string &pca_filename,
const std::string &train_path, const std::string &images_list, float _scale_min, float _scale_max,
OneWayDescriptorBase::OneWayDescriptorBase(CvSize patch_size, int pose_count, const cv::String &pca_filename,
const cv::String &train_path, const cv::String &images_list, float _scale_min, float _scale_max,
float _scale_step, int pyr_levels,
int pca_dim_high, int pca_dim_low)
: m_pca_dim_high(pca_dim_high), m_pca_dim_low(pca_dim_low), scale_min(_scale_min), scale_max(_scale_max), scale_step(_scale_step)
@@ -2080,8 +2080,8 @@ namespace cv{
m_part_id = 0;
}
OneWayDescriptorObject::OneWayDescriptorObject(CvSize patch_size, int pose_count, const std::string &pca_filename,
const std::string &train_path, const std::string &images_list, float _scale_min, float _scale_max, float _scale_step, int pyr_levels) :
OneWayDescriptorObject::OneWayDescriptorObject(CvSize patch_size, int pose_count, const cv::String &pca_filename,
const cv::String &train_path, const cv::String &images_list, float _scale_min, float _scale_max, float _scale_step, int pyr_levels) :
OneWayDescriptorBase(patch_size, pose_count, pca_filename, train_path, images_list, _scale_min, _scale_max, _scale_step, pyr_levels)
{
m_part_id = 0;
@@ -2145,7 +2145,7 @@ namespace cv{
void readPCAFeatures(const FileNode &fn, CvMat** avg, CvMat** eigenvectors, const char* postfix)
{
std::string str = std::string ("avg") + postfix;
cv::String str = cv::String ("avg") + postfix;
CvMat* _avg = reinterpret_cast<CvMat*> (fn[str].readObj());
if (_avg != 0)
{
@@ -2153,7 +2153,7 @@ namespace cv{
cvReleaseMat(&_avg);
}
str = std::string ("eigenvectors") + postfix;
str = cv::String ("eigenvectors") + postfix;
CvMat* _eigenvectors = reinterpret_cast<CvMat*> (fn[str].readObj());
if (_eigenvectors != 0)
{
@@ -2166,8 +2166,8 @@ namespace cv{
* OneWayDescriptorMatcher *
\****************************************************************************************/
OneWayDescriptorMatcher::Params::Params( int _poseCount, Size _patchSize, std::string _pcaFilename,
std::string _trainPath, std::string _trainImagesList,
OneWayDescriptorMatcher::Params::Params( int _poseCount, Size _patchSize, cv::String _pcaFilename,
cv::String _trainPath, cv::String _trainImagesList,
float _minScale, float _maxScale, float _stepScale ) :
poseCount(_poseCount), patchSize(_patchSize), pcaFilename(_pcaFilename),
trainPath(_trainPath), trainImagesList(_trainImagesList),
@@ -2271,7 +2271,7 @@ namespace cv{
void OneWayDescriptorMatcher::read( const FileNode &fn )
{
base = new OneWayDescriptorObject( params.patchSize, params.poseCount, std::string (), std::string (), std::string (),
base = new OneWayDescriptorObject( params.patchSize, params.poseCount, cv::String (), cv::String (), cv::String (),
params.minScale, params.maxScale, params.stepScale );
base->Read (fn);
}

View File

@@ -617,7 +617,7 @@ void LDetector::read(const FileNode& objnode)
clusteringDistance = (int)objnode["clustering-distance"];
}
void LDetector::write(FileStorage& fs, const std::string& name) const
void LDetector::write(FileStorage& fs, const cv::String& name) const
{
WriteStructContext ws(fs, name, CV_NODE_MAP);
@@ -707,7 +707,7 @@ FernClassifier::FernClassifier(const std::vector<std::vector<Point2f> >& points,
}
void FernClassifier::write(FileStorage& fs, const std::string& objname) const
void FernClassifier::write(FileStorage& fs, const cv::String& objname) const
{
WriteStructContext ws(fs, objname, CV_NODE_MAP);
@@ -1228,7 +1228,7 @@ nstructs(_nstructs), structSize(_structSize), nviews(_nviews),
compressionMethod(_compressionMethod), patchGenerator(_patchGenerator)
{}
FernDescriptorMatcher::Params::Params( const std::string& _filename )
FernDescriptorMatcher::Params::Params( const cv::String& _filename )
{
filename = _filename;
}
@@ -1476,7 +1476,7 @@ void PlanarObjectDetector::read(const FileNode& node)
}
void PlanarObjectDetector::write(FileStorage& fs, const std::string& objname) const
void PlanarObjectDetector::write(FileStorage& fs, const cv::String& objname) const
{
WriteStructContext ws(fs, objname, CV_NODE_MAP);

View File

@@ -593,10 +593,10 @@ int CV_StereoMatchingTest::readDatasetsParams( FileStorage& fs )
assert(fn.isSeq());
for( int i = 0; i < (int)fn.size(); i+=3 )
{
string nm = fn[i];
String nm = fn[i];
DatasetParams params;
string sf = fn[i+1]; params.dispScaleFactor = atoi(sf.c_str());
string uv = fn[i+2]; params.dispUnknVal = atoi(uv.c_str());
String sf = fn[i+1]; params.dispScaleFactor = atoi(sf.c_str());
String uv = fn[i+2]; params.dispUnknVal = atoi(uv.c_str());
datasetsParams[nm] = params;
}
return cvtest::TS::OK;
@@ -684,10 +684,10 @@ protected:
assert(fn.isSeq());
for( int i = 0; i < (int)fn.size(); i+=4 )
{
string caseName = fn[i], datasetName = fn[i+1];
String caseName = fn[i], datasetName = fn[i+1];
RunParams params;
string ndisp = fn[i+2]; params.ndisp = atoi(ndisp.c_str());
string iterCount = fn[i+3]; params.iterCount = atoi(iterCount.c_str());
String ndisp = fn[i+2]; params.ndisp = atoi(ndisp.c_str());
String iterCount = fn[i+3]; params.iterCount = atoi(iterCount.c_str());
caseNames.push_back( caseName );
caseDatasets.push_back( datasetName );
caseRunParams.push_back( params );