made flann dependency for features2d optional
it will allow to build features2d even if flann module is not available
This commit is contained in:
@@ -1005,11 +1005,14 @@ void BFMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vector<std::
|
||||
Ptr<DescriptorMatcher> DescriptorMatcher::create( const String& descriptorMatcherType )
|
||||
{
|
||||
Ptr<DescriptorMatcher> dm;
|
||||
#ifdef HAVE_OPENCV_FLANN
|
||||
if( !descriptorMatcherType.compare( "FlannBased" ) )
|
||||
{
|
||||
dm = makePtr<FlannBasedMatcher>();
|
||||
}
|
||||
else if( !descriptorMatcherType.compare( "BruteForce" ) ) // L2
|
||||
else
|
||||
#endif
|
||||
if( !descriptorMatcherType.compare( "BruteForce" ) ) // L2
|
||||
{
|
||||
dm = makePtr<BFMatcher>(int(NORM_L2)); // anonymous enums can't be template parameters
|
||||
}
|
||||
@@ -1044,9 +1047,11 @@ Ptr<DescriptorMatcher> DescriptorMatcher::create(int matcherType)
|
||||
|
||||
switch(matcherType)
|
||||
{
|
||||
#ifdef HAVE_OPENCV_FLANN
|
||||
case FLANNBASED:
|
||||
name = "FlannBased";
|
||||
break;
|
||||
#endif
|
||||
case BRUTEFORCE:
|
||||
name = "BruteForce";
|
||||
break;
|
||||
@@ -1071,6 +1076,7 @@ Ptr<DescriptorMatcher> DescriptorMatcher::create(int matcherType)
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCV_FLANN
|
||||
|
||||
/*
|
||||
* Flann based matcher
|
||||
@@ -1419,4 +1425,7 @@ void FlannBasedMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vect
|
||||
|
||||
convertToDMatches( mergedDescriptors, indices, dists, matches );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user