@@ -86,6 +86,15 @@ TEST(FastBilateralSolverTest, SplatSurfaceAccuracy)
86
86
}
87
87
}
88
88
89
+ #define COUNT_EXCEED (MAT1, MAT2, THRESHOLD, PIXEL_COUNT ) \
90
+ { \
91
+ Mat diff, count; \
92
+ absdiff (MAT1.reshape (1 ), MAT2.reshape (1 ), diff); \
93
+ cvtest::compare (diff, THRESHOLD, count, CMP_GT); \
94
+ PIXEL_COUNT = countNonZero (count.reshape (1 )); \
95
+ PIXEL_COUNT /= MAT1.channels (); \
96
+ }
97
+
89
98
TEST (FastBilateralSolverTest, ReferenceAccuracy)
90
99
{
91
100
string dir = getDataDir () + " cv/edgefilter" ;
@@ -104,7 +113,14 @@ TEST(FastBilateralSolverTest, ReferenceAccuracy)
104
113
double totalMaxError = 1.0 /64.0 *src.total ()*src.channels ();
105
114
106
115
EXPECT_LE (cvtest::norm (res, ref, NORM_L2), totalMaxError);
116
+ #if defined (__x86_64__) || defined (_M_X64)
107
117
EXPECT_LE (cvtest::norm (res, ref, NORM_INF), 1 );
118
+ #else
119
+ // fastBilateralSolverFilter is not bit-exact
120
+ int pixelCount = 0 ;
121
+ COUNT_EXCEED (res, ref, 2 , pixelCount);
122
+ EXPECT_LE (pixelCount, (int )(res.cols *res.rows *1 /100 ));
123
+ #endif
108
124
}
109
125
110
126
INSTANTIATE_TEST_CASE_P (FullSet, FastBilateralSolverTest,Combine(Values(szODD, szQVGA), SrcTypes::all(), GuideTypes::all()));
0 commit comments