diff --git a/modules/features2d/test/test_rotation_and_scale_invariance.cpp b/modules/features2d/test/test_rotation_and_scale_invariance.cpp index c5aa1f7b6..73d351c52 100644 --- a/modules/features2d/test/test_rotation_and_scale_invariance.cpp +++ b/modules/features2d/test/test_rotation_and_scale_invariance.cpp @@ -108,7 +108,7 @@ void scaleKeyPoints(const vector& src, vector& dst, float sc { dst.resize(src.size()); for(size_t i = 0; i < src.size(); i++) - dst[i] = KeyPoint(src[i].pt.x * scale, src[i].pt.y * scale, src[i].size * scale); + dst[i] = KeyPoint(src[i].pt.x * scale, src[i].pt.y * scale, src[i].size * scale, src[i].angle); } static @@ -415,7 +415,7 @@ protected: if(keypoints0.size() < 15) CV_Error(CV_StsAssert, "Detector gives too few points in a test image\n"); - for(float scaleIdx = 1; scaleIdx <= 3; scaleIdx++) + for(int scaleIdx = 1; scaleIdx <= 3; scaleIdx++) { float scale = 1.f + scaleIdx * 0.5f; Mat image1; @@ -537,7 +537,7 @@ protected: descriptorExtractor->compute(image0, keypoints0, descriptors0); BFMatcher bfmatcher(normType); - for(float scaleIdx = 1; scaleIdx <= 3; scaleIdx++) + for(int scaleIdx = 1; scaleIdx <= 3; scaleIdx++) { float scale = 1.f + scaleIdx * 0.5f; diff --git a/modules/nonfree/test/test_rotation_and_scale_invariance.cpp b/modules/nonfree/test/test_rotation_and_scale_invariance.cpp index 4563d0513..9c099f892 100644 --- a/modules/nonfree/test/test_rotation_and_scale_invariance.cpp +++ b/modules/nonfree/test/test_rotation_and_scale_invariance.cpp @@ -108,7 +108,7 @@ void scaleKeyPoints(const vector& src, vector& dst, float sc { dst.resize(src.size()); for(size_t i = 0; i < src.size(); i++) - dst[i] = KeyPoint(src[i].pt.x * scale, src[i].pt.y * scale, src[i].size * scale); + dst[i] = KeyPoint(src[i].pt.x * scale, src[i].pt.y * scale, src[i].size * scale, src[i].angle); } static @@ -415,7 +415,7 @@ protected: if(keypoints0.size() < 15) CV_Error(CV_StsAssert, "Detector gives too few points in a test image\n"); - for(float scaleIdx = 1; scaleIdx <= 3; scaleIdx++) + for(int scaleIdx = 1; scaleIdx <= 3; scaleIdx++) { float scale = 1.f + scaleIdx * 0.5f; Mat image1; @@ -537,7 +537,7 @@ protected: descriptorExtractor->compute(image0, keypoints0, descriptors0); BFMatcher bfmatcher(normType); - for(float scaleIdx = 1; scaleIdx <= 3; scaleIdx++) + for(int scaleIdx = 1; scaleIdx <= 3; scaleIdx++) { float scale = 1.f + scaleIdx * 0.5f; @@ -654,17 +654,17 @@ TEST(Features2d_ScaleInvariance_Detector_SIFT, regression) TEST(Features2d_ScaleInvariance_Descriptor_SURF, regression) { DescriptorScaleInvarianceTest test(Algorithm::create("Feature2D.SURF"), - Algorithm::create("Feature2D.SURF"), - NORM_L1, - 0.61f); + Algorithm::create("Feature2D.SURF"), + NORM_L1, + 0.61f); test.safe_run(); } -//TEST(Features2d_ScaleInvariance_Descriptor_SIFT, regression) -//{ -// DescriptorScaleInvarianceTest test(Algorithm::create("Feature2D.SIFT"), -// Algorithm::create("Feature2D.SIFT"), -// NORM_L1, -// 0.14f); -// test.safe_run(); -//} +TEST(Features2d_ScaleInvariance_Descriptor_SIFT, regression) +{ + DescriptorScaleInvarianceTest test(Algorithm::create("Feature2D.SIFT"), + Algorithm::create("Feature2D.SIFT"), + NORM_L1, + 0.87f); + test.safe_run(); +}