Java wrapper is adapted for cv::String

This commit is contained in:
Andrey Kamaev
2013-03-20 20:46:22 +04:00
parent 707d3e0a62
commit 688d170de7
3 changed files with 40 additions and 38 deletions

View File

@@ -84,7 +84,7 @@ public:
//not supported: SimpleBlob, Dense
CV_WRAP static javaFeatureDetector* create( int detectorType )
{
std::string name;
cv::String name;
if (detectorType > DYNAMICDETECTOR)
{
name = "Dynamic";
@@ -104,37 +104,37 @@ public:
switch(detectorType)
{
case FAST:
name += "FAST";
name = name + "FAST";
break;
case STAR:
name += "STAR";
name = name + "STAR";
break;
case SIFT:
name += "SIFT";
name = name + "SIFT";
break;
case SURF:
name += "SURF";
name = name + "SURF";
break;
case ORB:
name += "ORB";
name = name + "ORB";
break;
case MSER:
name += "MSER";
name = name + "MSER";
break;
case GFTT:
name += "GFTT";
name = name + "GFTT";
break;
case HARRIS:
name += "HARRIS";
name = name + "HARRIS";
break;
case SIMPLEBLOB:
name += "SimpleBlob";
name = name + "SimpleBlob";
break;
case DENSE:
name += "Dense";
name = name + "Dense";
break;
case BRISK:
name += "BRISK";
name = name + "BRISK";
break;
default:
CV_Error( CV_StsBadArg, "Specified feature detector type is not supported." );
@@ -146,14 +146,14 @@ public:
return (javaFeatureDetector*)((FeatureDetector*) detector);
}
CV_WRAP void write( const std::string& fileName ) const
CV_WRAP void write( const cv::String& fileName ) const
{
FileStorage fs(fileName, FileStorage::WRITE);
((FeatureDetector*)this)->write(fs);
fs.release();
}
CV_WRAP void read( const std::string& fileName )
CV_WRAP void read( const cv::String& fileName )
{
FileStorage fs(fileName, FileStorage::READ);
((FeatureDetector*)this)->read(fs.root());
@@ -208,7 +208,7 @@ public:
//supported: FlannBased, BruteForce, BruteForce-L1, BruteForce-Hamming, BruteForce-HammingLUT
CV_WRAP static javaDescriptorMatcher* create( int matcherType )
{
std::string name;
cv::String name;
switch(matcherType)
{
@@ -240,14 +240,14 @@ public:
return (javaDescriptorMatcher*)((DescriptorMatcher*) matcher);
}
CV_WRAP void write( const std::string& fileName ) const
CV_WRAP void write( const cv::String& fileName ) const
{
FileStorage fs(fileName, FileStorage::WRITE);
((DescriptorMatcher*)this)->write(fs);
fs.release();
}
CV_WRAP void read( const std::string& fileName )
CV_WRAP void read( const cv::String& fileName )
{
FileStorage fs(fileName, FileStorage::READ);
((DescriptorMatcher*)this)->read(fs.root());
@@ -294,7 +294,7 @@ public:
//not supported: Calonder
CV_WRAP static javaDescriptorExtractor* create( int extractorType )
{
std::string name;
cv::String name;
if (extractorType > OPPONENTEXTRACTOR)
{
@@ -305,22 +305,22 @@ public:
switch(extractorType)
{
case SIFT:
name += "SIFT";
name = name + "SIFT";
break;
case SURF:
name += "SURF";
name = name + "SURF";
break;
case ORB:
name += "ORB";
name = name + "ORB";
break;
case BRIEF:
name += "BRIEF";
name = name + "BRIEF";
break;
case BRISK:
name += "BRISK";
name = name + "BRISK";
break;
case FREAK:
name += "FREAK";
name = name + "FREAK";
break;
default:
CV_Error( CV_StsBadArg, "Specified descriptor extractor type is not supported." );
@@ -332,14 +332,14 @@ public:
return (javaDescriptorExtractor*)((DescriptorExtractor*) extractor);
}
CV_WRAP void write( const std::string& fileName ) const
CV_WRAP void write( const cv::String& fileName ) const
{
FileStorage fs(fileName, FileStorage::WRITE);
((DescriptorExtractor*)this)->write(fs);
fs.release();
}
CV_WRAP void read( const std::string& fileName )
CV_WRAP void read( const cv::String& fileName )
{
FileStorage fs(fileName, FileStorage::READ);
((DescriptorExtractor*)this)->read(fs.root());
@@ -401,7 +401,7 @@ public:
//unsupported: Vector
CV_WRAP static javaGenericDescriptorMatcher* create( int matcherType )
{
std::string name;
cv::String name;
switch(matcherType)
{
@@ -421,14 +421,14 @@ public:
return (javaGenericDescriptorMatcher*)((GenericDescriptorMatcher*) matcher);
}
CV_WRAP void write( const std::string& fileName ) const
CV_WRAP void write( const cv::String& fileName ) const
{
FileStorage fs(fileName, FileStorage::WRITE);
((GenericDescriptorMatcher*)this)->write(fs);
fs.release();
}
CV_WRAP void read( const std::string& fileName )
CV_WRAP void read( const cv::String& fileName )
{
FileStorage fs(fileName, FileStorage::READ);
((GenericDescriptorMatcher*)this)->read(fs.root());