cv::gpu::DeviceInfo devInfo;\r
int type;\r
bool useRoi;\r
- \r
- cv::Size size;\r
+\r
cv::Mat src;\r
- \r
+\r
cv::Mat dst_gold;\r
\r
virtual void SetUp()\r
\r
cv::RNG& rng = TS::ptr()->get_rng();\r
\r
- size = cv::Size(rng.uniform(100, 200), rng.uniform(100, 200));\r
+ cv::Size size(rng.uniform(100, 200), rng.uniform(100, 200));\r
\r
src = randomMat(rng, size, type, 0.0, 255.0, false);\r
\r
\r
d_dst.download(dst);\r
\r
- ASSERT_EQ(dst_gold.cols, dst.cols);\r
- ASSERT_EQ(dst_gold.rows, dst.rows);\r
- ASSERT_EQ(dst_gold.type(), dst.type());\r
- \r
- double err = crossCorr(dst_gold, dst) / (cv::norm(dst_gold, cv::NORM_L2) * cv::norm(dst, cv::NORM_L2));\r
- ASSERT_NEAR(err, 1., 1e-2);\r
+ EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-4 : 1.0);\r
}\r
\r
INSTANTIATE_TEST_CASE_P(ImgProc, PyrDown, Combine(\r
\r
d_dst.download(dst);\r
\r
- ASSERT_EQ(dst_gold.cols, dst.cols);\r
- ASSERT_EQ(dst_gold.rows, dst.rows);\r
- ASSERT_EQ(dst_gold.type(), dst.type());\r
-\r
- double err = cvtest::crossCorr(dst_gold, dst) / (cv::norm(dst_gold, cv::NORM_L2) * cv::norm(dst, cv::NORM_L2));\r
- ASSERT_NEAR(err, 1., 1e-2);\r
+ EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-4 : 1.0);\r
}\r
\r
INSTANTIATE_TEST_CASE_P(ImgProc, PyrUp, Combine(\r