Merge pull request #695 from taka-no-me/cv_str

cv::String to replace the std::string
This commit is contained in:
Andrey Kamaev
2013-03-25 03:24:42 -07:00
182 changed files with 2132 additions and 1470 deletions

View File

@@ -33,7 +33,7 @@ Abstract base class for computing descriptors for image keypoints. ::
virtual int descriptorSize() const = 0;
virtual int descriptorType() const = 0;
static Ptr<DescriptorExtractor> create( const string& descriptorExtractorType );
static Ptr<DescriptorExtractor> create( const String& descriptorExtractorType );
protected:
...
@@ -70,7 +70,7 @@ DescriptorExtractor::create
-------------------------------
Creates a descriptor extractor by name.
.. ocv:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string& descriptorExtractorType )
.. ocv:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const String& descriptorExtractorType )
:param descriptorExtractorType: Descriptor extractor type.

View File

@@ -88,7 +88,7 @@ with an image set. ::
virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
static Ptr<DescriptorMatcher> create( const string& descriptorMatcherType );
static Ptr<DescriptorMatcher> create( const String& descriptorMatcherType );
protected:
vector<Mat> trainDescCollection;
@@ -237,7 +237,7 @@ DescriptorMatcher::create
-----------------------------
Creates a descriptor matcher of a given type with the default parameters (using default constructor).
.. ocv:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string& descriptorMatcherType )
.. ocv:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const String& descriptorMatcherType )
:param descriptorMatcherType: Descriptor matcher type. Now the following matcher types are supported:

View File

@@ -88,7 +88,7 @@ Abstract base class for 2D image feature detectors. ::
virtual void read(const FileNode&);
virtual void write(FileStorage&) const;
static Ptr<FeatureDetector> create( const string& detectorType );
static Ptr<FeatureDetector> create( const String& detectorType );
protected:
...
@@ -116,7 +116,7 @@ FeatureDetector::create
-----------------------
Creates a feature detector by its name.
.. ocv:function:: Ptr<FeatureDetector> FeatureDetector::create( const string& detectorType )
.. ocv:function:: Ptr<FeatureDetector> FeatureDetector::create( const String& detectorType )
:param detectorType: Feature detector type.
@@ -439,7 +439,7 @@ Class providing an interface for adjusting parameters of a feature detector. Thi
virtual void tooMany(int max, int n_detected) = 0;
virtual bool good() const = 0;
virtual Ptr<AdjusterAdapter> clone() const = 0;
static Ptr<AdjusterAdapter> create( const string& detectorType );
static Ptr<AdjusterAdapter> create( const String& detectorType );
};
@@ -500,7 +500,7 @@ AdjusterAdapter::create
-----------------------
Creates an adjuster adapter by name
.. ocv:function:: Ptr<AdjusterAdapter> AdjusterAdapter::create( const string& detectorType )
.. ocv:function:: Ptr<AdjusterAdapter> AdjusterAdapter::create( const String& detectorType )
Creates an adjuster adapter by name ``detectorType``. The detector name is the same as in :ocv:func:`FeatureDetector::create`, but now supports ``"FAST"``, ``"STAR"``, and ``"SURF"`` only.

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 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 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 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 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 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 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 String& genericDescritptorMatcherType,
const String &paramsFilename=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 String& descriptorExtractorType)
{
if( descriptorExtractorType.find("Opponent") == 0 )
{
size_t pos = std::string("Opponent").size();
std::string type = descriptorExtractorType.substr(pos);
size_t pos = String("Opponent").size();
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 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 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 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 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 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"];
String _name = (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, (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"];
String _name = (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, (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<String> names;
std::vector<int> types;
std::vector<std::string> strValues;
std::vector<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<String> names;
std::vector<int> types;
std::vector<std::string> strValues;
std::vector<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 String& genericDescritptorMatcherType,
const String &paramsFilename )
{
Ptr<GenericDescriptorMatcher> descriptorMatcher =
Algorithm::create<GenericDescriptorMatcher>("DescriptorMatcher." + genericDescritptorMatcherType);