Commit 0a8d9303 authored by Alexander Alekhin's avatar Alexander Alekhin

xfeatures2d(test): disable tests with required non-free code

parent 1e096c6c
...@@ -11,6 +11,7 @@ typedef perf::TestBaseWithParam<std::string> latch; ...@@ -11,6 +11,7 @@ typedef perf::TestBaseWithParam<std::string> latch;
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\ "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
"stitching/a3.png" "stitching/a3.png"
#ifdef OPENCV_ENABLE_NONFREE
PERF_TEST_P(latch, extract, testing::Values(LATCH_IMAGES)) PERF_TEST_P(latch, extract, testing::Values(LATCH_IMAGES))
{ {
string filename = getDataPath(GetParam()); string filename = getDataPath(GetParam());
...@@ -30,5 +31,6 @@ PERF_TEST_P(latch, extract, testing::Values(LATCH_IMAGES)) ...@@ -30,5 +31,6 @@ PERF_TEST_P(latch, extract, testing::Values(LATCH_IMAGES))
SANITY_CHECK_NOTHING(); SANITY_CHECK_NOTHING();
} }
#endif // NONFREE
}} // namespace }} // namespace
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// of this distribution and at http://opencv.org/license.html. // of this distribution and at http://opencv.org/license.html.
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
#ifdef OPENCV_ENABLE_NONFREE
namespace opencv_test { namespace { namespace opencv_test { namespace {
typedef perf::TestBaseWithParam<std::string> surf; typedef perf::TestBaseWithParam<std::string> surf;
...@@ -64,3 +65,4 @@ PERF_TEST_P(surf, full, testing::Values(SURF_IMAGES)) ...@@ -64,3 +65,4 @@ PERF_TEST_P(surf, full, testing::Values(SURF_IMAGES))
} }
}} // namespace }} // namespace
#endif // NONFREE
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
#ifdef HAVE_CUDA #if defined(HAVE_CUDA) && defined(OPENCV_ENABLE_NONFREE)
#include "opencv2/ts/cuda_perf.hpp" #include "opencv2/ts/cuda_perf.hpp"
...@@ -99,4 +99,4 @@ PERF_TEST_P(Image, CUDA_SURF, ...@@ -99,4 +99,4 @@ PERF_TEST_P(Image, CUDA_SURF,
#endif // HAVE_OPENCV_CUDAARITHM #endif // HAVE_OPENCV_CUDAARITHM
}} // namespace }} // namespace
#endif // HAVE_CUDA #endif // HAVE_CUDA && OPENCV_ENABLE_NONFREE
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
#ifdef HAVE_OPENCV_OCL #if defined(HAVE_OPENCV_OCL) && defined(OPENCV_ENABLE_NONFREE)
namespace opencv_test { namespace { namespace opencv_test { namespace {
...@@ -105,4 +105,4 @@ PERF_TEST_P(OCL_SURF, DISABLED_without_data_transfer, testing::Values(SURF_IMAGE ...@@ -105,4 +105,4 @@ PERF_TEST_P(OCL_SURF, DISABLED_without_data_transfer, testing::Values(SURF_IMAGE
} }
}} // namespace }} // namespace
#endif // HAVE_OPENCV_OCL #endif // HAVE_OPENCV_OCL && OPENCV_ENABLE_NONFREE
...@@ -278,12 +278,15 @@ void CV_DetectorsTest::run( int /*start_from*/ ) ...@@ -278,12 +278,15 @@ void CV_DetectorsTest::run( int /*start_from*/ )
GaussianBlur(to_test, to_test, Size(3, 3), 1.5); GaussianBlur(to_test, to_test, Size(3, 3), 1.5);
vector<KeyPoint> exp; vector<KeyPoint> exp;
#ifdef OPENCV_ENABLE_NONFREE
LoadExpected(string(ts->get_data_path()) + "detectors/surf.xml", exp); LoadExpected(string(ts->get_data_path()) + "detectors/surf.xml", exp);
if (exp.empty()) if (exp.empty())
return; return;
if (!testDetector(to_test, SURF::create(1536+512+512, 2, 2, true, false), exp)) if (!testDetector(to_test, SURF::create(1536+512+512, 2, 2, true, false), exp))
return; return;
#endif
LoadExpected(string(ts->get_data_path()) + "detectors/star.xml", exp); LoadExpected(string(ts->get_data_path()) + "detectors/star.xml", exp);
if (exp.empty()) if (exp.empty())
......
...@@ -987,7 +987,7 @@ void CV_DescriptorMatcherTest::run( int ) ...@@ -987,7 +987,7 @@ void CV_DescriptorMatcherTest::run( int )
* Detectors * Detectors
*/ */
#ifdef OPENCV_ENABLE_NONFREE
TEST( Features2d_Detector_SIFT, regression ) TEST( Features2d_Detector_SIFT, regression )
{ {
CV_FeatureDetectorTest test( "detector-sift", SIFT::create() ); CV_FeatureDetectorTest test( "detector-sift", SIFT::create() );
...@@ -999,6 +999,7 @@ TEST( Features2d_Detector_SURF, regression ) ...@@ -999,6 +999,7 @@ TEST( Features2d_Detector_SURF, regression )
CV_FeatureDetectorTest test( "detector-surf", SURF::create() ); CV_FeatureDetectorTest test( "detector-surf", SURF::create() );
test.safe_run(); test.safe_run();
} }
#endif
TEST( Features2d_Detector_STAR, regression ) TEST( Features2d_Detector_STAR, regression )
{ {
...@@ -1027,6 +1028,7 @@ TEST( Features2d_Detector_Harris_Laplace_Affine, regression ) ...@@ -1027,6 +1028,7 @@ TEST( Features2d_Detector_Harris_Laplace_Affine, regression )
/* /*
* Descriptors * Descriptors
*/ */
#ifdef OPENCV_ENABLE_NONFREE
TEST( Features2d_DescriptorExtractor_SIFT, regression ) TEST( Features2d_DescriptorExtractor_SIFT, regression )
{ {
CV_DescriptorExtractorTest<L1<float> > test( "descriptor-sift", 1.0f, CV_DescriptorExtractorTest<L1<float> > test( "descriptor-sift", 1.0f,
...@@ -1064,6 +1066,7 @@ TEST( Features2d_DescriptorExtractor_SURF_OCL, regression ) ...@@ -1064,6 +1066,7 @@ TEST( Features2d_DescriptorExtractor_SURF_OCL, regression )
cv::ocl::setUseOpenCL(useOCL); cv::ocl::setUseOpenCL(useOCL);
} }
#endif #endif
#endif // NONFREE
TEST( Features2d_DescriptorExtractor_DAISY, regression ) TEST( Features2d_DescriptorExtractor_DAISY, regression )
{ {
...@@ -1204,7 +1207,7 @@ TEST( Features2d_DescriptorExtractor_Calonder_float, regression ) ...@@ -1204,7 +1207,7 @@ TEST( Features2d_DescriptorExtractor_Calonder_float, regression )
test.safe_run(); test.safe_run();
} }
#endif*/ // CV_SSE2 #endif*/ // CV_SSE2
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression) TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression)
{ {
const int sz = 100; const int sz = 100;
...@@ -1254,6 +1257,7 @@ TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression) ...@@ -1254,6 +1257,7 @@ TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression)
} }
} }
} }
#endif
/*TEST(Features2d_DescriptorExtractorParamTest, regression) /*TEST(Features2d_DescriptorExtractorParamTest, regression)
{ {
...@@ -1330,8 +1334,10 @@ protected: ...@@ -1330,8 +1334,10 @@ protected:
Ptr<Feature2D> f2d; Ptr<Feature2D> f2d;
}; };
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_SIFTHomographyTest, regression) { CV_DetectPlanarTest test("SIFT", 80, SIFT::create()); test.safe_run(); } TEST(Features2d_SIFTHomographyTest, regression) { CV_DetectPlanarTest test("SIFT", 80, SIFT::create()); test.safe_run(); }
TEST(Features2d_SURFHomographyTest, regression) { CV_DetectPlanarTest test("SURF", 80, SURF::create()); test.safe_run(); } TEST(Features2d_SURFHomographyTest, regression) { CV_DetectPlanarTest test("SURF", 80, SURF::create()); test.safe_run(); }
#endif
class FeatureDetectorUsingMaskTest : public cvtest::BaseTest class FeatureDetectorUsingMaskTest : public cvtest::BaseTest
{ {
...@@ -1394,6 +1400,7 @@ protected: ...@@ -1394,6 +1400,7 @@ protected:
Ptr<FeatureDetector> featureDetector_; Ptr<FeatureDetector> featureDetector_;
}; };
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_SIFT_using_mask, regression) TEST(Features2d_SIFT_using_mask, regression)
{ {
FeatureDetectorUsingMaskTest test(SIFT::create()); FeatureDetectorUsingMaskTest test(SIFT::create());
...@@ -1433,5 +1440,6 @@ TEST( XFeatures2d_DescriptorExtractor, batch ) ...@@ -1433,5 +1440,6 @@ TEST( XFeatures2d_DescriptorExtractor, batch )
EXPECT_GT(descriptors[i].rows, 100); EXPECT_GT(descriptors[i].rows, 100);
} }
} }
#endif // NONFREE
}} // namespace }} // namespace
...@@ -115,7 +115,7 @@ protected: ...@@ -115,7 +115,7 @@ protected:
// Registration of tests // Registration of tests
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_Detector_Keypoints_SURF, validation) TEST(Features2d_Detector_Keypoints_SURF, validation)
{ {
CV_FeatureDetectorKeypointsTest test(xfeatures2d::SURF::create()); CV_FeatureDetectorKeypointsTest test(xfeatures2d::SURF::create());
...@@ -127,6 +127,8 @@ TEST(Features2d_Detector_Keypoints_SIFT, validation) ...@@ -127,6 +127,8 @@ TEST(Features2d_Detector_Keypoints_SIFT, validation)
CV_FeatureDetectorKeypointsTest test(xfeatures2d::SIFT::create()); CV_FeatureDetectorKeypointsTest test(xfeatures2d::SIFT::create());
test.safe_run(); test.safe_run();
} }
#endif // NONFREE
TEST(Features2d_Detector_Keypoints_Star, validation) TEST(Features2d_Detector_Keypoints_Star, validation)
{ {
......
...@@ -610,6 +610,7 @@ protected: ...@@ -610,6 +610,7 @@ protected:
/* /*
* Detector's rotation invariance check * Detector's rotation invariance check
*/ */
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_RotationInvariance_Detector_SURF, regression) TEST(Features2d_RotationInvariance_Detector_SURF, regression)
{ {
DetectorRotationInvarianceTest test(SURF::create(), DetectorRotationInvarianceTest test(SURF::create(),
...@@ -655,6 +656,7 @@ TEST(Features2d_RotationInvariance_Descriptor_LATCH, regression) ...@@ -655,6 +656,7 @@ TEST(Features2d_RotationInvariance_Descriptor_LATCH, regression)
0.9999f); 0.9999f);
test.safe_run(); test.safe_run();
} }
#endif // NONFREE
TEST(DISABLED_Features2d_RotationInvariance_Descriptor_DAISY, regression) TEST(DISABLED_Features2d_RotationInvariance_Descriptor_DAISY, regression)
{ {
...@@ -701,6 +703,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG48, regression) ...@@ -701,6 +703,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG48, regression)
test.safe_run(); test.safe_run();
} }
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_RotationInvariance_Descriptor_BRIEF_64, regression) TEST(Features2d_RotationInvariance_Descriptor_BRIEF_64, regression)
{ {
DescriptorRotationInvarianceTest test(SURF::create(), DescriptorRotationInvarianceTest test(SURF::create(),
...@@ -870,6 +873,8 @@ TEST(Features2d_RotationInvariance2_Detector_SURF, regression) ...@@ -870,6 +873,8 @@ TEST(Features2d_RotationInvariance2_Detector_SURF, regression)
} }
} }
#endif // NONFREE
TEST(DISABLED_Features2d_ScaleInvariance_Descriptor_DAISY, regression) TEST(DISABLED_Features2d_ScaleInvariance_Descriptor_DAISY, regression)
{ {
DescriptorScaleInvarianceTest test(BRISK::create(), DescriptorScaleInvarianceTest test(BRISK::create(),
...@@ -915,6 +920,7 @@ TEST(Features2d_ScaleInvariance_Descriptor_VGG48, regression) ...@@ -915,6 +920,7 @@ TEST(Features2d_ScaleInvariance_Descriptor_VGG48, regression)
test.safe_run(); test.safe_run();
} }
#ifdef OPENCV_ENABLE_NONFREE
TEST(Features2d_ScaleInvariance_Descriptor_BoostDesc_BGM, regression) TEST(Features2d_ScaleInvariance_Descriptor_BoostDesc_BGM, regression)
{ {
DescriptorScaleInvarianceTest test(SURF::create(), DescriptorScaleInvarianceTest test(SURF::create(),
...@@ -977,5 +983,6 @@ TEST(Features2d_ScaleInvariance_Descriptor_BoostDesc_BINBOOST_256, regression) ...@@ -977,5 +983,6 @@ TEST(Features2d_ScaleInvariance_Descriptor_BoostDesc_BINBOOST_256, regression)
0.98f); 0.98f);
test.safe_run(); test.safe_run();
} }
#endif // NONFREE
}} // namespace }} // namespace
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
#ifdef HAVE_CUDA #if defined(HAVE_CUDA) && defined(OPENCV_ENABLE_NONFREE)
namespace opencv_test { namespace { namespace opencv_test { namespace {
...@@ -181,4 +181,4 @@ INSTANTIATE_TEST_CASE_P(CUDA_Features2D, SURF, testing::Combine( ...@@ -181,4 +181,4 @@ INSTANTIATE_TEST_CASE_P(CUDA_Features2D, SURF, testing::Combine(
#endif // HAVE_OPENCV_CUDAARITHM #endif // HAVE_OPENCV_CUDAARITHM
}} // namespace }} // namespace
#endif // HAVE_CUDA #endif // HAVE_CUDA && OPENCV_ENABLE_NONFREE
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
#ifdef HAVE_OPENCL #if defined(HAVE_OPENCL) && defined(OPENCV_ENABLE_NONFREE)
namespace opencv_test { namespace { namespace opencv_test { namespace {
...@@ -200,4 +200,4 @@ INSTANTIATE_TEST_CASE_P(OCL_Features2D, SURF, testing::Combine( ...@@ -200,4 +200,4 @@ INSTANTIATE_TEST_CASE_P(OCL_Features2D, SURF, testing::Combine(
}} // namespace }} // namespace
#endif // HAVE_OPENCL #endif // HAVE_OPENCL && OPENCV_ENABLE_NONFREE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment