#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, transpose, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_32SC1, CV_64FC1)))\r
+#ifdef HAVE_CUDA\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// Transpose\r
+\r
+GPU_PERF_TEST(Transpose, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size.width, size.height, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- transpose(src, dst);\r
+ cv::gpu::transpose(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, Transpose, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_32SC1, CV_64FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Flip\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_FlipCode, flip, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4), \r
- testing::Values((int)HORIZONTAL_AXIS, (int)VERTICAL_AXIS, (int)BOTH_AXIS)))\r
+GPU_PERF_TEST(Flip, cv::gpu::DeviceInfo, cv::Size, perf::MatType, FlipCode)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int flipCode = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int flipCode = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- flip(src, dst, flipCode);\r
+ cv::gpu::flip(src, dst, flipCode);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, Flip, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4),\r
+ testing::Values((int) HORIZONTAL_AXIS, (int) VERTICAL_AXIS, (int) BOTH_AXIS)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// LUT\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, LUT, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC3)))\r
+GPU_PERF_TEST(LUT, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
- Mat lut(1, 256, CV_8UC1);\r
+ cv::Mat src_host(size, type);\r
+ cv::Mat lut(1, 256, CV_8UC1);\r
\r
declare.in(src_host, lut, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- LUT(src, lut, dst);\r
+ cv::gpu::LUT(src, lut, dst);\r
}\r
-\r
- Mat dst_host(dst);\r
-\r
- SANITY_CHECK(dst_host);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size, cartToPolar, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
-{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
-\r
- setDevice(devInfo.deviceID());\r
-\r
- Mat x_host(size, CV_32FC1);\r
- Mat y_host(size, CV_32FC1);\r
-\r
- declare.in(x_host, y_host, WARMUP_RNG);\r
+INSTANTIATE_TEST_CASE_P(Arithm, LUT, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC3)));\r
\r
- GpuMat x(x_host);\r
- GpuMat y(y_host);\r
- GpuMat magnitude(size, CV_32FC1);\r
- GpuMat angle(size, CV_32FC1);\r
+//////////////////////////////////////////////////////////////////////\r
+// CartToPolar\r
\r
- TEST_CYCLE(100)\r
- {\r
- cartToPolar(x, y, magnitude, angle);\r
- }\r
-\r
- Mat magnitude_host(magnitude);\r
- Mat angle_host(angle);\r
-\r
- SANITY_CHECK(magnitude_host);\r
- SANITY_CHECK(angle_host);\r
-}\r
-\r
-PERF_TEST_P(DevInfo_Size, polarToCart, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(CartToPolar, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat magnitude_host(size, CV_32FC1);\r
- Mat angle_host(size, CV_32FC1);\r
+ cv::Mat x_host(size, CV_32FC1);\r
+ cv::Mat y_host(size, CV_32FC1);\r
\r
- declare.in(magnitude_host, angle_host, WARMUP_RNG);\r
+ fill(x_host, -100.0, 100.0);\r
+ fill(y_host, -100.0, 100.0);\r
\r
- GpuMat magnitude(magnitude_host);\r
- GpuMat angle(angle_host);\r
- GpuMat x(size, CV_32FC1);\r
- GpuMat y(size, CV_32FC1);\r
+ cv::gpu::GpuMat x(x_host);\r
+ cv::gpu::GpuMat y(y_host);\r
+ cv::gpu::GpuMat magnitude;\r
+ cv::gpu::GpuMat angle;\r
\r
TEST_CYCLE(100)\r
{\r
- polarToCart(magnitude, angle, x, y);\r
+ cv::gpu::cartToPolar(x, y, magnitude, angle);\r
}\r
-\r
- Mat x_host(x);\r
- Mat y_host(y);\r
-\r
- SANITY_CHECK(x_host);\r
- SANITY_CHECK(y_host);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, addMat, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1)))\r
-{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
-\r
- setDevice(devInfo.deviceID());\r
-\r
- Mat a_host(size, type);\r
- Mat b_host(size, type);\r
+INSTANTIATE_TEST_CASE_P(Arithm, CartToPolar, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- declare.in(a_host, b_host, WARMUP_RNG);\r
+//////////////////////////////////////////////////////////////////////\r
+// PolarToCart\r
\r
- GpuMat a(a_host);\r
- GpuMat b(b_host);\r
- GpuMat c(size, type);\r
-\r
- TEST_CYCLE(100)\r
- {\r
- add(a, b, c);\r
- }\r
-\r
- Mat c_host(c);\r
-\r
- SANITY_CHECK(c_host);\r
-}\r
-\r
-PERF_TEST_P(DevInfo_Size_MatType, addScalar, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_32FC1, CV_32FC2)))\r
+GPU_PERF_TEST(PolarToCart, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat a_host(size, type);\r
+ cv::Mat magnitude_host(size, CV_32FC1);\r
+ cv::Mat angle_host(size, CV_32FC1);\r
\r
- declare.in(a_host, WARMUP_RNG);\r
+ fill(magnitude_host, 0.0, 100.0);\r
+ fill(angle_host, 0.0, 360.0);\r
\r
- GpuMat a(a_host);\r
- Scalar b(1,2,3,4);\r
- GpuMat c(size, type);\r
+ cv::gpu::GpuMat magnitude(magnitude_host);\r
+ cv::gpu::GpuMat angle(angle_host);\r
+ cv::gpu::GpuMat x;\r
+ cv::gpu::GpuMat y;\r
\r
TEST_CYCLE(100)\r
{\r
- add(a, b, c);\r
+ cv::gpu::polarToCart(magnitude, angle, x, y, true);\r
}\r
-\r
- Mat c_host(c);\r
-\r
- SANITY_CHECK(c_host);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, subtractMat, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_16SC1, CV_32FC1)))\r
-{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
-\r
- setDevice(devInfo.deviceID());\r
+INSTANTIATE_TEST_CASE_P(Arithm, PolarToCart, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- Mat a_host(size, type);\r
- Mat b_host(size, type);\r
+//////////////////////////////////////////////////////////////////////\r
+// AddMat\r
\r
- declare.in(a_host, b_host, WARMUP_RNG);\r
-\r
- GpuMat a(a_host);\r
- GpuMat b(b_host);\r
- GpuMat c(size, type);\r
-\r
- TEST_CYCLE(100)\r
- {\r
- subtract(a, b, c);\r
- }\r
-\r
- Mat c_host(c);\r
-\r
- SANITY_CHECK(c_host);\r
-}\r
-\r
-PERF_TEST_P(DevInfo_Size, multiplyMat, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(AddMat, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat a_host(size, CV_8UC4);\r
- Mat b_host(size, CV_32FC1);\r
+ cv::Mat src1_host(size, type);\r
+ cv::Mat src2_host(size, type);\r
\r
- declare.in(a_host, b_host, WARMUP_RNG);\r
+ fill(src1_host, 0.0, 100.0);\r
+ fill(src2_host, 0.0, 100.0);\r
\r
- GpuMat a(a_host);\r
- GpuMat b(b_host);\r
- GpuMat c;\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- multiply(a, b, c);\r
+ cv::gpu::add(src1, src2, dst);\r
}\r
+}\r
\r
- Mat c_host(c);\r
+INSTANTIATE_TEST_CASE_P(Arithm, AddMat, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(c_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// AddScalar\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, multiplyScalar, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_32FC1)))\r
+GPU_PERF_TEST(AddScalar, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat a_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
- declare.in(a_host, WARMUP_RNG);\r
+ fill(src_host, 0.0, 100.0);\r
\r
- GpuMat a(a_host);\r
- Scalar b(1,2,3,4);\r
- GpuMat c(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::Scalar s(1,2,3,4);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- multiply(a, b, c);\r
+ cv::gpu::add(src, s, dst);\r
}\r
+}\r
\r
- Mat c_host(c);\r
+INSTANTIATE_TEST_CASE_P(Arithm, AddScalar, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(c_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Exp\r
\r
-PERF_TEST_P(DevInfo_Size, exp, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(Exp, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat a_host(size, CV_32FC1);\r
+ cv::Mat src_host(size, CV_32FC1);\r
\r
- declare.in(a_host, WARMUP_RNG);\r
+ fill(src_host, 0.0, 10.0);\r
\r
- GpuMat a(a_host);\r
- GpuMat b(size, CV_32FC1);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- exp(a, b);\r
+ cv::gpu::exp(src, dst);\r
}\r
+}\r
\r
- Mat b_host(b);\r
+INSTANTIATE_TEST_CASE_P(Arithm, Exp, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(b_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Pow\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, pow, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1)))\r
+GPU_PERF_TEST(Pow, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- pow(src, 2.0, dst);\r
+ cv::gpu::pow(src, 0.5, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, Pow, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Compare\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_CmpOp, compare, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC4, CV_32FC1), \r
- testing::Values((int)CMP_NE, (int)CMP_EQ)))\r
+GPU_PERF_TEST(Compare, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int cmpop = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src1_host(size, type);\r
- Mat src2_host(size, type);\r
+ cv::Mat src1_host(size, type);\r
+ cv::Mat src2_host(size, type);\r
\r
declare.in(src1_host, src2_host, WARMUP_RNG);\r
\r
- GpuMat src1(src1_host);\r
- GpuMat src2(src2_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- compare(src1, src2, dst, cmpop);\r
+ cv::gpu::compare(src1, src2, dst, cv::CMP_EQ);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, Compare, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BitwiseNot\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, bitwise_not, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)))\r
+GPU_PERF_TEST(BitwiseNot, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- bitwise_not(src, dst);\r
+ cv::gpu::bitwise_not(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, BitwiseNot, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BitwiseAnd\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, bitwise_and, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)))\r
+GPU_PERF_TEST(BitwiseAnd, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src1_host(size, type);\r
- Mat src2_host(size, type);\r
+ cv::Mat src1_host(size, type);\r
+ cv::Mat src2_host(size, type);\r
\r
declare.in(src1_host, src2_host, WARMUP_RNG);\r
\r
- GpuMat src1(src1_host);\r
- GpuMat src2(src2_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- bitwise_and(src1, src2, dst);\r
+ cv::gpu::bitwise_and(src1, src2, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, BitwiseAnd, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Min\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, min, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)))\r
+GPU_PERF_TEST(Min, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src1_host(size, type);\r
- Mat src2_host(size, type);\r
+ cv::Mat src1_host(size, type);\r
+ cv::Mat src2_host(size, type);\r
\r
declare.in(src1_host, src2_host, WARMUP_RNG);\r
\r
- GpuMat src1(src1_host);\r
- GpuMat src2(src2_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat dst(size, type);\r
\r
TEST_CYCLE(100)\r
{\r
- min(src1, src2, dst);\r
+ cv::gpu::min(src1, src2, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, Min, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// MeanStdDev\r
\r
-PERF_TEST_P(DevInfo_Size, meanStdDev, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(MeanStdDev, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
+ cv::Mat src_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host); \r
- Scalar mean;\r
- Scalar stddev;\r
+ cv::gpu::GpuMat src(src_host); \r
+ cv::Scalar mean;\r
+ cv::Scalar stddev;\r
\r
TEST_CYCLE(100)\r
{\r
- meanStdDev(src, mean, stddev);\r
+ cv::gpu::meanStdDev(src, mean, stddev);\r
}\r
-\r
- SANITY_CHECK(mean);\r
- SANITY_CHECK(stddev);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_NormType, norm, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32SC1),\r
- testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, MeanStdDev, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// Norm\r
+\r
+GPU_PERF_TEST(Norm, cv::gpu::DeviceInfo, cv::Size, perf::MatType, NormType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int normType = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int normType = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
+ cv::gpu::GpuMat src(src_host);\r
double dst;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE(100)\r
{\r
- dst = norm(src, normType, buf);\r
+ dst = cv::gpu::norm(src, normType, buf);\r
}\r
-\r
- SANITY_CHECK(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_NormType, normDiff, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, Norm, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32SC1),\r
+ testing::Values((int) cv::NORM_INF, (int) cv::NORM_L1, (int) cv::NORM_L2)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// NormDiff\r
+\r
+GPU_PERF_TEST(NormDiff, cv::gpu::DeviceInfo, cv::Size, NormType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int normType = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int normType = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src1_host(size, CV_8UC1);\r
- Mat src2_host(size, CV_8UC1);\r
+ cv::Mat src1_host(size, CV_8UC1);\r
+ cv::Mat src2_host(size, CV_8UC1);\r
\r
declare.in(src1_host, src2_host, WARMUP_RNG);\r
\r
- GpuMat src1(src1_host);\r
- GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
double dst;\r
\r
TEST_CYCLE(100)\r
{\r
- dst = norm(src1, src2, normType);\r
+ dst = cv::gpu::norm(src1, src2, normType);\r
}\r
-\r
- SANITY_CHECK(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, sum, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, NormDiff, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values((int) cv::NORM_INF, (int) cv::NORM_L1, (int) cv::NORM_L2)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// Sum\r
+\r
+GPU_PERF_TEST(Sum, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- Scalar dst;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::Scalar dst;\r
+ cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE(100)\r
{\r
- dst = sum(src, buf);\r
+ dst = cv::gpu::sum(src, buf);\r
}\r
-\r
- SANITY_CHECK(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, minMax, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, Sum, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// MinMax\r
+\r
+GPU_PERF_TEST(MinMax, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
+ cv::gpu::GpuMat src(src_host);\r
double minVal, maxVal;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE(100)\r
{\r
- minMax(src, &minVal, &maxVal, GpuMat(), buf);\r
+ cv::gpu::minMax(src, &minVal, &maxVal, cv::gpu::GpuMat(), buf);\r
}\r
-\r
- SANITY_CHECK(minVal);\r
- SANITY_CHECK(maxVal);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, minMaxLoc, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, MinMax, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// MinMaxLoc\r
+\r
+GPU_PERF_TEST(MinMaxLoc, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
+ cv::gpu::GpuMat src(src_host);\r
double minVal, maxVal;\r
- Point minLoc, maxLoc;\r
- GpuMat valbuf, locbuf;\r
+ cv::Point minLoc, maxLoc;\r
+ cv::gpu::GpuMat valbuf, locbuf;\r
\r
TEST_CYCLE(100)\r
{\r
- minMaxLoc(src, &minVal, &maxVal, &minLoc, &maxLoc, GpuMat(), valbuf, locbuf);\r
+ cv::gpu::minMaxLoc(src, &minVal, &maxVal, &minLoc, &maxLoc, cv::gpu::GpuMat(), valbuf, locbuf);\r
}\r
-\r
- SANITY_CHECK(minVal);\r
- SANITY_CHECK(maxVal);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, countNonZero, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, MinMaxLoc, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// CountNonZero\r
+\r
+GPU_PERF_TEST(CountNonZero, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ fill(src_host, 0.0, 1.0);\r
\r
- GpuMat src(src_host);\r
- int dst=0;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat src(src_host);\r
+ int dst;\r
+ cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE(100)\r
{\r
- dst = countNonZero(src, buf);\r
+ dst = cv::gpu::countNonZero(src, buf);\r
}\r
-\r
- SANITY_CHECK(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, addWeighted, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, CountNonZero, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// AddWeighted\r
+\r
+GPU_PERF_TEST(AddWeighted, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src1_host(size, type);\r
- Mat src2_host(size, type);\r
+ cv::Mat src1_host(size, type);\r
+ cv::Mat src2_host(size, type);\r
\r
- declare.in(src1_host, src2_host, WARMUP_RNG);\r
+ fill(src1_host, 0.0, 100.0);\r
+ fill(src2_host, 0.0, 100.0);\r
\r
- GpuMat src1(src1_host);\r
- GpuMat src2(src2_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- addWeighted(src1, 0.5, src2, 0.5, 0.0, dst);\r
+ cv::gpu::addWeighted(src1, 0.5, src2, 0.5, 0.0, dst);\r
}\r
\r
- Mat dst_host(dst);\r
-\r
- SANITY_CHECK(dst_host);\r
+ cv::Mat dst_host(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_FlipCode, reduce, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1), \r
- testing::Values((int)HORIZONTAL_AXIS, (int)VERTICAL_AXIS)))\r
+INSTANTIATE_TEST_CASE_P(Arithm, AddWeighted, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// Reduce\r
+\r
+GPU_PERF_TEST(Reduce, cv::gpu::DeviceInfo, cv::Size, perf::MatType, FlipCode)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int dim = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int dim = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ fill(src_host, 0.0, 10.0);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- reduce(src, dst, dim, CV_REDUCE_MIN);\r
+ cv::gpu::reduce(src, dst, dim, CV_REDUCE_MIN);\r
}\r
\r
- Mat dst_host(dst);\r
-\r
- SANITY_CHECK(dst_host);\r
+ cv::Mat dst_host(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size, gemm, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(cv::Size(512, 512), cv::Size(1024, 1024), cv::Size(2048, 2048), cv::Size(4096, 4096))))\r
+INSTANTIATE_TEST_CASE_P(Arithm, Reduce, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1), \r
+ testing::Values((int) HORIZONTAL_AXIS, (int) VERTICAL_AXIS)));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// GEMM\r
+\r
+GPU_PERF_TEST(GEMM, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src1_host(size, CV_32FC1);\r
- Mat src2_host(size, CV_32FC1);\r
- Mat src3_host(size, CV_32FC1);\r
+ cv::Mat src1_host(size, CV_32FC1);\r
+ cv::Mat src2_host(size, CV_32FC1);\r
+ cv::Mat src3_host(size, CV_32FC1);\r
\r
- declare.in(src1_host, src2_host, src3_host, WARMUP_RNG);\r
+ fill(src1_host, 0.0, 10.0);\r
+ fill(src2_host, 0.0, 10.0);\r
+ fill(src3_host, 0.0, 10.0);\r
\r
- GpuMat src1(src1_host);\r
- GpuMat src2(src2_host);\r
- GpuMat src3(src3_host);\r
- GpuMat dst(size, CV_32FC1);\r
+ cv::gpu::GpuMat src1(src1_host);\r
+ cv::gpu::GpuMat src2(src2_host);\r
+ cv::gpu::GpuMat src3(src3_host);\r
+ cv::gpu::GpuMat dst;\r
\r
declare.time(5.0);\r
\r
TEST_CYCLE(100)\r
{\r
- gemm(src1, src2, 1.0, src3, 1.0, dst);\r
+ cv::gpu::gemm(src1, src2, 1.0, src3, 1.0, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Arithm, GEMM, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(cv::Size(512, 512), cv::Size(1024, 1024), cv::Size(2048, 2048))));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+#endif\r
#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo, transformPoints, testing::ValuesIn(devices()))\r
+#ifdef HAVE_CUDA\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// TransformPoints\r
+\r
+GPU_PERF_TEST_1(TransformPoints, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(1, 10000, CV_32FC3);\r
+ cv::Mat src_host(1, 10000, CV_32FC3);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- transformPoints(src, Mat::ones(1, 3, CV_32FC1), Mat::ones(1, 3, CV_32FC1), dst);\r
+ cv::gpu::transformPoints(src, cv::Mat::ones(1, 3, CV_32FC1), cv::Mat::ones(1, 3, CV_32FC1), dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Calib3D, TransformPoints, ALL_DEVICES);\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// ProjectPoints\r
\r
-PERF_TEST_P(DevInfo, projectPoints, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(ProjectPoints, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(1, 10000, CV_32FC3);\r
+ cv::Mat src_host(1, 10000, CV_32FC3);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- projectPoints(src, Mat::ones(1, 3, CV_32FC1), Mat::ones(1, 3, CV_32FC1), Mat::ones(3, 3, CV_32FC1), Mat(), dst);\r
+ cv::gpu::projectPoints(src, cv::Mat::ones(1, 3, CV_32FC1), cv::Mat::ones(1, 3, CV_32FC1), cv::Mat::ones(3, 3, CV_32FC1), cv::Mat(), dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Calib3D, ProjectPoints, ALL_DEVICES);\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// SolvePnPRansac\r
\r
-PERF_TEST_P(DevInfo, solvePnPRansac, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(SolvePnPRansac, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat object(1, 10000, CV_32FC3);\r
- Mat image(1, 10000, CV_32FC2);\r
+ cv::Mat object(1, 10000, CV_32FC3);\r
+ cv::Mat image(1, 10000, CV_32FC2);\r
\r
declare.in(object, image, WARMUP_RNG);\r
\r
- Mat rvec, tvec;\r
+ cv::Mat rvec, tvec;\r
\r
declare.time(3.0);\r
\r
TEST_CYCLE(100)\r
{\r
- solvePnPRansac(object, image, Mat::ones(3, 3, CV_32FC1), Mat(1, 8, CV_32F, Scalar::all(0)), rvec, tvec);\r
+ cv::gpu::solvePnPRansac(object, image, cv::Mat::ones(3, 3, CV_32FC1), cv::Mat(1, 8, CV_32F, cv::Scalar::all(0)), rvec, tvec);\r
}\r
-\r
- SANITY_CHECK(rvec);\r
- SANITY_CHECK(tvec);\r
}\r
\r
-PERF_TEST_P(DevInfo, StereoBM, testing::ValuesIn(devices()))\r
+INSTANTIATE_TEST_CASE_P(Calib3D, SolvePnPRansac, ALL_DEVICES);\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// StereoBM\r
+\r
+GPU_PERF_TEST_1(StereoBM, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_l_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
- Mat img_r_host = readImage("gpu/perf/aloeR.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_l_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat img_r_host = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE);\r
\r
ASSERT_FALSE(img_l_host.empty());\r
ASSERT_FALSE(img_r_host.empty());\r
\r
- GpuMat img_l(img_l_host);\r
- GpuMat img_r(img_r_host);\r
-\r
- GpuMat dst;\r
+ cv::gpu::GpuMat img_l(img_l_host);\r
+ cv::gpu::GpuMat img_r(img_r_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- StereoBM_GPU bm(0, 256);\r
+ cv::gpu::StereoBM_GPU bm(0, 256);\r
\r
declare.time(5.0);\r
\r
{\r
bm(img_l, img_r, dst);\r
}\r
-\r
- Mat dst_host(dst);\r
- \r
- SANITY_CHECK(dst_host);\r
}\r
\r
-PERF_TEST_P(DevInfo, StereoBeliefPropagation, testing::ValuesIn(devices()))\r
+INSTANTIATE_TEST_CASE_P(Calib3D, StereoBM, ALL_DEVICES);\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// StereoBeliefPropagation\r
+\r
+GPU_PERF_TEST_1(StereoBeliefPropagation, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_l_host = readImage("gpu/stereobp/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);\r
- Mat img_r_host = readImage("gpu/stereobp/aloe-R.png", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_l_host = readImage("gpu/stereobp/aloe-L.png");\r
+ cv::Mat img_r_host = readImage("gpu/stereobp/aloe-R.png");\r
\r
ASSERT_FALSE(img_l_host.empty());\r
ASSERT_FALSE(img_r_host.empty());\r
\r
- GpuMat img_l(img_l_host);\r
- GpuMat img_r(img_r_host);\r
+ cv::gpu::GpuMat img_l(img_l_host);\r
+ cv::gpu::GpuMat img_r(img_r_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- GpuMat dst;\r
-\r
- StereoBeliefPropagation bp(128);\r
+ cv::gpu::StereoBeliefPropagation bp(64);\r
\r
declare.time(10.0);\r
\r
{\r
bp(img_l, img_r, dst);\r
}\r
-\r
- Mat dst_host(dst);\r
- \r
- SANITY_CHECK(dst_host);\r
}\r
\r
-PERF_TEST_P(DevInfo, StereoConstantSpaceBP, testing::ValuesIn(devices()))\r
+INSTANTIATE_TEST_CASE_P(Calib3D, StereoBeliefPropagation, ALL_DEVICES);\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// StereoConstantSpaceBP\r
+\r
+GPU_PERF_TEST_1(StereoConstantSpaceBP, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_l_host = readImage("gpu/stereocsbp/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
- Mat img_r_host = readImage("gpu/stereocsbp/aloeR.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_l_host = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat img_r_host = readImage("gpu/stereobm/aloe-R.png", cv::IMREAD_GRAYSCALE);\r
\r
ASSERT_FALSE(img_l_host.empty());\r
ASSERT_FALSE(img_r_host.empty());\r
\r
- GpuMat img_l(img_l_host);\r
- GpuMat img_r(img_r_host);\r
+ cv::gpu::GpuMat img_l(img_l_host);\r
+ cv::gpu::GpuMat img_r(img_r_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- GpuMat dst;\r
-\r
- StereoConstantSpaceBP bp(128);\r
+ cv::gpu::StereoConstantSpaceBP bp(128);\r
\r
declare.time(10.0);\r
\r
{\r
bp(img_l, img_r, dst);\r
}\r
-\r
- Mat dst_host(dst);\r
- \r
- SANITY_CHECK(dst_host);\r
}\r
\r
-PERF_TEST_P(DevInfo, DisparityBilateralFilter, testing::ValuesIn(devices()))\r
+INSTANTIATE_TEST_CASE_P(Calib3D, StereoConstantSpaceBP, ALL_DEVICES);\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// DisparityBilateralFilter\r
+\r
+GPU_PERF_TEST_1(DisparityBilateralFilter, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_host = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);\r
- Mat disp_host = readImage("gpu/stereobm/aloe-disp.png", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_host = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat disp_host = readImage("gpu/stereobm/aloe-disp.png", cv::IMREAD_GRAYSCALE);\r
\r
ASSERT_FALSE(img_host.empty());\r
ASSERT_FALSE(disp_host.empty());\r
\r
- GpuMat img(img_host);\r
- GpuMat disp(disp_host);\r
-\r
- GpuMat dst;\r
+ cv::gpu::GpuMat img(img_host);\r
+ cv::gpu::GpuMat disp(disp_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- DisparityBilateralFilter f(128);\r
+ cv::gpu::DisparityBilateralFilter f(128);\r
\r
TEST_CYCLE(100)\r
{\r
f(disp, img, dst);\r
}\r
-\r
- Mat dst_host(dst);\r
- \r
- SANITY_CHECK(dst_host);\r
}\r
+\r
+INSTANTIATE_TEST_CASE_P(Calib3D, DisparityBilateralFilter, ALL_DEVICES);\r
+\r
+#endif\r
+\r
#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo_DescSize, BruteForceMatcher_match, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(64, 128, 256)))\r
+#ifdef HAVE_CUDA\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// BruteForceMatcher_match\r
+\r
+GPU_PERF_TEST(BruteForceMatcher_match, cv::gpu::DeviceInfo, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- int desc_size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ int desc_size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat query_host(3000, desc_size, CV_32FC1);\r
- Mat train_host(3000, desc_size, CV_32FC1);\r
+ cv::Mat query_host(3000, desc_size, CV_32FC1);\r
+ cv::Mat train_host(3000, desc_size, CV_32FC1);\r
\r
declare.in(query_host, train_host, WARMUP_RNG);\r
\r
- GpuMat query(query_host);\r
- GpuMat train(train_host);\r
- GpuMat trainIdx, distance;\r
+ cv::gpu::GpuMat query(query_host);\r
+ cv::gpu::GpuMat train(train_host);\r
+ cv::gpu::GpuMat trainIdx, distance;\r
\r
- BruteForceMatcher_GPU< L2<float> > matcher;\r
+ cv::gpu::BruteForceMatcher_GPU< cv::L2<float> > matcher;\r
\r
declare.time(3.0);\r
\r
{\r
matcher.matchSingle(query, train, trainIdx, distance);\r
}\r
+}\r
\r
- Mat trainIdx_host(trainIdx);\r
- Mat distance_host(distance);\r
+INSTANTIATE_TEST_CASE_P(Features2D, BruteForceMatcher_match, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(64, 128, 256)));\r
\r
- SANITY_CHECK(trainIdx_host);\r
- SANITY_CHECK(distance_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BruteForceMatcher_knnMatch\r
\r
-PERF_TEST_P(DevInfo_K_DescSize, BruteForceMatcher_knnMatch, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(2, 3),\r
- testing::Values(64, 128, 256)))\r
+GPU_PERF_TEST(BruteForceMatcher_knnMatch, cv::gpu::DeviceInfo, int, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- int k = std::tr1::get<1>(GetParam());\r
- int desc_size = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ int desc_size = GET_PARAM(1);\r
+ int k = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat query_host(3000, desc_size, CV_32FC1);\r
- Mat train_host(3000, desc_size, CV_32FC1);\r
+ cv::Mat query_host(3000, desc_size, CV_32FC1);\r
+ cv::Mat train_host(3000, desc_size, CV_32FC1);\r
\r
declare.in(query_host, train_host, WARMUP_RNG);\r
\r
- GpuMat query(query_host);\r
- GpuMat train(train_host);\r
- GpuMat trainIdx, distance, allDist;\r
+ cv::gpu::GpuMat query(query_host);\r
+ cv::gpu::GpuMat train(train_host);\r
+ cv::gpu::GpuMat trainIdx, distance, allDist;\r
\r
- BruteForceMatcher_GPU< L2<float> > matcher;\r
+ cv::gpu::BruteForceMatcher_GPU< cv::L2<float> > matcher;\r
\r
declare.time(3.0);\r
\r
{\r
matcher.knnMatchSingle(query, train, trainIdx, distance, allDist, k);\r
}\r
+}\r
\r
- Mat trainIdx_host(trainIdx);\r
- Mat distance_host(distance);\r
+INSTANTIATE_TEST_CASE_P(Features2D, BruteForceMatcher_knnMatch, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(64, 128, 256),\r
+ testing::Values(2, 3)));\r
\r
- SANITY_CHECK(trainIdx_host);\r
- SANITY_CHECK(distance_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BruteForceMatcher_radiusMatch\r
\r
-PERF_TEST_P(DevInfo_DescSize, BruteForceMatcher_radiusMatch, testing::Combine(testing::ValuesIn(devices(SHARED_ATOMICS)),\r
- testing::Values(64, 128, 256)))\r
+GPU_PERF_TEST(BruteForceMatcher_radiusMatch, cv::gpu::DeviceInfo, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- int desc_size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ int desc_size = GET_PARAM(1);\r
+\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::Mat query_host(3000, desc_size, CV_32FC1);\r
+ cv::Mat train_host(3000, desc_size, CV_32FC1);\r
\r
- Mat query_host = cvtest::randomMat(theRNG(), Size(desc_size, 3000), CV_32FC1, 0, 1, false);\r
- Mat train_host = cvtest::randomMat(theRNG(), Size(desc_size, 3000), CV_32FC1, 0, 1, false);\r
+ fill(query_host, 0, 1);\r
+ fill(train_host, 0, 1);\r
\r
- GpuMat query(query_host);\r
- GpuMat train(train_host);\r
- GpuMat trainIdx, nMatches, distance;\r
+ cv::gpu::GpuMat query(query_host);\r
+ cv::gpu::GpuMat train(train_host);\r
+ cv::gpu::GpuMat trainIdx, nMatches, distance;\r
\r
- BruteForceMatcher_GPU< L2<float> > matcher;\r
+ cv::gpu::BruteForceMatcher_GPU< cv::L2<float> > matcher;\r
\r
declare.time(3.0);\r
\r
{\r
matcher.radiusMatchSingle(query, train, trainIdx, distance, nMatches, 2.0);\r
}\r
+}\r
\r
- Mat trainIdx_host(trainIdx);\r
- Mat nMatches_host(nMatches);\r
- Mat distance_host(distance);\r
+INSTANTIATE_TEST_CASE_P(Features2D, BruteForceMatcher_radiusMatch, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(64, 128, 256)));\r
\r
- SANITY_CHECK(trainIdx_host);\r
- SANITY_CHECK(nMatches_host);\r
- SANITY_CHECK(distance_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// SURF\r
\r
-PERF_TEST_P(DevInfo, SURF, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(SURF, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
ASSERT_FALSE(img_host.empty());\r
\r
- GpuMat img(img_host);\r
- GpuMat keypoints, descriptors;\r
+ cv::gpu::GpuMat img(img_host);\r
+ cv::gpu::GpuMat keypoints, descriptors;\r
\r
- SURF_GPU surf;\r
+ cv::gpu::SURF_GPU surf;\r
\r
declare.time(2.0);\r
\r
TEST_CYCLE(100)\r
{\r
- surf(img, GpuMat(), keypoints, descriptors);\r
+ surf(img, cv::gpu::GpuMat(), keypoints, descriptors);\r
}\r
}\r
\r
-PERF_TEST_P(DevInfo, FAST, testing::ValuesIn(devices()))\r
+INSTANTIATE_TEST_CASE_P(Features2D, SURF, DEVICES(cv::gpu::GLOBAL_ATOMICS));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// FAST\r
+\r
+GPU_PERF_TEST_1(FAST, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
ASSERT_FALSE(img_host.empty());\r
\r
- GpuMat img(img_host);\r
- GpuMat keypoints;\r
-\r
- FAST_GPU fastGPU(20);\r
+ cv::gpu::GpuMat img(img_host);\r
+ cv::gpu::GpuMat keypoints, descriptors;\r
\r
- declare.time(2.0);\r
+ cv::gpu::FAST_GPU fastGPU(20);\r
\r
TEST_CYCLE(100)\r
{\r
- fastGPU(img, GpuMat(), keypoints);\r
+ fastGPU(img, cv::gpu::GpuMat(), keypoints);\r
}\r
}\r
\r
-PERF_TEST_P(DevInfo, ORB, testing::ValuesIn(devices()))\r
+INSTANTIATE_TEST_CASE_P(Features2D, FAST, DEVICES(cv::gpu::GLOBAL_ATOMICS));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// ORB\r
+\r
+GPU_PERF_TEST_1(ORB, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
ASSERT_FALSE(img_host.empty());\r
\r
- GpuMat img(img_host);\r
- GpuMat keypoints, descriptors;\r
+ cv::gpu::GpuMat img(img_host);\r
+ cv::gpu::GpuMat keypoints, descriptors;\r
\r
- ORB_GPU orbGPU(4000);\r
-\r
- declare.time(2.0);\r
+ cv::gpu::ORB_GPU orbGPU(4000);\r
\r
TEST_CYCLE(100)\r
{\r
- orbGPU(img, GpuMat(), keypoints, descriptors);\r
+ orbGPU(img, cv::gpu::GpuMat(), keypoints, descriptors);\r
}\r
}\r
+\r
+INSTANTIATE_TEST_CASE_P(Features2D, ORB, DEVICES(cv::gpu::GLOBAL_ATOMICS));\r
+\r
+#endif\r
#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_KernelSize, boxFilter, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4),\r
- testing::Values(3, 5)))\r
+#ifdef HAVE_CUDA\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// BoxFilter\r
+\r
+GPU_PERF_TEST(BoxFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int ksize = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int ksize = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- Ptr<FilterEngine_GPU> filter = createBoxFilter_GPU(type, type, Size(ksize, ksize));\r
+ cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createBoxFilter_GPU(type, type, cv::Size(ksize, ksize));\r
\r
TEST_CYCLE(100)\r
{\r
filter->apply(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Filter, BoxFilter, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4),\r
+ testing::Values(3, 5)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// MorphologyFilter\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_MorphOp_KernelSize, morphologyFilter, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4),\r
- testing::Values((int)MORPH_ERODE, (int)MORPH_DILATE),\r
- testing::Values(3, 5)))\r
+GPU_PERF_TEST(MorphologyFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, MorphOp, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int op = std::tr1::get<3>(GetParam());\r
- int ksize = std::tr1::get<4>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int op = GET_PARAM(3);\r
+ int ksize = GET_PARAM(4);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- Ptr<FilterEngine_GPU> filter = createMorphologyFilter_GPU(op, type, Mat::ones(ksize, ksize, CV_8U));\r
+ cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createMorphologyFilter_GPU(op, type, cv::Mat::ones(ksize, ksize, CV_8U));\r
\r
TEST_CYCLE(100)\r
{\r
filter->apply(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Filter, MorphologyFilter, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4),\r
+ testing::Values((int) cv::MORPH_ERODE, (int) cv::MORPH_DILATE),\r
+ testing::Values(3, 5)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// LinearFilter\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_KernelSize, linearFilter, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4),\r
- testing::Values(3, 5)))\r
+GPU_PERF_TEST(LinearFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int ksize = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int ksize = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- Ptr<FilterEngine_GPU> filter = createLinearFilter_GPU(type, type, Mat::ones(ksize, ksize, CV_8U));\r
+ cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createLinearFilter_GPU(type, type, cv::Mat::ones(ksize, ksize, CV_8U));\r
\r
declare.time(1.0);\r
\r
{\r
filter->apply(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Filter, LinearFilter, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4),\r
+ testing::Values(3, 5)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// SeparableLinearFilter\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_KernelSize, separableLinearFilter, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
- testing::Values(3, 5)))\r
+GPU_PERF_TEST(SeparableLinearFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int ksize = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int ksize = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- Mat kernel = getGaussianKernel(ksize, 0.5, CV_32F);\r
- Ptr<FilterEngine_GPU> filter = createSeparableLinearFilter_GPU(type, type, kernel, kernel, Point(-1,-1));\r
+ cv::Mat kernel = cv::getGaussianKernel(ksize, 0.5, CV_32F);\r
+ cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createSeparableLinearFilter_GPU(type, type, kernel, kernel);\r
\r
declare.time(1.0);\r
\r
TEST_CYCLE(100)\r
{\r
- filter->apply(src, dst, Rect(0, 0, src.cols, src.rows));\r
+ filter->apply(src, dst, cv::Rect(0, 0, src.cols, src.rows));\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(Filter, SeparableLinearFilter, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
+ testing::Values(3, 5)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+#endif\r
#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_Interpolation_BorderMode, remap, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1), \r
- testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC),\r
- testing::Values((int)BORDER_REFLECT101, (int)BORDER_REPLICATE, (int)BORDER_CONSTANT)))\r
-{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int interpolation = std::tr1::get<3>(GetParam());\r
- int borderMode = std::tr1::get<4>(GetParam());\r
+#ifdef HAVE_CUDA\r
\r
- setDevice(devInfo.deviceID());\r
+//////////////////////////////////////////////////////////////////////\r
+// Remap\r
\r
- Mat src_host(size, type);\r
+GPU_PERF_TEST(Remap, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation, BorderMode)\r
+{\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int interpolation = GET_PARAM(3);\r
+ int borderMode = GET_PARAM(4);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::Mat src_host(size, type);\r
+ cv::Mat xmap_host(size, CV_32FC1);\r
+ cv::Mat ymap_host(size, CV_32FC1);\r
\r
- Mat xmap_host(size, CV_32FC1);\r
- Mat ymap_host(size, CV_32FC1);\r
- randu(xmap_host, -300, size.width + 300);\r
- randu(ymap_host, -300, size.height + 300);\r
+ declare.in(src_host, xmap_host, ymap_host, WARMUP_RNG);\r
\r
- GpuMat xmap(xmap_host);\r
- GpuMat ymap(ymap_host);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat xmap(xmap_host);\r
+ cv::gpu::GpuMat ymap(ymap_host);\r
+ cv::gpu::GpuMat dst;\r
\r
declare.time(3.0);\r
\r
TEST_CYCLE(100)\r
{\r
- remap(src, dst, xmap, ymap, interpolation, borderMode);\r
+ cv::gpu::remap(src, dst, xmap, ymap, interpolation, borderMode);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Remap, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1), \r
+ testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC),\r
+ testing::Values((int) cv::BORDER_REFLECT101, (int) cv::BORDER_REPLICATE, (int) cv::BORDER_CONSTANT)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// MeanShiftFiltering\r
\r
-PERF_TEST_P(DevInfo, meanShiftFiltering, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(MeanShiftFiltering, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img = readImage("gpu/meanshift/cones.png");\r
+ cv::Mat img = readImage("gpu/meanshift/cones.png");\r
ASSERT_FALSE(img.empty());\r
\r
- Mat rgba;\r
- cvtColor(img, rgba, CV_BGR2BGRA);\r
+ cv::Mat rgba;\r
+ cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);\r
\r
- GpuMat src(rgba);\r
- GpuMat dst(src.size(), CV_8UC4);\r
+ cv::gpu::GpuMat src(rgba);\r
+ cv::gpu::GpuMat dst;\r
\r
declare.time(5.0);\r
\r
TEST_CYCLE(100)\r
{\r
- meanShiftFiltering(src, dst, 50, 50);\r
+ cv::gpu::meanShiftFiltering(src, dst, 50, 50);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftFiltering, ALL_DEVICES);\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// MeanShiftProc\r
\r
-PERF_TEST_P(DevInfo, meanShiftProc, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(MeanShiftProc, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img = readImage("gpu/meanshift/cones.png");\r
+ cv::Mat img = readImage("gpu/meanshift/cones.png");\r
ASSERT_FALSE(img.empty());\r
\r
- Mat rgba;\r
- cvtColor(img, rgba, CV_BGR2BGRA);\r
+ cv::Mat rgba;\r
+ cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);\r
\r
- GpuMat src(rgba);\r
- GpuMat dstr(src.size(), CV_8UC4);\r
- GpuMat dstsp(src.size(), CV_16SC2);\r
+ cv::gpu::GpuMat src(rgba);\r
+ cv::gpu::GpuMat dstr;\r
+ cv::gpu::GpuMat dstsp;\r
\r
declare.time(5.0);\r
\r
TEST_CYCLE(100)\r
{\r
- meanShiftProc(src, dstr, dstsp, 50, 50);\r
+ cv::gpu::meanShiftProc(src, dstr, dstsp, 50, 50);\r
}\r
+}\r
\r
- Mat dstr_host(dstr);\r
- Mat dstsp_host(dstsp);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftProc, ALL_DEVICES);\r
\r
- SANITY_CHECK(dstr_host);\r
- SANITY_CHECK(dstsp_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// MeanShiftSegmentation\r
\r
-PERF_TEST_P(DevInfo, meanShiftSegmentation, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(MeanShiftSegmentation, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img = readImage("gpu/meanshift/cones.png");\r
+ cv::Mat img = readImage("gpu/meanshift/cones.png");\r
ASSERT_FALSE(img.empty());\r
\r
- Mat rgba;\r
- cvtColor(img, rgba, CV_BGR2BGRA);\r
+ cv::Mat rgba;\r
+ cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);\r
\r
- GpuMat src(rgba);\r
- Mat dst(src.size(), CV_8UC4);\r
+ cv::gpu::GpuMat src(rgba);\r
+ cv::Mat dst;\r
\r
declare.time(5.0);\r
\r
{\r
meanShiftSegmentation(src, dst, 10, 10, 20);\r
}\r
-\r
- SANITY_CHECK(dst);\r
}\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, drawColorDisp, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16SC1)))\r
+INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftSegmentation, ALL_DEVICES);\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// DrawColorDisp\r
+\r
+GPU_PERF_TEST(DrawColorDisp, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
- declare.in(src_host, WARMUP_RNG);\r
- src_host.convertTo(src_host, type);\r
+ cv::Mat src_host(size, type);\r
+\r
+ fill(src_host, 0, 255);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, CV_8UC4);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- drawColorDisp(src, dst, 255);\r
+ cv::gpu::drawColorDisp(src, dst, 255);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, DrawColorDisp, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16SC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// ReprojectImageTo3D\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, reprojectImageTo3D, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16SC1)))\r
+GPU_PERF_TEST(ReprojectImageTo3D, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, CV_32FC4);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- reprojectImageTo3D(src, dst, Mat::ones(4, 4, CV_32FC1));\r
+ cv::gpu::reprojectImageTo3D(src, dst, cv::Mat::ones(4, 4, CV_32FC1));\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, ReprojectImageTo3D, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16SC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// CvtColor\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_CvtColorInfo, cvtColor, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1),\r
- testing::Values(CvtColorInfo(4, 4, CV_RGBA2BGRA), CvtColorInfo(4, 1, CV_BGRA2GRAY), CvtColorInfo(1, 4, CV_GRAY2BGRA), \r
- CvtColorInfo(4, 4, CV_BGR2XYZ), CvtColorInfo(4, 4, CV_BGR2YCrCb), CvtColorInfo(4, 4, CV_YCrCb2BGR), \r
- CvtColorInfo(4, 4, CV_BGR2HSV), CvtColorInfo(4, 4, CV_HSV2BGR))))\r
+GPU_PERF_TEST(CvtColor, cv::gpu::DeviceInfo, cv::Size, perf::MatType, CvtColorInfo)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- CvtColorInfo info = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ CvtColorInfo info = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_MAKETYPE(type, info.scn));\r
+ cv::Mat src_host(size, CV_MAKETYPE(type, info.scn));\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, CV_MAKETYPE(type, info.dcn));\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst(size, CV_MAKETYPE(type, info.dcn));\r
\r
TEST_CYCLE(100)\r
{\r
- cvtColor(src, dst, info.code, info.dcn);\r
+ cv::gpu::cvtColor(src, dst, info.code, info.dcn);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1),\r
+ testing::Values(\r
+ CvtColorInfo(4, 4, cv::COLOR_RGBA2BGRA), CvtColorInfo(4, 1, cv::COLOR_BGRA2GRAY), CvtColorInfo(1, 4, cv::COLOR_GRAY2BGRA), \r
+ CvtColorInfo(4, 4, cv::COLOR_BGR2XYZ), CvtColorInfo(4, 4, cv::COLOR_BGR2YCrCb), CvtColorInfo(4, 4, cv::COLOR_YCrCb2BGR), \r
+ CvtColorInfo(4, 4, cv::COLOR_BGR2HSV), CvtColorInfo(4, 4, cv::COLOR_HSV2BGR))));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Threshold\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, threshold, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+GPU_PERF_TEST(Threshold, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst(size, type);\r
\r
TEST_CYCLE(100)\r
{\r
- threshold(src, dst, 100.0, 255.0, THRESH_BINARY);\r
+ cv::gpu::threshold(src, dst, 100.0, 255.0, cv::THRESH_BINARY);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Threshold, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Resize\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_Interpolation_SizeCoeff, resize, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(szSXGA, sz1080p), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1),\r
- testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC),\r
- testing::Values(0.5, 2.0)))\r
+GPU_PERF_TEST(Resize, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation, double)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int interpolation = std::tr1::get<3>(GetParam());\r
- double f = std::tr1::get<4>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int interpolation = GET_PARAM(3);\r
+ double f = GET_PARAM(4);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
declare.time(1.0);\r
\r
TEST_CYCLE(100)\r
{\r
- resize(src, dst, Size(), f, f, interpolation);\r
+ cv::gpu::resize(src, dst, cv::Size(), f, f, interpolation);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(perf::szSXGA, perf::sz1080p), \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1),\r
+ testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC),\r
+ testing::Values(0.5, 2.0)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// WarpAffine\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_Interpolation, warpAffine, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
- testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))\r
+GPU_PERF_TEST(WarpAffine, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int interpolation = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int interpolation = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- static double reflect[2][3] = { {-1, 0, 0},\r
- { 0, -1, 0}};\r
+ double reflect[2][3] = { {-1, 0, 0},\r
+ { 0, -1, 0}};\r
reflect[0][2] = size.width;\r
reflect[1][2] = size.height;\r
- Mat M(2, 3, CV_64F, (void*)reflect); \r
+ cv::Mat M(2, 3, CV_64F, (void*) reflect); \r
\r
TEST_CYCLE(100)\r
{\r
- warpAffine(src, dst, M, size, interpolation);\r
+ cv::gpu::warpAffine(src, dst, M, size, interpolation);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, WarpAffine, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
+ testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// WarpPerspective\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_Interpolation, warpPerspective, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
- testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))\r
+GPU_PERF_TEST(WarpPerspective, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int interpolation = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int interpolation = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
- static double reflect[3][3] = { {-1, 0, 0},\r
- { 0, -1, 0},\r
- { 0, 0, 1}};\r
+ double reflect[3][3] = { {-1, 0, 0},\r
+ { 0, -1, 0},\r
+ { 0, 0, 1}};\r
reflect[0][2] = size.width;\r
reflect[1][2] = size.height;\r
- Mat M(3, 3, CV_64F, (void*)reflect); \r
+ cv::Mat M(3, 3, CV_64F, (void*)reflect); \r
\r
TEST_CYCLE(100)\r
{\r
- warpPerspective(src, dst, M, size, interpolation);\r
+ cv::gpu::warpPerspective(src, dst, M, size, interpolation);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, WarpPerspective, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
+ testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BuildWarpPlaneMaps\r
\r
-PERF_TEST_P(DevInfo_Size, buildWarpPlaneMaps, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(BuildWarpPlaneMaps, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- GpuMat map_x(size, CV_32FC1);\r
- GpuMat map_y(size, CV_32FC1);\r
+ cv::gpu::GpuMat map_x;\r
+ cv::gpu::GpuMat map_y;\r
\r
TEST_CYCLE(100)\r
{\r
- buildWarpPlaneMaps(size, Rect(0, 0, size.width, size.height), Mat::eye(3, 3, CV_32FC1), \r
- Mat::ones(3, 3, CV_32FC1), Mat::zeros(1, 3, CV_32F), 1.0, map_x, map_y);\r
+ cv::gpu::buildWarpPlaneMaps(size, cv::Rect(0, 0, size.width, size.height), cv::Mat::eye(3, 3, CV_32FC1), \r
+ cv::Mat::ones(3, 3, CV_32FC1), cv::Mat::zeros(1, 3, CV_32F), 1.0, map_x, map_y);\r
}\r
+}\r
\r
- Mat map_x_host(map_x);\r
- Mat map_y_host(map_y);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpPlaneMaps, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(map_x_host);\r
- SANITY_CHECK(map_y_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BuildWarpCylindricalMaps\r
\r
-PERF_TEST_P(DevInfo_Size, buildWarpCylindricalMaps, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(BuildWarpCylindricalMaps, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- GpuMat map_x(size, CV_32FC1);\r
- GpuMat map_y(size, CV_32FC1);\r
+ cv::gpu::GpuMat map_x;\r
+ cv::gpu::GpuMat map_y;\r
\r
TEST_CYCLE(100)\r
{\r
- buildWarpCylindricalMaps(size, Rect(0, 0, size.width, size.height), Mat::eye(3, 3, CV_32FC1),\r
- Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);\r
+ cv::gpu::buildWarpCylindricalMaps(size, cv::Rect(0, 0, size.width, size.height), cv::Mat::eye(3, 3, CV_32FC1),\r
+ cv::Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);\r
}\r
+}\r
\r
- Mat map_x_host(map_x);\r
- Mat map_y_host(map_y);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpCylindricalMaps, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(map_x_host);\r
- SANITY_CHECK(map_y_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BuildWarpSphericalMaps\r
\r
-PERF_TEST_P(DevInfo_Size, buildWarpSphericalMaps, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(BuildWarpSphericalMaps, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- GpuMat map_x(size, CV_32FC1);\r
- GpuMat map_y(size, CV_32FC1);\r
+ cv::gpu::GpuMat map_x;\r
+ cv::gpu::GpuMat map_y;\r
\r
TEST_CYCLE(100)\r
{\r
- buildWarpSphericalMaps(size, Rect(0, 0, size.width, size.height), Mat::eye(3, 3, CV_32FC1),\r
- Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);\r
+ cv::gpu::buildWarpSphericalMaps(size, cv::Rect(0, 0, size.width, size.height), cv::Mat::eye(3, 3, CV_32FC1),\r
+ cv::Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);\r
}\r
+}\r
\r
- Mat map_x_host(map_x);\r
- Mat map_y_host(map_y);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpSphericalMaps, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(map_x_host);\r
- SANITY_CHECK(map_y_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Rotate\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_Interpolation, rotate, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4),\r
- testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))\r
+GPU_PERF_TEST(Rotate, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int interpolation = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int interpolation = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- rotate(src, dst, size, 30.0, 0, 0, interpolation);\r
+ cv::gpu::rotate(src, dst, size, 30.0, 0, 0, interpolation);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Rotate, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4),\r
+ testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// CopyMakeBorder\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_BorderMode, copyMakeBorder, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1), \r
- testing::Values((int)BORDER_REPLICATE, (int)BORDER_CONSTANT)))\r
+GPU_PERF_TEST(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, perf::MatType, BorderMode)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
- int borderType = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
+ int borderType = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);\r
+ cv::gpu::copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, CopyMakeBorder, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
+ testing::Values((int) cv::BORDER_REPLICATE, (int) cv::BORDER_REFLECT, (int) cv::BORDER_WRAP, (int) cv::BORDER_CONSTANT)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Integral\r
\r
-PERF_TEST_P(DevInfo_Size, integralBuffered, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(Integral, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
+ cv::Mat src_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
+ cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE(100)\r
{\r
- integralBuffered(src, dst, buf);\r
+ cv::gpu::integralBuffered(src, dst, buf);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Integral, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// IntegralBoth\r
\r
-PERF_TEST_P(DevInfo_Size, integral, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(IntegralBoth, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
+ cv::Mat src_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat sum, sqsum;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat sum, sqsum;\r
\r
TEST_CYCLE(100)\r
{\r
- integral(src, sum, sqsum);\r
+ cv::gpu::integral(src, sum, sqsum);\r
}\r
+}\r
\r
- Mat sum_host(sum);\r
- Mat sqsum_host(sqsum);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, IntegralBoth, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(sum_host);\r
- SANITY_CHECK(sqsum_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// IntegralSqr\r
\r
-PERF_TEST_P(DevInfo_Size, sqrIntegral, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(IntegralSqr, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
+ cv::Mat src_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- sqrIntegral(src, dst);\r
+ cv::gpu::sqrIntegral(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, IntegralSqr, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// ColumnSum\r
\r
-PERF_TEST_P(DevInfo_Size, columnSum, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(ColumnSum, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_32FC1);\r
+ cv::Mat src_host(size, CV_32FC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- columnSum(src, dst);\r
+ cv::gpu::columnSum(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, ColumnSum, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// CornerHarris\r
\r
-PERF_TEST_P(DevInfo_MatType, cornerHarris, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(CV_8UC1, CV_32FC1)))\r
+GPU_PERF_TEST(CornerHarris, cv::gpu::DeviceInfo, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- int type = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ int type = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);\r
ASSERT_FALSE(img.empty());\r
\r
img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);\r
\r
- GpuMat src(img);\r
- GpuMat dst;\r
- GpuMat Dx;\r
- GpuMat Dy;\r
+ cv::gpu::GpuMat src(img);\r
+ cv::gpu::GpuMat dst;\r
+ cv::gpu::GpuMat Dx;\r
+ cv::gpu::GpuMat Dy;\r
\r
int blockSize = 3;\r
int ksize = 7; \r
\r
TEST_CYCLE(100)\r
{\r
- cornerHarris(src, dst, Dx, Dy, blockSize, ksize, k);\r
+ cv::gpu::cornerHarris(src, dst, Dx, Dy, blockSize, ksize, k);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
- Mat Dx_host(Dx);\r
- Mat Dy_host(Dy);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, CornerHarris, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(CV_8UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
- SANITY_CHECK(Dx_host);\r
- SANITY_CHECK(Dy_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// CornerMinEigenVal\r
\r
-PERF_TEST_P(DevInfo_MatType, cornerMinEigenVal, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(CV_8UC1, CV_32FC1)))\r
+GPU_PERF_TEST(CornerMinEigenVal, cv::gpu::DeviceInfo, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- int type = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ int type = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);\r
ASSERT_FALSE(img.empty());\r
\r
img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);\r
\r
- GpuMat src(img);\r
- GpuMat dst;\r
- GpuMat Dx;\r
- GpuMat Dy;\r
+ cv::gpu::GpuMat src(img);\r
+ cv::gpu::GpuMat dst;\r
+ cv::gpu::GpuMat Dx;\r
+ cv::gpu::GpuMat Dy;\r
\r
int blockSize = 3;\r
int ksize = 7; \r
\r
TEST_CYCLE(100)\r
{\r
- cornerMinEigenVal(src, dst, Dx, Dy, blockSize, ksize);\r
+ cv::gpu::cornerMinEigenVal(src, dst, Dx, Dy, blockSize, ksize);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
- Mat Dx_host(Dx);\r
- Mat Dy_host(Dy);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, CornerMinEigenVal, testing::Combine(\r
+ ALL_DEVICES, \r
+ testing::Values(CV_8UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
- SANITY_CHECK(Dx_host);\r
- SANITY_CHECK(Dy_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// MulSpectrums\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, mulSpectrums, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES),\r
- testing::Values(CV_8UC1, CV_32FC1)))\r
+GPU_PERF_TEST(MulSpectrums, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat a_host(size, CV_32FC2);\r
- Mat b_host(size, CV_32FC2);\r
+ cv::Mat a_host(size, CV_32FC2);\r
+ cv::Mat b_host(size, CV_32FC2);\r
\r
declare.in(a_host, b_host, WARMUP_RNG);\r
\r
- GpuMat a(a_host);\r
- GpuMat b(b_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat a(a_host);\r
+ cv::gpu::GpuMat b(b_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- mulSpectrums(a, b, dst, 0);\r
+ cv::gpu::mulSpectrums(a, b, dst, 0);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, MulSpectrums, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Dft\r
\r
-PERF_TEST_P(DevInfo_Size, dft, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(Dft, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_32FC2);\r
+ cv::Mat src_host(size, CV_32FC2);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
declare.time(2.0);\r
\r
TEST_CYCLE(100)\r
{\r
- dft(src, dst, size);\r
+ cv::gpu::dft(src, dst, size);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Dft, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Convolve\r
\r
-PERF_TEST_P(DevInfo_Int_Int, convolve, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(512, 1024, 1536, 2048, 2560, 3072, 3584),\r
- testing::Values(3, 9, 27, 32, 64)))\r
+GPU_PERF_TEST(Convolve, cv::gpu::DeviceInfo, cv::Size, int)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- int image_size = std::tr1::get<1>(GetParam());\r
- int templ_size = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int templ_size = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- GpuMat image = createContinuous(image_size, image_size, CV_32FC1);\r
- GpuMat templ = createContinuous(templ_size, templ_size, CV_32FC1);\r
+ cv::gpu::GpuMat image = cv::gpu::createContinuous(size, CV_32FC1);\r
+ cv::gpu::GpuMat templ = cv::gpu::createContinuous(templ_size, templ_size, CV_32FC1);\r
\r
- image.setTo(Scalar(1.0));\r
- templ.setTo(Scalar(1.0));\r
+ image.setTo(cv::Scalar(1.0));\r
+ templ.setTo(cv::Scalar(1.0));\r
\r
- GpuMat dst;\r
- ConvolveBuf buf;\r
+ cv::gpu::GpuMat dst;\r
+ cv::gpu::ConvolveBuf buf;\r
\r
declare.time(2.0);\r
\r
TEST_CYCLE(100)\r
{\r
- convolve(image, templ, dst, false, buf);\r
+ cv::gpu::convolve(image, templ, dst, false, buf);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Convolve, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(3, 9, 27, 32, 64)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// PyrDown\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, pyrDown, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES),\r
- testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)))\r
+GPU_PERF_TEST(PyrDown, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- pyrDown(src, dst);\r
+ cv::gpu::pyrDown(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, PyrDown, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// PyrUp\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, pyrUp, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES),\r
- testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)))\r
+GPU_PERF_TEST(PyrUp, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- pyrUp(src, dst);\r
+ cv::gpu::pyrUp(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, PyrUp, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// BlendLinear\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, blendLinear, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES),\r
- testing::Values(CV_8UC1, CV_32FC1)))\r
+GPU_PERF_TEST(BlendLinear, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img1_host(size, type);\r
- Mat img2_host(size, type);\r
+ cv::Mat img1_host(size, type);\r
+ cv::Mat img2_host(size, type);\r
\r
declare.in(img1_host, img2_host, WARMUP_RNG);\r
\r
- GpuMat img1(img1_host);\r
- GpuMat img2(img2_host);\r
- GpuMat weights1(size, CV_32FC1, Scalar::all(0.5));\r
- GpuMat weights2(size, CV_32FC1, Scalar::all(0.5));\r
- GpuMat dst;\r
+ cv::gpu::GpuMat img1(img1_host);\r
+ cv::gpu::GpuMat img2(img2_host);\r
+ cv::gpu::GpuMat weights1(size, CV_32FC1, cv::Scalar::all(0.5));\r
+ cv::gpu::GpuMat weights2(size, CV_32FC1, cv::Scalar::all(0.5));\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- blendLinear(img1, img2, weights1, weights2, dst);\r
+ cv::gpu::blendLinear(img1, img2, weights1, weights2, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, BlendLinear, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(CV_8UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Canny\r
\r
-PERF_TEST_P(DevInfo, Canny, testing::ValuesIn(devices()))\r
+GPU_PERF_TEST_1(Canny, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat image_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat image_host = readImage("perf/1280x1024.jpg", cv::IMREAD_GRAYSCALE);\r
ASSERT_FALSE(image_host.empty());\r
\r
- GpuMat image(image_host);\r
- GpuMat dst;\r
- CannyBuf buf;\r
+ cv::gpu::GpuMat image(image_host);\r
+ cv::gpu::GpuMat dst;\r
+ cv::gpu::CannyBuf buf;\r
\r
TEST_CYCLE(100)\r
{\r
- Canny(image, buf, dst, 50.0, 100.0);\r
+ cv::gpu::Canny(image, buf, dst, 50.0, 100.0);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(ImgProc, Canny, ALL_DEVICES);\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// CalcHist\r
\r
-PERF_TEST_P(DevInfo_Size, calcHist, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+GPU_PERF_TEST(CalcHist, cv::gpu::DeviceInfo, cv::Size)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
+ cv::Mat src_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat hist;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat hist;\r
+ cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE(100)\r
{\r
- calcHist(src, hist, buf);\r
+ cv::gpu::calcHist(src, hist, buf);\r
}\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(ImgProc, CalcHist, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// EqualizeHist\r
+\r
+GPU_PERF_TEST(EqualizeHist, cv::gpu::DeviceInfo, cv::Size)\r
+{\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat hist_host(hist);\r
+ cv::Mat src_host(size, CV_8UC1);\r
\r
- SANITY_CHECK(hist_host);\r
+ declare.in(src_host, WARMUP_RNG);\r
+\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
+ cv::gpu::GpuMat hist;\r
+ cv::gpu::GpuMat buf;\r
+\r
+ TEST_CYCLE(100)\r
+ {\r
+ cv::gpu::equalizeHist(src, dst, hist, buf);\r
+ }\r
}\r
\r
-PERF_TEST_P(DevInfo_Size, equalizeHist, testing::Combine(testing::ValuesIn(devices()),\r
- testing::Values(GPU_TYPICAL_MAT_SIZES)))\r
+INSTANTIATE_TEST_CASE_P(ImgProc, EqualizeHist, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES));\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// ImagePyramid\r
+\r
+GPU_PERF_TEST(ImagePyramid_build, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, CV_8UC1);\r
+ cv::Mat src_host(size, type);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst;\r
- GpuMat hist;\r
- GpuMat buf;\r
+ cv::gpu::GpuMat src(src_host);\r
\r
+ cv::gpu::ImagePyramid pyr;\r
+ \r
TEST_CYCLE(100)\r
{\r
- equalizeHist(src, dst, hist, buf);\r
+ pyr.build(src, 5);\r
}\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_build, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));\r
\r
- Mat dst_host(dst);\r
+GPU_PERF_TEST(ImagePyramid_getLayer, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
+{\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- SANITY_CHECK(dst_host);\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
+\r
+ cv::Mat src_host(size, type);\r
+\r
+ declare.in(src_host, WARMUP_RNG);\r
+\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
+\r
+ cv::gpu::ImagePyramid pyr(src, 3);\r
+ \r
+ TEST_CYCLE(100)\r
+ {\r
+ pyr.getLayer(dst, cv::Size(size.width / 2 + 10, size.height / 2 + 10));\r
+ }\r
}\r
+\r
+INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_getLayer, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));\r
+\r
+#endif\r
int main(int argc, char **argv)\r
{\r
testing::InitGoogleTest(&argc, argv);\r
- Regression::Init("gpu");\r
- TestBase::Init(argc, argv);\r
+ perf::TestBase::Init(argc, argv);\r
return RUN_ALL_TESTS();\r
}\r
\r
#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, merge, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+#ifdef HAVE_CUDA\r
+\r
+//////////////////////////////////////////////////////////////////////\r
+// Merge\r
+\r
+GPU_PERF_TEST(Merge, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
const int num_channels = 4;\r
\r
- vector<GpuMat> src(num_channels);\r
+ std::vector<cv::gpu::GpuMat> src(num_channels);\r
for (int i = 0; i < num_channels; ++i)\r
- src[i] = GpuMat(size, type, cv::Scalar::all(i)); \r
+ src[i] = cv::gpu::GpuMat(size, type, cv::Scalar::all(i)); \r
\r
- GpuMat dst(size, CV_MAKETYPE(type, num_channels));\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- merge(src, dst);\r
+ cv::gpu::merge(src, dst);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(MatOp, Merge, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// Split\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, split, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+GPU_PERF_TEST(Split, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
const int num_channels = 4;\r
\r
- GpuMat src(size, CV_MAKETYPE(type, num_channels), cv::Scalar(1, 2, 3, 4));\r
+ cv::gpu::GpuMat src(size, CV_MAKETYPE(type, num_channels), cv::Scalar(1, 2, 3, 4));\r
\r
- vector<GpuMat> dst(num_channels);\r
+ std::vector<cv::gpu::GpuMat> dst(num_channels);\r
for (int i = 0; i < num_channels; ++i)\r
- dst[i] = GpuMat(size, type); \r
+ dst[i] = cv::gpu::GpuMat(size, type); \r
\r
TEST_CYCLE(100)\r
{\r
- split(src, dst);\r
+ cv::gpu::split(src, dst);\r
}\r
+}\r
\r
- vector<Mat> dst_host(dst.size());\r
- for (size_t i = 0; i < dst.size(); ++i)\r
- dst[i].download(dst_host[i]);\r
+INSTANTIATE_TEST_CASE_P(MatOp, Split, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// SetTo\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, setTo, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1)))\r
+GPU_PERF_TEST(SetTo, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- GpuMat src(size, type);\r
- Scalar val(1, 2, 3, 4);\r
+ cv::gpu::GpuMat src(size, type);\r
+ cv::Scalar val(1, 2, 3, 4);\r
\r
TEST_CYCLE(100)\r
{\r
src.setTo(val);\r
}\r
+}\r
\r
- Mat src_host(src);\r
+INSTANTIATE_TEST_CASE_P(MatOp, SetTo, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));\r
\r
- SANITY_CHECK(src_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// SetToMasked\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, setToMasked, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1)))\r
+GPU_PERF_TEST(SetToMasked, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
+ cv::Mat mask_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
+ fill(mask_host, 0, 2);\r
\r
- GpuMat src(src_host);\r
- Scalar val(1, 2, 3, 4);\r
-\r
- Mat mask_host(size, CV_8UC1);\r
- randu(mask_host, 0.0, 2.0);\r
- GpuMat mask(mask_host);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::Scalar val(1, 2, 3, 4);\r
+ cv::gpu::GpuMat mask(mask_host);\r
\r
TEST_CYCLE(100)\r
{\r
src.setTo(val, mask);\r
}\r
+}\r
\r
- src.download(src_host);\r
+INSTANTIATE_TEST_CASE_P(MatOp, SetToMasked, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));\r
\r
- SANITY_CHECK(src_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// CopyToMasked\r
\r
-PERF_TEST_P(DevInfo_Size_MatType, copyToMasked, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_8UC4, CV_32FC1)))\r
+GPU_PERF_TEST(CopyToMasked, cv::gpu::DeviceInfo, cv::Size, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type = std::tr1::get<2>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type = GET_PARAM(2);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type);\r
+ cv::Mat src_host(size, type);\r
+ cv::Mat mask_host(size, CV_8UC1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
+ fill(mask_host, 0, 2);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type);\r
-\r
- Mat mask_host(size, CV_8UC1);\r
- randu(mask_host, 0.0, 2.0);\r
- GpuMat mask(mask_host);\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat mask(mask_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
src.copyTo(dst, mask);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(MatOp, CopyToMasked, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+//////////////////////////////////////////////////////////////////////\r
+// ConvertTo\r
\r
-PERF_TEST_P(DevInfo_Size_MatType_MatType, convertTo, testing::Combine(testing::ValuesIn(devices()), \r
- testing::Values(GPU_TYPICAL_MAT_SIZES), \r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1),\r
- testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))\r
+GPU_PERF_TEST(ConvertTo, cv::gpu::DeviceInfo, cv::Size, perf::MatType, perf::MatType)\r
{\r
- DeviceInfo devInfo = std::tr1::get<0>(GetParam());\r
- Size size = std::tr1::get<1>(GetParam());\r
- int type1 = std::tr1::get<2>(GetParam());\r
- int type2 = std::tr1::get<3>(GetParam());\r
+ cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
+ cv::Size size = GET_PARAM(1);\r
+ int type1 = GET_PARAM(2);\r
+ int type2 = GET_PARAM(3);\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat src_host(size, type1);\r
+ cv::Mat src_host(size, type1);\r
\r
declare.in(src_host, WARMUP_RNG);\r
\r
- GpuMat src(src_host);\r
- GpuMat dst(size, type2);\r
-\r
- double a = 0.5;\r
- double b = 1.0;\r
+ cv::gpu::GpuMat src(src_host);\r
+ cv::gpu::GpuMat dst;\r
\r
TEST_CYCLE(100)\r
{\r
- src.convertTo(dst, type2, a, b);\r
+ src.convertTo(dst, type2, 0.5, 1.0);\r
}\r
+}\r
\r
- Mat dst_host(dst);\r
+INSTANTIATE_TEST_CASE_P(MatOp, ConvertTo, testing::Combine(\r
+ ALL_DEVICES, \r
+ GPU_TYPICAL_MAT_SIZES, \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1), \r
+ testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
- SANITY_CHECK(dst_host);\r
-}\r
+#endif\r
#include "perf_precomp.hpp"\r
\r
-PERF_TEST_P(DevInfo, HOGDescriptor, testing::ValuesIn(devices()))\r
+#ifdef HAVE_CUDA\r
+\r
+GPU_PERF_TEST_1(HOG, cv::gpu::DeviceInfo)\r
{\r
- DeviceInfo devInfo = GetParam();\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
\r
- setDevice(devInfo.deviceID());\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
\r
- Mat img_host = readImage("gpu/hog/road.png", CV_LOAD_IMAGE_GRAYSCALE);\r
+ cv::Mat img_host = readImage("gpu/hog/road.png", cv::IMREAD_GRAYSCALE);\r
\r
- GpuMat img(img_host);\r
- vector<Rect> found_locations;\r
+ cv::gpu::GpuMat img(img_host);\r
+ std::vector<cv::Rect> found_locations;\r
\r
- gpu::HOGDescriptor hog;\r
- hog.setSVMDetector(gpu::HOGDescriptor::getDefaultPeopleDetector());\r
+ cv::gpu::HOGDescriptor hog;\r
+ hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());\r
\r
TEST_CYCLE(100)\r
{\r
hog.detectMultiScale(img, found_locations);\r
}\r
}\r
+\r
+INSTANTIATE_TEST_CASE_P(ObjDetect, HOG, ALL_DEVICES);\r
+\r
+#endif\r
#include <iostream>\r
#include "cvconfig.h"\r
#include "opencv2/ts/ts.hpp"\r
+#include "opencv2/ts/ts_perf.hpp"\r
#include "opencv2/core/core.hpp"\r
#include "opencv2/highgui/highgui.hpp"\r
#include "opencv2/gpu/gpu.hpp"\r
#include "perf_precomp.hpp"\r
\r
using namespace std;\r
+using namespace cv;\r
using namespace cv::gpu;\r
\r
-Mat readImage(const string& fileName, int flags)\r
-{\r
- return imread(::perf::TestBase::getDataPath(fileName), flags);\r
-}\r
-\r
-bool supportFeature(const DeviceInfo& info, FeatureSet feature)\r
-{\r
- return TargetArchs::builtWith(feature) && info.supports(feature);\r
-}\r
-\r
-const vector<DeviceInfo>& devices()\r
-{\r
- static vector<DeviceInfo> devs;\r
- static bool first = true;\r
-\r
- if (first)\r
- {\r
- int deviceCount = getCudaEnabledDeviceCount();\r
-\r
- devs.reserve(deviceCount);\r
-\r
- for (int i = 0; i < deviceCount; ++i)\r
- {\r
- DeviceInfo info(i);\r
- if (info.isCompatible())\r
- devs.push_back(info);\r
- }\r
-\r
- first = false;\r
- }\r
-\r
- return devs;\r
-}\r
-\r
-vector<DeviceInfo> devices(FeatureSet feature)\r
-{\r
- const vector<DeviceInfo>& d = devices();\r
- \r
- vector<DeviceInfo> devs_filtered;\r
-\r
- if (TargetArchs::builtWith(feature))\r
- {\r
- devs_filtered.reserve(d.size());\r
-\r
- for (size_t i = 0, size = d.size(); i < size; ++i)\r
- {\r
- const DeviceInfo& info = d[i];\r
-\r
- if (info.supports(feature))\r
- devs_filtered.push_back(info);\r
- }\r
- }\r
-\r
- return devs_filtered;\r
-}\r
-\r
-void cv::gpu::PrintTo(const DeviceInfo& info, ostream* os)\r
+void fill(Mat& m, double a, double b)\r
{\r
- *os << info.name();\r
+ RNG rng(123456789);\r
+ rng.fill(m, RNG::UNIFORM, a, b);\r
}\r
\r
-void PrintTo(const CvtColorInfo& info, ::std::ostream* os)\r
+void PrintTo(const CvtColorInfo& info, ostream* os)\r
{\r
static const char* str[] = \r
{\r
\r
*os << str[info.code];\r
}\r
+\r
+void cv::gpu::PrintTo(const DeviceInfo& info, ostream* os)\r
+{\r
+ *os << info.name();\r
+}\r
+\r
+Mat readImage(const string& fileName, int flags)\r
+{\r
+ return imread(perf::TestBase::getDataPath(fileName), flags);\r
+}\r
+\r
+bool supportFeature(const DeviceInfo& info, FeatureSet feature)\r
+{\r
+ return TargetArchs::builtWith(feature) && info.supports(feature);\r
+}\r
+\r
+const vector<DeviceInfo>& devices()\r
+{\r
+ static vector<DeviceInfo> devs;\r
+ static bool first = true;\r
+\r
+ if (first)\r
+ {\r
+ int deviceCount = getCudaEnabledDeviceCount();\r
+\r
+ devs.reserve(deviceCount);\r
+\r
+ for (int i = 0; i < deviceCount; ++i)\r
+ {\r
+ DeviceInfo info(i);\r
+ if (info.isCompatible())\r
+ devs.push_back(info);\r
+ }\r
+\r
+ first = false;\r
+ }\r
+\r
+ return devs;\r
+}\r
+\r
+vector<DeviceInfo> devices(FeatureSet feature)\r
+{\r
+ const vector<DeviceInfo>& d = devices();\r
+ \r
+ vector<DeviceInfo> devs_filtered;\r
+\r
+ if (TargetArchs::builtWith(feature))\r
+ {\r
+ devs_filtered.reserve(d.size());\r
+\r
+ for (size_t i = 0, size = d.size(); i < size; ++i)\r
+ {\r
+ const DeviceInfo& info = d[i];\r
+\r
+ if (info.supports(feature))\r
+ devs_filtered.push_back(info);\r
+ }\r
+ }\r
+\r
+ return devs_filtered;\r
+}\r
+\r
+\r
#ifndef __OPENCV_PERF_GPU_UTILITY_HPP__\r
#define __OPENCV_PERF_GPU_UTILITY_HPP__\r
\r
-#include <iosfwd>\r
-#include "opencv2/ts/ts.hpp"\r
-#include "opencv2/highgui/highgui.hpp"\r
-#include "opencv2/gpu/gpu.hpp"\r
-\r
-using namespace std;\r
-using namespace cv;\r
-using namespace cv::gpu;\r
-using namespace perf;\r
+void fill(cv::Mat& m, double a, double b);\r
\r
enum {HORIZONTAL_AXIS = 0, VERTICAL_AXIS = 1, BOTH_AXIS = -1};\r
\r
-CV_ENUM(MorphOp, MORPH_ERODE, MORPH_DILATE)\r
-CV_ENUM(BorderMode, BORDER_REFLECT101, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_WRAP)\r
+CV_ENUM(MorphOp, cv::MORPH_ERODE, cv::MORPH_DILATE)\r
+CV_ENUM(BorderMode, cv::BORDER_REFLECT101, cv::BORDER_REPLICATE, cv::BORDER_CONSTANT, cv::BORDER_REFLECT, cv::BORDER_WRAP)\r
CV_ENUM(FlipCode, HORIZONTAL_AXIS, VERTICAL_AXIS, BOTH_AXIS)\r
-CV_ENUM(CmpOp, CMP_EQ, CMP_GT, CMP_GE, CMP_LT, CMP_LE, CMP_NE)\r
-CV_ENUM(Interpolation, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC)\r
-CV_ENUM(MatchMethod, TM_SQDIFF, TM_SQDIFF_NORMED, TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED)\r
-CV_ENUM(NormType, NORM_INF, NORM_L1, NORM_L2)\r
+CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC)\r
+CV_ENUM(MatchMethod, cv::TM_SQDIFF, cv::TM_SQDIFF_NORMED, cv::TM_CCORR, cv::TM_CCORR_NORMED, cv::TM_CCOEFF, cv::TM_CCOEFF_NORMED)\r
+CV_ENUM(NormType, cv::NORM_INF, cv::NORM_L1, cv::NORM_L2)\r
\r
struct CvtColorInfo\r
{\r
explicit CvtColorInfo(int scn_=0, int dcn_=0, int code_=0) : scn(scn_), dcn(dcn_), code(code_) {}\r
};\r
\r
-typedef TestBaseWithParam<DeviceInfo> DevInfo;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size> > DevInfo_Size;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, int, int> > DevInfo_Int_Int;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, MatType> > DevInfo_MatType;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType> > DevInfo_Size_MatType;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, MatType> > DevInfo_Size_MatType_MatType;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, int> > DevInfo_Size_MatType_KernelSize;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, MorphOp, int> > DevInfo_Size_MatType_MorphOp_KernelSize;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, int, BorderMode> > DevInfo_Size_MatType_KernelSize_BorderMode;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, FlipCode> > DevInfo_Size_MatType_FlipCode;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, CmpOp> > DevInfo_Size_MatType_CmpOp;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, Interpolation> > DevInfo_Size_MatType_Interpolation;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, Interpolation, double> > DevInfo_Size_MatType_Interpolation_SizeCoeff;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, Interpolation, BorderMode> > DevInfo_Size_MatType_Interpolation_BorderMode;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, CvtColorInfo> > DevInfo_Size_MatType_CvtColorInfo;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, MatchMethod> > DevInfo_Size_MatType_MatchMethod;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, NormType> > DevInfo_Size_NormType;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, NormType> > DevInfo_Size_MatType_NormType;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, int> > DevInfo_DescSize;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, int, int> > DevInfo_K_DescSize;\r
-typedef TestBaseWithParam< std::tr1::tuple<DeviceInfo, Size, MatType, BorderMode> > DevInfo_Size_MatType_BorderMode;\r
-\r
-const cv::Size sz1800x1500 = cv::Size(1800, 1500);\r
-const cv::Size sz4700x3000 = cv::Size(4700, 3000);\r
-\r
-//#define GPU_TYPICAL_MAT_SIZES szXGA, szSXGA, sz720p, sz1080p, sz1800x1500, sz4700x3000\r
-#define GPU_TYPICAL_MAT_SIZES szSXGA, sz1080p, sz4700x3000\r
-\r
-//! read image from testdata folder.\r
-Mat readImage(const string& fileName, int flags = CV_LOAD_IMAGE_COLOR);\r
-\r
-//! return true if device supports specified feature and gpu module was built with support the feature.\r
+void PrintTo(const CvtColorInfo& info, std::ostream* os);\r
+\r
+namespace cv { namespace gpu\r
+{\r
+ void PrintTo(const cv::gpu::DeviceInfo& info, std::ostream* os);\r
+}}\r
+\r
+#define GPU_PERF_TEST(name, ...) \\r
+ struct name : perf::TestBaseWithParam< std::tr1::tuple< __VA_ARGS__ > > \\r
+ { \\r
+ public: \\r
+ name() {} \\r
+ protected: \\r
+ void PerfTestBody(); \\r
+ }; \\r
+ TEST_P(name, perf){ RunPerfTestBody(); } \\r
+ void name :: PerfTestBody()\r
+\r
+#define GPU_PERF_TEST_1(name, param_type) \\r
+ struct name : perf::TestBaseWithParam< param_type > \\r
+ { \\r
+ public: \\r
+ name() {} \\r
+ protected: \\r
+ void PerfTestBody(); \\r
+ }; \\r
+ TEST_P(name, perf){ RunPerfTestBody(); } \\r
+ void name :: PerfTestBody()\r
+\r
+#define GPU_TYPICAL_MAT_SIZES testing::Values(perf::szSXGA, perf::sz1080p, cv::Size(1800, 1500))\r
+\r
+cv::Mat readImage(const std::string& fileName, int flags = cv::IMREAD_COLOR);\r
+\r
bool supportFeature(const cv::gpu::DeviceInfo& info, cv::gpu::FeatureSet feature);\r
\r
-//! return all devices compatible with current gpu module build.\r
const std::vector<cv::gpu::DeviceInfo>& devices();\r
-//! return all devices compatible with current gpu module build which support specified feature.\r
+\r
std::vector<cv::gpu::DeviceInfo> devices(cv::gpu::FeatureSet feature);\r
\r
-namespace cv\r
-{\r
- namespace gpu\r
- {\r
- void PrintTo(const DeviceInfo& info, ::std::ostream* os);\r
- }\r
-}\r
+#define ALL_DEVICES testing::ValuesIn(devices())\r
+#define DEVICES(feature) testing::ValuesIn(devices(feature))\r
\r
-void PrintTo(const CvtColorInfo& info, ::std::ostream* os);\r
+#define GET_PARAM(k) std::tr1::get< k >(GetParam())\r
\r
#endif // __OPENCV_PERF_GPU_UTILITY_HPP__\r
--- /dev/null
+#include "perf_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
+\r
+//////////////////////////////////////////////////////\r
+// BroxOpticalFlow\r
+\r
+GPU_PERF_TEST_1(BroxOpticalFlow, cv::gpu::DeviceInfo)\r
+{\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
+\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
+\r
+ cv::Mat frame0_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat frame1_host = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE);\r
+\r
+ ASSERT_FALSE(frame0_host.empty());\r
+ ASSERT_FALSE(frame1_host.empty());\r
+\r
+ frame0_host.convertTo(frame0_host, CV_32FC1, 1.0 / 255.0);\r
+ frame1_host.convertTo(frame1_host, CV_32FC1, 1.0 / 255.0);\r
+\r
+ cv::gpu::GpuMat frame0(frame0_host);\r
+ cv::gpu::GpuMat frame1(frame1_host);\r
+ cv::gpu::GpuMat u; \r
+ cv::gpu::GpuMat v;\r
+\r
+ cv::gpu::BroxOpticalFlow d_flow(0.197f /*alpha*/, 50.0f /*gamma*/, 0.8f /*scale_factor*/, \r
+ 10 /*inner_iterations*/, 77 /*outer_iterations*/, 10 /*solver_iterations*/);\r
+\r
+ declare.time(10);\r
+\r
+ TEST_CYCLE(100)\r
+ {\r
+ d_flow(frame0, frame1, u, v);\r
+ }\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(Video, BroxOpticalFlow, ALL_DEVICES);\r
+\r
+//////////////////////////////////////////////////////\r
+// InterpolateFrames\r
+\r
+GPU_PERF_TEST_1(InterpolateFrames, cv::gpu::DeviceInfo)\r
+{\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
+\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
+\r
+ cv::Mat frame0_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat frame1_host = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE);\r
+\r
+ ASSERT_FALSE(frame0_host.empty());\r
+ ASSERT_FALSE(frame1_host.empty());\r
+\r
+ frame0_host.convertTo(frame0_host, CV_32FC1, 1.0 / 255.0);\r
+ frame1_host.convertTo(frame1_host, CV_32FC1, 1.0 / 255.0);\r
+\r
+ cv::gpu::GpuMat frame0(frame0_host);\r
+ cv::gpu::GpuMat frame1(frame1_host);\r
+ cv::gpu::GpuMat fu, fv; \r
+ cv::gpu::GpuMat bu, bv;\r
+\r
+ cv::gpu::BroxOpticalFlow d_flow(0.197f /*alpha*/, 50.0f /*gamma*/, 0.8f /*scale_factor*/, \r
+ 10 /*inner_iterations*/, 77 /*outer_iterations*/, 10 /*solver_iterations*/);\r
+ \r
+ d_flow(frame0, frame1, fu, fv);\r
+ d_flow(frame1, frame0, bu, bv);\r
+\r
+ cv::gpu::GpuMat newFrame;\r
+ cv::gpu::GpuMat buf;\r
+\r
+ TEST_CYCLE(100)\r
+ {\r
+ cv::gpu::interpolateFrames(frame0, frame1, fu, fv, bu, bv, 0.5f, newFrame, buf);\r
+ }\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(Video, InterpolateFrames, ALL_DEVICES);\r
+\r
+#endif\r