@@ -99,7 +99,8 @@ CUDA_TEST_P(CUDA_SURF, Detector)
99
99
std::vector<cv::KeyPoint> keypoints_gold;
100
100
surf_gold->detect (image, keypoints_gold);
101
101
102
- ASSERT_EQ (keypoints_gold.size (), keypoints.size ());
102
+ int lengthDiff = abs ((int )keypoints_gold.size ()) - ((int )keypoints.size ());
103
+ EXPECT_LE (lengthDiff, 1 );
103
104
int matchedCount = getMatchedPointsCount (keypoints_gold, keypoints);
104
105
double matchedRatio = static_cast <double >(matchedCount) / keypoints_gold.size ();
105
106
@@ -130,7 +131,8 @@ CUDA_TEST_P(CUDA_SURF, Detector_Masked)
130
131
std::vector<cv::KeyPoint> keypoints_gold;
131
132
surf_gold->detect (image, keypoints_gold, mask);
132
133
133
- ASSERT_EQ (keypoints_gold.size (), keypoints.size ());
134
+ int lengthDiff = abs ((int )keypoints_gold.size ()) - ((int )keypoints.size ());
135
+ EXPECT_LE (lengthDiff, 1 );
134
136
int matchedCount = getMatchedPointsCount (keypoints_gold, keypoints);
135
137
double matchedRatio = static_cast <double >(matchedCount) / keypoints_gold.size ();
136
138
@@ -171,19 +173,11 @@ CUDA_TEST_P(CUDA_SURF, Descriptor)
171
173
EXPECT_GT (matchedRatio, 0.6 );
172
174
}
173
175
174
- #if defined (__x86_64__) || defined (_M_X64)
175
176
testing::internal::ValueArray3<SURF_HessianThreshold, SURF_HessianThreshold, SURF_HessianThreshold> thresholdValues =
176
177
testing::Values (
177
178
SURF_HessianThreshold (100.0 ),
178
179
SURF_HessianThreshold(500.0 ),
179
180
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
187
181
188
182
INSTANTIATE_TEST_CASE_P (CUDA_Features2D, CUDA_SURF, testing::Combine(
189
183
thresholdValues,
0 commit comments