@@ -99,7 +99,8 @@ CUDA_TEST_P(CUDA_SURF, Detector)
9999 std::vector<cv::KeyPoint> keypoints_gold;
100100 surf_gold->detect (image, keypoints_gold);
101101
102- ASSERT_EQ (keypoints_gold.size (), keypoints.size ());
102+ int lengthDiff = abs ((int )keypoints_gold.size ()) - ((int )keypoints.size ());
103+ EXPECT_LE (lengthDiff, 1 );
103104 int matchedCount = getMatchedPointsCount (keypoints_gold, keypoints);
104105 double matchedRatio = static_cast <double >(matchedCount) / keypoints_gold.size ();
105106
@@ -130,7 +131,8 @@ CUDA_TEST_P(CUDA_SURF, Detector_Masked)
130131 std::vector<cv::KeyPoint> keypoints_gold;
131132 surf_gold->detect (image, keypoints_gold, mask);
132133
133- ASSERT_EQ (keypoints_gold.size (), keypoints.size ());
134+ int lengthDiff = abs ((int )keypoints_gold.size ()) - ((int )keypoints.size ());
135+ EXPECT_LE (lengthDiff, 1 );
134136 int matchedCount = getMatchedPointsCount (keypoints_gold, keypoints);
135137 double matchedRatio = static_cast <double >(matchedCount) / keypoints_gold.size ();
136138
@@ -171,19 +173,11 @@ CUDA_TEST_P(CUDA_SURF, Descriptor)
171173 EXPECT_GT (matchedRatio, 0.6 );
172174}
173175
174- #if defined (__x86_64__) || defined (_M_X64)
175176testing::internal::ValueArray3<SURF_HessianThreshold, SURF_HessianThreshold, SURF_HessianThreshold> thresholdValues =
176177 testing::Values (
177178 SURF_HessianThreshold (100.0 ),
178179 SURF_HessianThreshold(500.0 ),
179180 SURF_HessianThreshold(1000.0 ));
180- #else
181- // hessian computation is not bit-exact and lower threshold causes different count of detection
182- testing::internal::ValueArray2<SURF_HessianThreshold, SURF_HessianThreshold> thresholdValues =
183- testing::Values (
184- SURF_HessianThreshold (830.0 ),
185- SURF_HessianThreshold(1000.0 ));
186- #endif
187181
188182INSTANTIATE_TEST_CASE_P (CUDA_Features2D, CUDA_SURF, testing::Combine(
189183 thresholdValues,
0 commit comments