fix epsilons for several gpu tests

(cherry picked from commit 3e4bb371c8)
This commit is contained in:
Vladislav Vinogradov 2014-02-06 12:41:19 +04:00 committed by Alexander Smorkalov
parent 8bb26fa5de
commit cc73c7000f
3 changed files with 7 additions and 7 deletions

View File

@ -715,7 +715,7 @@ GPU_TEST_P(CvtColor, BGR2YCrCb)
cv::Mat dst_gold; cv::Mat dst_gold;
cv::cvtColor(src, dst_gold, cv::COLOR_BGR2YCrCb); cv::cvtColor(src, dst_gold, cv::COLOR_BGR2YCrCb);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0); EXPECT_MAT_NEAR(dst_gold, dst, depth == CV_32F ? 1e-2 : 1);
} }
GPU_TEST_P(CvtColor, RGB2YCrCb) GPU_TEST_P(CvtColor, RGB2YCrCb)
@ -728,7 +728,7 @@ GPU_TEST_P(CvtColor, RGB2YCrCb)
cv::Mat dst_gold; cv::Mat dst_gold;
cv::cvtColor(src, dst_gold, cv::COLOR_RGB2YCrCb); cv::cvtColor(src, dst_gold, cv::COLOR_RGB2YCrCb);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0); EXPECT_MAT_NEAR(dst_gold, dst, depth == CV_32F ? 1e-2 : 1);
} }
GPU_TEST_P(CvtColor, BGR2YCrCb4) GPU_TEST_P(CvtColor, BGR2YCrCb4)
@ -749,7 +749,7 @@ GPU_TEST_P(CvtColor, BGR2YCrCb4)
cv::split(h_dst, channels); cv::split(h_dst, channels);
cv::merge(channels, 3, h_dst); cv::merge(channels, 3, h_dst);
EXPECT_MAT_NEAR(dst_gold, h_dst, 1.0); EXPECT_MAT_NEAR(dst_gold, h_dst, depth == CV_32F ? 1e-2 : 1);
} }
GPU_TEST_P(CvtColor, RGBA2YCrCb4) GPU_TEST_P(CvtColor, RGBA2YCrCb4)
@ -771,7 +771,7 @@ GPU_TEST_P(CvtColor, RGBA2YCrCb4)
cv::split(h_dst, channels); cv::split(h_dst, channels);
cv::merge(channels, 3, h_dst); cv::merge(channels, 3, h_dst);
EXPECT_MAT_NEAR(dst_gold, h_dst, 1.0); EXPECT_MAT_NEAR(dst_gold, h_dst, depth == CV_32F ? 1e-2 : 1);
} }
GPU_TEST_P(CvtColor, YCrCb2BGR) GPU_TEST_P(CvtColor, YCrCb2BGR)

View File

@ -3582,7 +3582,7 @@ GPU_TEST_P(Normalize, WithOutMask)
cv::Mat dst_gold; cv::Mat dst_gold;
cv::normalize(src, dst_gold, alpha, beta, norm_type, type); cv::normalize(src, dst_gold, alpha, beta, norm_type, type);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0); EXPECT_MAT_NEAR(dst_gold, dst, type < CV_32F ? 1.0 : 1e-4);
} }
GPU_TEST_P(Normalize, WithMask) GPU_TEST_P(Normalize, WithMask)
@ -3598,7 +3598,7 @@ GPU_TEST_P(Normalize, WithMask)
dst_gold.setTo(cv::Scalar::all(0)); dst_gold.setTo(cv::Scalar::all(0));
cv::normalize(src, dst_gold, alpha, beta, norm_type, type, mask); cv::normalize(src, dst_gold, alpha, beta, norm_type, type, mask);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0); EXPECT_MAT_NEAR(dst_gold, dst, type < CV_32F ? 1.0 : 1e-4);
} }
INSTANTIATE_TEST_CASE_P(GPU_Core, Normalize, testing::Combine( INSTANTIATE_TEST_CASE_P(GPU_Core, Normalize, testing::Combine(

View File

@ -281,7 +281,7 @@ GPU_TEST_P(ConvertTo, WithOutScaling)
cv::Mat dst_gold; cv::Mat dst_gold;
src.convertTo(dst_gold, depth2); src.convertTo(dst_gold, depth2);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0); EXPECT_MAT_NEAR(dst_gold, dst, depth2 < CV_32F ? 1.0 : 1e-4);
} }
} }