void CirclesGridClusterFinder::parsePatternPoints(const std::vector<cv::Point2f> &patternPoints, const std::vector<cv::Point2f> &rectifiedPatternPoints, std::vector<cv::Point2f> ¢ers)
{
+#ifndef HAVE_OPENCV_FLANN
+ (void)patternPoints;
+ (void)rectifiedPatternPoints;
+ (void)centers;
+ CV_Error(Error::StsNotImplemented, "The desired functionality requires flann module, which was disabled.");
+#else
flann::LinearIndexParams flannIndexParams;
flann::Index flannIndex(Mat(rectifiedPatternPoints).reshape(1), flannIndexParams);
}
}
}
+#endif
}
Graph::Graph(size_t n)
TEST(Calib3d_ChessboardDetector, accuracy) { CV_ChessboardDetectorTest test( CHESSBOARD ); test.safe_run(); }
TEST(Calib3d_CirclesPatternDetector, accuracy) { CV_ChessboardDetectorTest test( CIRCLES_GRID ); test.safe_run(); }
TEST(Calib3d_AsymmetricCirclesPatternDetector, accuracy) { CV_ChessboardDetectorTest test( ASYMMETRIC_CIRCLES_GRID ); test.safe_run(); }
+#ifdef HAVE_OPENCV_FLANN
TEST(Calib3d_AsymmetricCirclesPatternDetectorWithClustering, accuracy) { CV_ChessboardDetectorTest test( ASYMMETRIC_CIRCLES_GRID, CALIB_CB_CLUSTERING ); test.safe_run(); }
+#endif
/* End of file. */
set(the_description "2D Features Framework")
-ocv_define_module(features2d opencv_imgproc opencv_flann OPTIONAL opencv_highgui WRAP java python)
+ocv_define_module(features2d opencv_imgproc OPTIONAL opencv_flann opencv_highgui WRAP java python)
#ifndef OPENCV_FEATURES_2D_HPP
#define OPENCV_FEATURES_2D_HPP
+#include "opencv2/opencv_modules.hpp"
#include "opencv2/core.hpp"
+
+#ifdef HAVE_OPENCV_FLANN
#include "opencv2/flann/miniflann.hpp"
+#endif
/**
@defgroup features2d 2D Features Framework
bool crossCheck;
};
+#if defined(HAVE_OPENCV_FLANN) || defined(CV_DOXYGEN)
/** @brief Flann-based descriptor matcher.
int addedDescCount;
};
+#endif
+
//! @} features2d_match
/****************************************************************************************\
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
}
switch(matcherType)
{
+#ifdef HAVE_OPENCV_FLANN
case FLANNBASED:
name = "FlannBased";
break;
+#endif
case BRUTEFORCE:
name = "BruteForce";
break;
}
+#ifdef HAVE_OPENCV_FLANN
/*
* Flann based matcher
convertToDMatches( mergedDescriptors, indices, dists, matches );
}
+
+#endif
+
}
test.safe_run();
}
+#ifdef HAVE_OPENCV_FLANN
TEST( Features2d_DescriptorMatcher_FlannBased, regression )
{
CV_DescriptorMatcherTest test( "descriptor-matcher-flann-based",
DescriptorMatcher::create("FlannBased"), 0.04f );
test.safe_run();
}
+#endif
TEST( Features2d_DMatch, read_write )
{
using namespace std;
using namespace cv;
+#ifdef HAVE_OPENCV_FLANN
using namespace cv::flann;
+#endif
//--------------------------------------------------------------------------------
class NearestNeighborTest : public cvtest::BaseTest
}
//--------------------------------------------------------------------------------
+#ifdef HAVE_OPENCV_FLANN
+
class CV_FlannTest : public NearestNeighborTest
{
public:
TEST(Features2d_FLANN_Composite, regression) { CV_FlannCompositeIndexTest test; test.safe_run(); }
TEST(Features2d_FLANN_Auto, regression) { CV_FlannAutotunedIndexTest test; test.safe_run(); }
TEST(Features2d_FLANN_Saved, regression) { CV_FlannSavedIndexTest test; test.safe_run(); }
+
+#endif
if(BUILD_SHARED_LIBS AND BUILD_opencv_world AND OPENCV_WORLD_EXCLUDE_EXTRA_MODULES)
set(STITCHING_CONTRIB_DEPS "")
endif()
-ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d
+ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_flann
OPTIONAL opencv_cudaarithm opencv_cudawarping opencv_cudafeatures2d opencv_cudalegacy ${STITCHING_CONTRIB_DEPS}
WRAP python)