Compile opencv_test_core with cv::String instead of std::string

All tests passed!
This commit is contained in:
Andrey Kamaev
2013-03-20 17:53:13 +04:00
parent 14bb4cbe1e
commit 762aefd71b
51 changed files with 598 additions and 595 deletions

View File

@@ -109,7 +109,7 @@ public:
};
//! writes vector of keypoints to the file storage
CV_EXPORTS void write(FileStorage& fs, const std::string& name, const std::vector<KeyPoint>& keypoints);
CV_EXPORTS void write(FileStorage& fs, const cv::String& name, const std::vector<KeyPoint>& keypoints);
//! reads vector of keypoints from the specified file storage node
CV_EXPORTS void read(const FileNode& node, CV_OUT std::vector<KeyPoint>& keypoints);
@@ -179,7 +179,7 @@ public:
CV_WRAP virtual bool empty() const;
// Create feature detector by detector name.
CV_WRAP static Ptr<FeatureDetector> create( const std::string& detectorType );
CV_WRAP static Ptr<FeatureDetector> create( const cv::String& detectorType );
protected:
virtual void detectImpl( const Mat& image, std::vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const = 0;
@@ -229,7 +229,7 @@ public:
CV_WRAP virtual bool empty() const;
CV_WRAP static Ptr<DescriptorExtractor> create( const std::string& descriptorExtractorType );
CV_WRAP static Ptr<DescriptorExtractor> create( const cv::String& descriptorExtractorType );
protected:
virtual void computeImpl( const Mat& image, std::vector<KeyPoint>& keypoints, Mat& descriptors ) const = 0;
@@ -264,7 +264,7 @@ public:
bool useProvidedKeypoints=false ) const = 0;
// Create feature detector and descriptor extractor by name.
CV_WRAP static Ptr<Feature2D> create( const std::string& name );
CV_WRAP static Ptr<Feature2D> create( const cv::String& name );
};
/*!
@@ -765,7 +765,7 @@ public:
virtual Ptr<AdjusterAdapter> clone() const = 0;
static Ptr<AdjusterAdapter> create( const std::string& detectorType );
static Ptr<AdjusterAdapter> create( const cv::String& detectorType );
};
/** \brief an adaptively adjusting detector that iteratively detects until the desired number
* of features are detected.
@@ -1141,7 +1141,7 @@ public:
// but with empty train data.
virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
CV_WRAP static Ptr<DescriptorMatcher> create( const std::string& descriptorMatcherType );
CV_WRAP static Ptr<DescriptorMatcher> create( const cv::String& descriptorMatcherType );
protected:
/*
* Class to work with descriptors from several images as with one merged matrix.
@@ -1367,8 +1367,8 @@ public:
// but with empty train data.
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
static Ptr<GenericDescriptorMatcher> create( const std::string& genericDescritptorMatcherType,
const std::string &paramsFilename=std::string() );
static Ptr<GenericDescriptorMatcher> create( const cv::String& genericDescritptorMatcherType,
const cv::String &paramsFilename=cv::String() );
protected:
// In fact the matching is implemented only by the following two methods. These methods suppose

View File

@@ -92,12 +92,12 @@ void DescriptorExtractor::removeBorderKeypoints( std::vector<KeyPoint>& keypoint
KeyPointsFilter::runByImageBorder( keypoints, imageSize, borderSize );
}
Ptr<DescriptorExtractor> DescriptorExtractor::create(const std::string& descriptorExtractorType)
Ptr<DescriptorExtractor> DescriptorExtractor::create(const cv::String& descriptorExtractorType)
{
if( descriptorExtractorType.find("Opponent") == 0 )
{
size_t pos = std::string("Opponent").size();
std::string type = descriptorExtractorType.substr(pos);
size_t pos = cv::String("Opponent").size();
cv::String type = descriptorExtractorType.substr(pos);
return new OpponentColorDescriptorExtractor(DescriptorExtractor::create(type));
}

View File

@@ -86,7 +86,7 @@ void FeatureDetector::removeInvalidPoints( const Mat& mask, std::vector<KeyPoint
KeyPointsFilter::runByPixelsMask( keypoints, mask );
}
Ptr<FeatureDetector> FeatureDetector::create( const std::string& detectorType )
Ptr<FeatureDetector> FeatureDetector::create( const cv::String& detectorType )
{
if( detectorType.find("Grid") == 0 )
{

View File

@@ -199,7 +199,7 @@ Ptr<AdjusterAdapter> SurfAdjuster::clone() const
return cloned_obj;
}
Ptr<AdjusterAdapter> AdjusterAdapter::create( const std::string& detectorType )
Ptr<AdjusterAdapter> AdjusterAdapter::create( const cv::String& detectorType )
{
Ptr<AdjusterAdapter> adapter;

View File

@@ -44,7 +44,7 @@
using namespace cv;
Ptr<Feature2D> Feature2D::create( const std::string& feature2DType )
Ptr<Feature2D> Feature2D::create( const cv::String& feature2DType )
{
return Algorithm::create<Feature2D>("Feature2D." + feature2DType);
}

View File

@@ -58,7 +58,7 @@ size_t KeyPoint::hash() const
return _Val;
}
void write(FileStorage& fs, const std::string& objname, const std::vector<KeyPoint>& keypoints)
void write(FileStorage& fs, const cv::String& objname, const std::vector<KeyPoint>& keypoints)
{
WriteStructContext ws(fs, objname, CV_NODE_SEQ + CV_NODE_FLOW);

View File

@@ -456,7 +456,7 @@ void BFMatcher::radiusMatchImpl( const Mat& queryDescriptors, std::vector<std::v
/*
* Factory function for DescriptorMatcher creating
*/
Ptr<DescriptorMatcher> DescriptorMatcher::create( const std::string& descriptorMatcherType )
Ptr<DescriptorMatcher> DescriptorMatcher::create( const cv::String& descriptorMatcherType )
{
DescriptorMatcher* dm = 0;
if( !descriptorMatcherType.compare( "FlannBased" ) )
@@ -540,7 +540,7 @@ void FlannBasedMatcher::read( const FileNode& fn)
for(int i = 0; i < (int)ip.size(); ++i)
{
CV_Assert(ip[i].type() == FileNode::MAP);
std::string _name = (std::string)ip[i]["name"];
cv::String _name = (cv::String)ip[i]["name"];
int type = (int)ip[i]["type"];
switch(type)
@@ -559,7 +559,7 @@ void FlannBasedMatcher::read( const FileNode& fn)
indexParams->setDouble(_name, (double) ip[i]["value"]);
break;
case CV_USRTYPE1:
indexParams->setString(_name, (std::string) ip[i]["value"]);
indexParams->setString(_name, (cv::String) ip[i]["value"]);
break;
case CV_MAKETYPE(CV_USRTYPE1,2):
indexParams->setBool(_name, (int) ip[i]["value"] != 0);
@@ -579,7 +579,7 @@ void FlannBasedMatcher::read( const FileNode& fn)
for(int i = 0; i < (int)sp.size(); ++i)
{
CV_Assert(sp[i].type() == FileNode::MAP);
std::string _name = (std::string)sp[i]["name"];
cv::String _name = (cv::String)sp[i]["name"];
int type = (int)sp[i]["type"];
switch(type)
@@ -598,7 +598,7 @@ void FlannBasedMatcher::read( const FileNode& fn)
searchParams->setDouble(_name, (double) ip[i]["value"]);
break;
case CV_USRTYPE1:
searchParams->setString(_name, (std::string) ip[i]["value"]);
searchParams->setString(_name, (cv::String) ip[i]["value"]);
break;
case CV_MAKETYPE(CV_USRTYPE1,2):
searchParams->setBool(_name, (int) ip[i]["value"] != 0);
@@ -618,9 +618,9 @@ void FlannBasedMatcher::write( FileStorage& fs) const
if (indexParams)
{
std::vector<std::string> names;
std::vector<cv::String> names;
std::vector<int> types;
std::vector<std::string> strValues;
std::vector<cv::String> strValues;
std::vector<double> numValues;
indexParams->getAll(names, types, strValues, numValues);
@@ -669,9 +669,9 @@ void FlannBasedMatcher::write( FileStorage& fs) const
if (searchParams)
{
std::vector<std::string> names;
std::vector<cv::String> names;
std::vector<int> types;
std::vector<std::string> strValues;
std::vector<cv::String> strValues;
std::vector<double> numValues;
searchParams->getAll(names, types, strValues, numValues);
@@ -1060,8 +1060,8 @@ bool GenericDescriptorMatcher::empty() const
/*
* Factory function for GenericDescriptorMatch creating
*/
Ptr<GenericDescriptorMatcher> GenericDescriptorMatcher::create( const std::string& genericDescritptorMatcherType,
const std::string &paramsFilename )
Ptr<GenericDescriptorMatcher> GenericDescriptorMatcher::create( const cv::String& genericDescritptorMatcherType,
const cv::String &paramsFilename )
{
Ptr<GenericDescriptorMatcher> descriptorMatcher =
Algorithm::create<GenericDescriptorMatcher>("DescriptorMatcher." + genericDescritptorMatcherType);