Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion modules/xfeatures2d/test/test_surf.cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,22 @@ CUDA_TEST_P(CUDA_SURF, Descriptor)
EXPECT_GT(matchedRatio, 0.6);
}

#if defined (__x86_64__) || defined (_M_X64)
testing::internal::ValueArray3<SURF_HessianThreshold, SURF_HessianThreshold, SURF_HessianThreshold> thresholdValues =
testing::Values(
SURF_HessianThreshold(100.0),
SURF_HessianThreshold(500.0),
SURF_HessianThreshold(1000.0));
#else
// hessian computation is not bit-exact and lower threshold causes different count of detection
testing::internal::ValueArray2<SURF_HessianThreshold, SURF_HessianThreshold> thresholdValues =
testing::Values(
SURF_HessianThreshold(813.0),
SURF_HessianThreshold(1000.0));
#endif

INSTANTIATE_TEST_CASE_P(CUDA_Features2D, CUDA_SURF, testing::Combine(
testing::Values(SURF_HessianThreshold(100.0), SURF_HessianThreshold(500.0), SURF_HessianThreshold(1000.0)),
thresholdValues,
testing::Values(SURF_Octaves(3), SURF_Octaves(4)),
testing::Values(SURF_OctaveLayers(2), SURF_OctaveLayers(3)),
testing::Values(SURF_Extended(false), SURF_Extended(true)),
Expand Down
16 changes: 16 additions & 0 deletions modules/ximgproc/test/test_fbs_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ TEST(FastBilateralSolverTest, SplatSurfaceAccuracy)
}
}

#define COUNT_EXCEED(MAT1, MAT2, THRESHOLD, PIXEL_COUNT) \
{ \
Mat diff, count; \
absdiff(MAT1.reshape(1), MAT2.reshape(1), diff); \
cvtest::compare(diff, THRESHOLD, count, CMP_GT); \
PIXEL_COUNT = countNonZero(count.reshape(1)); \
PIXEL_COUNT /= MAT1.channels(); \
}

TEST(FastBilateralSolverTest, ReferenceAccuracy)
{
string dir = getDataDir() + "cv/edgefilter";
Expand All @@ -104,7 +113,14 @@ TEST(FastBilateralSolverTest, ReferenceAccuracy)
double totalMaxError = 1.0/64.0*src.total()*src.channels();

EXPECT_LE(cvtest::norm(res, ref, NORM_L2), totalMaxError);
#if defined (__x86_64__) || defined (_M_X64)
EXPECT_LE(cvtest::norm(res, ref, NORM_INF), 1);
#else
// fastBilateralSolverFilter is not bit-exact
int pixelCount = 0;
COUNT_EXCEED(res, ref, 2, pixelCount);
EXPECT_LE(pixelCount, (int)(res.cols*res.rows*1/100));
#endif
}

INSTANTIATE_TEST_CASE_P(FullSet, FastBilateralSolverTest,Combine(Values(szODD, szQVGA), SrcTypes::all(), GuideTypes::all()));
Expand Down