Changed VectorDescriptorMatch interface to add factory capabilities and changed factory functions interface (return smart pointer)

This commit is contained in:
Alexander Shishkov
2010-07-12 11:56:11 +00:00
parent c3eb7881f1
commit fd16d49d85
4 changed files with 14 additions and 15 deletions

View File

@@ -228,7 +228,7 @@ void SurfDescriptorExtractor::write( FileStorage &fs ) const
fs << "extended" << surf.extended;
}
DescriptorExtractor* createDescriptorExtractor( const string& descriptorExtractorType )
Ptr<DescriptorExtractor> createDescriptorExtractor( const string& descriptorExtractorType )
{
DescriptorExtractor* de = 0;
if( !descriptorExtractorType.compare( "SIFT" ) )
@@ -251,7 +251,7 @@ DescriptorExtractor* createDescriptorExtractor( const string& descriptorExtracto
return de;
}
DescriptorMatcher* createDescriptorMatcher( const string& descriptorMatcherType )
Ptr<DescriptorMatcher> createDescriptorMatcher( const string& descriptorMatcherType )
{
DescriptorMatcher* dm = 0;
if( !descriptorMatcherType.compare( "BruteForce" ) )
@@ -394,7 +394,7 @@ void GenericDescriptorMatch::clear()
collection.clear();
}
GenericDescriptorMatch* createGenericDescriptorMatch( const string& genericDescritptorMatchType, const string &paramsFilename )
Ptr<GenericDescriptorMatch> createGenericDescriptorMatch( const string& genericDescritptorMatchType, const string &paramsFilename )
{
GenericDescriptorMatch *descriptorMatch = 0;
if( ! genericDescritptorMatchType.compare ("ONEWAY") )

View File

@@ -316,7 +316,7 @@ void SurfFeatureDetector::detectImpl( const Mat& image, const Mat& mask,
surf(image, mask, keypoints);
}
FeatureDetector* createDetector( const string& detectorType )
Ptr<FeatureDetector> createDetector( const string& detectorType )
{
FeatureDetector* fd = 0;
if( !detectorType.compare( "FAST" ) )