if("${the_target}" MATCHES "^opencv_test_.*$")
SET(pch_path "test/test_")
elseif("${the_target}" MATCHES "opencv_perf_gpu_cpu")
- SET(pch_path "perf_cpu/perf_")
+ SET(pch_path "perf_cpu/perf_cpu_")
elseif("${the_target}" MATCHES "^opencv_perf_.*$")
SET(pch_path "perf/perf_")
else()
set(perf_cpu_path "${CMAKE_CURRENT_SOURCE_DIR}/perf_cpu")
if(BUILD_PERF_TESTS AND EXISTS "${perf_cpu_path}")
# opencv_highgui is required for imread/imwrite
- set(perf_deps ${the_module} opencv_ts opencv_highgui)
+ set(perf_deps ${the_module} opencv_ts opencv_highgui opencv_imgproc opencv_calib3d opencv_objdetect opencv_video opencv_nonfree)
ocv_check_dependencies(${perf_deps})
if(OCV_DEPENDENCIES_FOUND)
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
\r
GPU_PERF_TEST(Transpose, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::transpose(src, dst);\r
+ cv::transpose(src, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, Transpose, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_32SC1, CV_64FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Flip, cv::gpu::DeviceInfo, cv::Size, perf::MatType, FlipCode)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::flip(src, dst, flipCode);\r
+ cv::flip(src, dst, flipCode);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, Flip, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_8UC4, CV_32FC1, CV_32FC4),\r
testing::Values((int) HORIZONTAL_AXIS, (int) VERTICAL_AXIS, (int) BOTH_AXIS)));\r
\r
\r
GPU_PERF_TEST(LUT, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
cv::Mat lut(1, 256, CV_8UC1);\r
\r
- declare.in(src_host, lut, WARMUP_RNG);\r
+ declare.in(src, lut, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::LUT(src, lut, dst);\r
+ cv::LUT(src, lut, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, LUT, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_8UC3)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(CartToPolar, 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
+ cv::Mat x(size, CV_32FC1);\r
+ cv::Mat y(size, CV_32FC1);\r
\r
- cv::Mat x_host(size, CV_32FC1);\r
- cv::Mat y_host(size, CV_32FC1);\r
+ fill(x, -100.0, 100.0);\r
+ fill(y, -100.0, 100.0);\r
\r
- fill(x_host, -100.0, 100.0);\r
- fill(y_host, -100.0, 100.0);\r
-\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
+ cv::Mat magnitude;\r
+ cv::Mat angle;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::cartToPolar(x, y, magnitude, angle);\r
+ cv::cartToPolar(x, y, magnitude, angle);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, CartToPolar, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
GPU_TYPICAL_MAT_SIZES));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(PolarToCart, 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
- cv::Mat magnitude_host(size, CV_32FC1);\r
- cv::Mat angle_host(size, CV_32FC1);\r
+ cv::Mat magnitude(size, CV_32FC1);\r
+ cv::Mat angle(size, CV_32FC1);\r
\r
- fill(magnitude_host, 0.0, 100.0);\r
- fill(angle_host, 0.0, 360.0);\r
+ fill(magnitude, 0.0, 100.0);\r
+ fill(angle, 0.0, 360.0);\r
\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
+ cv::Mat x;\r
+ cv::Mat y;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::polarToCart(magnitude, angle, x, y, true);\r
+ cv::polarToCart(magnitude, angle, x, y, true);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, PolarToCart, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
GPU_TYPICAL_MAT_SIZES));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(AddMat, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src1_host(size, type);\r
- cv::Mat src2_host(size, type);\r
+ cv::Mat src1(size, type);\r
+ cv::Mat src2(size, type);\r
\r
- fill(src1_host, 0.0, 100.0);\r
- fill(src2_host, 0.0, 100.0);\r
+ fill(src1, 0.0, 100.0);\r
+ fill(src2, 0.0, 100.0);\r
\r
- cv::gpu::GpuMat src1(src1_host);\r
- cv::gpu::GpuMat src2(src2_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::add(src1, src2, dst);\r
+ cv::add(src1, src2, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, AddMat, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(AddScalar, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ fill(src, 0.0, 100.0);\r
\r
- fill(src_host, 0.0, 100.0);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
cv::Scalar s(1,2,3,4);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::add(src, s, dst);\r
+ cv::add(src, s, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, AddScalar, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Exp, 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
- cv::Mat src_host(size, CV_32FC1);\r
+ cv::Mat src(size, CV_32FC1);\r
\r
- fill(src_host, 0.0, 10.0);\r
+ fill(src, 0.0, 10.0);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::exp(src, dst);\r
+ cv::exp(src, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, Exp, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
GPU_TYPICAL_MAT_SIZES));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Pow, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::pow(src, 0.5, dst);\r
+ cv::pow(src, 0.5, dst);\r
}\r
}\r
\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
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
+ testing::Values(perf::MatType(CV_32FC1))));\r
\r
//////////////////////////////////////////////////////////////////////\r
// Compare\r
\r
GPU_PERF_TEST(Compare, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src1(size, type);\r
+ cv::Mat src2(size, type);\r
\r
- cv::Mat src1_host(size, type);\r
- cv::Mat src2_host(size, type);\r
+ declare.in(src1, src2, WARMUP_RNG);\r
\r
- declare.in(src1_host, src2_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src1(src1_host);\r
- cv::gpu::GpuMat src2(src2_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::compare(src1, src2, dst, cv::CMP_EQ);\r
+ cv::compare(src1, src2, dst, cv::CMP_EQ);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, Compare, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(BitwiseNot, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::bitwise_not(src, dst);\r
+ cv::bitwise_not(src, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, BitwiseNot, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(BitwiseAnd, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src1_host(size, type);\r
- cv::Mat src2_host(size, type);\r
+ cv::Mat src1(size, type);\r
+ cv::Mat src2(size, type);\r
\r
- declare.in(src1_host, src2_host, WARMUP_RNG);\r
+ declare.in(src1, src2, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src1(src1_host);\r
- cv::gpu::GpuMat src2(src2_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::bitwise_and(src1, src2, dst);\r
+ cv::bitwise_and(src1, src2, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, BitwiseAnd, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));\r
\r
+//////////////////////////////////////////////////////////////////////\r
+// BitwiseScalarAnd\r
+\r
GPU_PERF_TEST(BitwiseScalarAnd, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
cv::Scalar sc = cv::Scalar(123, 123, 123, 123);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::bitwise_and(src, sc, dst);\r
+ cv::bitwise_and(src, sc, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, BitwiseScalarAnd, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32SC1, CV_32SC3, CV_32SC4)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Min, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src1(size, type);\r
+ cv::Mat src2(size, type);\r
\r
- cv::Mat src1_host(size, type);\r
- cv::Mat src2_host(size, type);\r
+ declare.in(src1, src2, WARMUP_RNG);\r
\r
- declare.in(src1_host, src2_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src1(src1_host);\r
- cv::gpu::GpuMat src2(src2_host);\r
- cv::gpu::GpuMat dst(size, type);\r
+ cv::Mat dst(size, type);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::min(src1, src2, dst);\r
+ cv::min(src1, src2, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, Min, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(MeanStdDev, 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
- cv::Mat src_host(size, CV_8UC1);\r
+ cv::Mat src(size, CV_8UC1);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host); \r
cv::Scalar mean;\r
cv::Scalar stddev;\r
- cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::meanStdDev(src, mean, stddev, buf);\r
+ cv::meanStdDev(src, mean, stddev);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, MeanStdDev, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
GPU_TYPICAL_MAT_SIZES));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Norm, cv::gpu::DeviceInfo, cv::Size, perf::MatType, NormType)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
double dst;\r
- cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE()\r
{\r
- dst = cv::gpu::norm(src, normType, buf);\r
+ dst = cv::norm(src, normType);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, Norm, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \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
GPU_PERF_TEST(NormDiff, cv::gpu::DeviceInfo, cv::Size, NormType)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
cv::Size size = GET_PARAM(1);\r
int normType = GET_PARAM(2);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src1(size, CV_8UC1);\r
+ cv::Mat src2(size, CV_8UC1);\r
\r
- cv::Mat src1_host(size, CV_8UC1);\r
- cv::Mat src2_host(size, CV_8UC1);\r
+ declare.in(src1, src2, WARMUP_RNG);\r
\r
- declare.in(src1_host, src2_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src1(src1_host);\r
- cv::gpu::GpuMat src2(src2_host);\r
double dst;\r
\r
TEST_CYCLE()\r
{\r
- dst = cv::gpu::norm(src1, src2, normType);\r
+ dst = cv::norm(src1, src2, normType);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, NormDiff, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \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
\r
GPU_PERF_TEST(Sum, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
cv::Scalar dst;\r
- cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE()\r
{\r
- dst = cv::gpu::sum(src, buf);\r
+ dst = cv::sum(src);\r
}\r
}\r
\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
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
- cv::Size size = GET_PARAM(1);\r
- int type = GET_PARAM(2);\r
-\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
- double minVal, maxVal;\r
- cv::gpu::GpuMat buf;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::minMax(src, &minVal, &maxVal, cv::gpu::GpuMat(), buf);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(Arithm, MinMax, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(MinMaxLoc, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
double minVal, maxVal;\r
cv::Point minLoc, maxLoc;\r
- cv::gpu::GpuMat valbuf, locbuf;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::minMaxLoc(src, &minVal, &maxVal, &minLoc, &maxLoc, cv::gpu::GpuMat(), valbuf, locbuf);\r
+ cv::minMaxLoc(src, &minVal, &maxVal, &minLoc, &maxLoc);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, MinMaxLoc, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(CountNonZero, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- fill(src_host, 0.0, 1.0);\r
+ fill(src, 0.0, 1.0);\r
\r
- cv::gpu::GpuMat src(src_host);\r
int dst;\r
- cv::gpu::GpuMat buf;\r
\r
TEST_CYCLE()\r
{\r
- dst = cv::gpu::countNonZero(src, buf);\r
+ dst = cv::countNonZero(src);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, CountNonZero, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(AddWeighted, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src1(size, type);\r
+ cv::Mat src2(size, type);\r
\r
- cv::Mat src1_host(size, type);\r
- cv::Mat src2_host(size, type);\r
+ fill(src1, 0.0, 100.0);\r
+ fill(src2, 0.0, 100.0);\r
\r
- fill(src1_host, 0.0, 100.0);\r
- fill(src2_host, 0.0, 100.0);\r
-\r
- cv::gpu::GpuMat src1(src1_host);\r
- cv::gpu::GpuMat src2(src2_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::addWeighted(src1, 0.5, src2, 0.5, 0.0, dst);\r
+ cv::addWeighted(src1, 0.5, src2, 0.5, 0.0, dst);\r
}\r
-\r
- cv::Mat dst_host(dst);\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, AddWeighted, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Reduce, cv::gpu::DeviceInfo, cv::Size, perf::MatType, FlipCode)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- fill(src_host, 0.0, 10.0);\r
+ fill(src, 0.0, 10.0);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::reduce(src, dst, dim, CV_REDUCE_MIN);\r
+ cv::reduce(src, dst, dim, CV_REDUCE_MIN);\r
}\r
-\r
- cv::Mat dst_host(dst);\r
}\r
\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
+ 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
\r
GPU_PERF_TEST(GEMM, 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
- cv::Mat src1_host(size, CV_32FC1);\r
- cv::Mat src2_host(size, CV_32FC1);\r
- cv::Mat src3_host(size, CV_32FC1);\r
+ cv::Mat src1(size, CV_32FC1);\r
+ cv::Mat src2(size, CV_32FC1);\r
+ cv::Mat src3(size, CV_32FC1);\r
\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
+ fill(src1, 0.0, 10.0);\r
+ fill(src2, 0.0, 10.0);\r
+ fill(src3, 0.0, 10.0);\r
\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
+ cv::Mat dst;\r
\r
- declare.time(5.0);\r
+ declare.time(15.0);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::gemm(src1, src2, 1.0, src3, 1.0, dst);\r
+ cv::gemm(src1, src2, 1.0, src3, 1.0, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Arithm, GEMM, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
testing::Values(cv::Size(512, 512), cv::Size(1024, 1024), cv::Size(2048, 2048))));\r
\r
#endif\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
//////////////////////////////////////////////////////////////////////\r
-// TransformPoints\r
-\r
-GPU_PERF_TEST_1(TransformPoints, cv::gpu::DeviceInfo)\r
-{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(1, 10000, CV_32FC3);\r
-\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::transformPoints(src, cv::Mat::ones(1, 3, CV_32FC1), cv::Mat::ones(1, 3, CV_32FC1), dst);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(Calib3D, TransformPoints, ALL_DEVICES);\r
-\r
-//////////////////////////////////////////////////////////////////////\r
// ProjectPoints\r
\r
GPU_PERF_TEST_1(ProjectPoints, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(1, 10000, CV_32FC3);\r
\r
- cv::Mat src_host(1, 10000, CV_32FC3);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\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
+ cv::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
\r
GPU_PERF_TEST_1(SolvePnPRansac, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
cv::Mat object(1, 10000, CV_32FC3);\r
cv::Mat image(1, 10000, CV_32FC2);\r
\r
\r
TEST_CYCLE()\r
{\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
+ cv::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
\r
\r
GPU_PERF_TEST_1(StereoBM, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
+ cv::Mat img_l = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat img_r = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE);\r
\r
- ASSERT_FALSE(img_l_host.empty());\r
- ASSERT_FALSE(img_r_host.empty());\r
+ ASSERT_FALSE(img_l.empty());\r
+ ASSERT_FALSE(img_r.empty());\r
\r
- cv::gpu::GpuMat img_l(img_l_host);\r
- cv::gpu::GpuMat img_r(img_r_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
- cv::gpu::StereoBM_GPU bm(0, 256);\r
+ cv::StereoBM bm(0, 256);\r
\r
declare.time(5.0);\r
\r
\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
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- cv::gpu::GpuMat img_l(img_l_host);\r
- cv::gpu::GpuMat img_r(img_r_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- cv::gpu::StereoBeliefPropagation bp(64);\r
-\r
- declare.time(10.0);\r
-\r
- TEST_CYCLE()\r
- {\r
- bp(img_l, img_r, dst);\r
- }\r
-}\r
-\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
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- cv::gpu::GpuMat img_l(img_l_host);\r
- cv::gpu::GpuMat img_r(img_r_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- cv::gpu::StereoConstantSpaceBP bp(128);\r
-\r
- declare.time(10.0);\r
-\r
- TEST_CYCLE()\r
- {\r
- bp(img_l, img_r, dst);\r
- }\r
-}\r
-\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
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- cv::gpu::GpuMat img(img_host);\r
- cv::gpu::GpuMat disp(disp_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- cv::gpu::DisparityBilateralFilter f(128);\r
-\r
- TEST_CYCLE()\r
- {\r
- f(disp, img, dst);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(Calib3D, DisparityBilateralFilter, ALL_DEVICES);\r
-\r
#endif\r
\r
--- /dev/null
+#include "perf_cpu_precomp.hpp"
-#ifndef __OPENCV_PERF_PRECOMP_HPP__\r
-#define __OPENCV_PERF_PRECOMP_HPP__\r
+#ifndef __OPENCV_PERF_CPU_PRECOMP_HPP__\r
+#define __OPENCV_PERF_CPU_PRECOMP_HPP__\r
\r
#include <cstdio>\r
#include <iostream>\r
+\r
#include "cvconfig.h"\r
+\r
#include "opencv2/ts/ts.hpp"\r
#include "opencv2/ts/ts_perf.hpp"\r
+\r
#include "opencv2/core/core.hpp"\r
#include "opencv2/highgui/highgui.hpp"\r
#include "opencv2/gpu/gpu.hpp"\r
+#include "opencv2/imgproc/imgproc.hpp"\r
+#include "opencv2/video/video.hpp"\r
+#include "opencv2/calib3d/calib3d.hpp"\r
+#include "opencv2/nonfree/nonfree.hpp"\r
+\r
#include "perf_utility.hpp"\r
\r
#if GTEST_CREATE_SHARED_LIBRARY\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
\r
GPU_PERF_TEST(BruteForceMatcher_match, cv::gpu::DeviceInfo, int)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
int desc_size = GET_PARAM(1);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat query(3000, desc_size, CV_32FC1);\r
+ cv::Mat train(3000, desc_size, CV_32FC1);\r
\r
- cv::Mat query_host(3000, desc_size, CV_32FC1);\r
- cv::Mat train_host(3000, desc_size, CV_32FC1);\r
+ declare.in(query, train, WARMUP_RNG);\r
\r
- declare.in(query_host, train_host, WARMUP_RNG);\r
+ cv::BFMatcher matcher(cv::NORM_L2);\r
+ std::vector<cv::DMatch> matches;\r
\r
- cv::gpu::GpuMat query(query_host);\r
- cv::gpu::GpuMat train(train_host);\r
- cv::gpu::GpuMat trainIdx, distance;\r
-\r
- cv::gpu::BFMatcher_GPU matcher(cv::NORM_L2);\r
-\r
- declare.time(3.0);\r
+ declare.time(10.0);\r
\r
TEST_CYCLE()\r
{\r
- matcher.matchSingle(query, train, trainIdx, distance);\r
+ matcher.match(query, train, matches);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Features2D, BruteForceMatcher_match, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
testing::Values(64, 128, 256)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(BruteForceMatcher_knnMatch, cv::gpu::DeviceInfo, int, int)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
int desc_size = GET_PARAM(1);\r
int k = GET_PARAM(2);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
+ cv::Mat query(3000, desc_size, CV_32FC1);\r
+ cv::Mat train(3000, desc_size, CV_32FC1);\r
\r
- cv::gpu::GpuMat query(query_host);\r
- cv::gpu::GpuMat train(train_host);\r
- cv::gpu::GpuMat trainIdx, distance, allDist;\r
+ declare.in(query, train, WARMUP_RNG);\r
\r
- cv::gpu::BFMatcher_GPU matcher(cv::NORM_L2);\r
+ cv::BFMatcher matcher(cv::NORM_L2);\r
+ std::vector< std::vector<cv::DMatch> > matches;\r
\r
- declare.time(3.0);\r
+ declare.time(10.0);\r
\r
TEST_CYCLE()\r
{\r
- matcher.knnMatchSingle(query, train, trainIdx, distance, allDist, k);\r
+ matcher.knnMatch(query, train, matches, k);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Features2D, BruteForceMatcher_knnMatch, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
testing::Values(64, 128, 256),\r
testing::Values(2, 3)));\r
\r
\r
GPU_PERF_TEST(BruteForceMatcher_radiusMatch, cv::gpu::DeviceInfo, int)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
int desc_size = GET_PARAM(1);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat query(3000, desc_size, CV_32FC1);\r
+ cv::Mat train(3000, desc_size, CV_32FC1);\r
\r
- cv::Mat query_host(3000, desc_size, CV_32FC1);\r
- cv::Mat train_host(3000, desc_size, CV_32FC1);\r
+ fill(query, 0, 1);\r
+ fill(train, 0, 1);\r
\r
- fill(query_host, 0, 1);\r
- fill(train_host, 0, 1);\r
+ cv::BFMatcher matcher(cv::NORM_L2);\r
+ std::vector< std::vector<cv::DMatch> > matches;\r
\r
- cv::gpu::GpuMat query(query_host);\r
- cv::gpu::GpuMat train(train_host);\r
- cv::gpu::GpuMat trainIdx, nMatches, distance;\r
-\r
- cv::gpu::BFMatcher_GPU matcher(cv::NORM_L2);\r
-\r
- declare.time(3.0);\r
+ declare.time(10.0);\r
\r
TEST_CYCLE()\r
{\r
- matcher.radiusMatchSingle(query, train, trainIdx, distance, nMatches, 2.0);\r
+ matcher.radiusMatch(query, train, matches, 2.0);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Features2D, BruteForceMatcher_radiusMatch, testing::Combine(\r
- ALL_DEVICES, \r
+ ALL_DEVICES,\r
testing::Values(64, 128, 256)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST_1(SURF, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat img = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
- cv::Mat img_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ ASSERT_FALSE(img.empty());\r
\r
- ASSERT_FALSE(img_host.empty());\r
+ std::vector<cv::KeyPoint> keypoints;\r
+ cv::Mat descriptors;\r
\r
- cv::gpu::GpuMat img(img_host);\r
- cv::gpu::GpuMat keypoints, descriptors;\r
+ cv::SURF surf;\r
\r
- cv::gpu::SURF_GPU surf;\r
-\r
- declare.time(2.0);\r
+ declare.time(10.0);\r
\r
TEST_CYCLE()\r
{\r
- surf(img, cv::gpu::GpuMat(), keypoints, descriptors);\r
+ surf(img, cv::noArray(), keypoints, descriptors);\r
}\r
}\r
\r
\r
GPU_PERF_TEST_1(FAST, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat img_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat img = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
- ASSERT_FALSE(img_host.empty());\r
+ ASSERT_FALSE(img.empty());\r
\r
- cv::gpu::GpuMat img(img_host);\r
- cv::gpu::GpuMat keypoints, descriptors;\r
-\r
- cv::gpu::FAST_GPU fastGPU(20);\r
+ std::vector<cv::KeyPoint> keypoints;\r
\r
TEST_CYCLE()\r
{\r
- fastGPU(img, cv::gpu::GpuMat(), keypoints);\r
+ cv::FAST(img, keypoints, 20);\r
}\r
}\r
\r
\r
GPU_PERF_TEST_1(ORB, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat img_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat img = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
- ASSERT_FALSE(img_host.empty());\r
+ ASSERT_FALSE(img.empty());\r
\r
- cv::gpu::GpuMat img(img_host);\r
- cv::gpu::GpuMat keypoints, descriptors;\r
+ std::vector<cv::KeyPoint> keypoints;\r
+ cv::Mat descriptors;\r
\r
- cv::gpu::ORB_GPU orbGPU(4000);\r
+ cv::ORB orb(4000);\r
\r
TEST_CYCLE()\r
{\r
- orbGPU(img, cv::gpu::GpuMat(), keypoints, descriptors);\r
+ orb(img, cv::noArray(), keypoints, descriptors);\r
}\r
}\r
\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
\r
GPU_PERF_TEST(BoxFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, int)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ cv::Mat dst(src.size(), src.type());\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createBoxFilter_GPU(type, type, cv::Size(ksize, ksize));\r
+ cv::Ptr<cv::FilterEngine> filter = cv::createBoxFilter(type, type, cv::Size(ksize, ksize));\r
\r
TEST_CYCLE()\r
{\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Filter, BoxFilter, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_8UC4),\r
testing::Values(3, 5)));\r
\r
\r
GPU_PERF_TEST(MorphologyFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, MorphOp, int)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst(src.size(), src.type());\r
\r
- cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createMorphologyFilter_GPU(op, type, cv::Mat::ones(ksize, ksize, CV_8U));\r
+ cv::Ptr<cv::FilterEngine> filter = cv::createMorphologyFilter(op, type, cv::Mat::ones(ksize, ksize, CV_8U));\r
\r
TEST_CYCLE()\r
{\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Filter, MorphologyFilter, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \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
GPU_PERF_TEST(LinearFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, int)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst(src.size(), src.type());\r
\r
- cv::Ptr<cv::gpu::FilterEngine_GPU> filter = cv::gpu::createLinearFilter_GPU(type, type, cv::Mat::ones(ksize, ksize, CV_8U));\r
+ cv::Ptr<cv::FilterEngine> filter = cv::createLinearFilter(type, type, cv::Mat::ones(ksize, ksize, CV_8U));\r
\r
declare.time(1.0);\r
\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Filter, LinearFilter, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
testing::Values(3, 5, 7, 9)));\r
\r
\r
GPU_PERF_TEST(SeparableLinearFilter, cv::gpu::DeviceInfo, cv::Size, perf::MatType, int)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst(src.size(), src.type());\r
\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
+ cv::Ptr<cv::FilterEngine> filter = cv::createSeparableLinearFilter(type, type, kernel, kernel);\r
\r
declare.time(1.0);\r
\r
TEST_CYCLE()\r
{\r
- filter->apply(src, dst, cv::Rect(0, 0, src.cols, src.rows));\r
+ filter->apply(src, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(Filter, SeparableLinearFilter, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),\r
testing::Values(3, 5, 7, 9, 11, 13, 15)));\r
\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
\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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
+ cv::Mat xmap(size, CV_32FC1);\r
+ cv::Mat ymap(size, CV_32FC1);\r
\r
- cv::Mat src_host(size, type);\r
- cv::Mat xmap_host(size, CV_32FC1);\r
- cv::Mat ymap_host(size, CV_32FC1);\r
+ declare.in(src, xmap, ymap, WARMUP_RNG);\r
\r
- declare.in(src_host, xmap_host, ymap_host, WARMUP_RNG);\r
-\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
+ cv::Mat dst;\r
\r
- declare.time(3.0);\r
+ declare.time(10.0);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::remap(src, dst, xmap, ymap, interpolation, borderMode);\r
+ cv::remap(src, dst, xmap, ymap, interpolation, borderMode);\r
}\r
}\r
\r
\r
GPU_PERF_TEST_1(MeanShiftFiltering, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat img = readImage("gpu/meanshift/cones.png");\r
- ASSERT_FALSE(img.empty());\r
-\r
- cv::Mat rgba;\r
- cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);\r
-\r
- cv::gpu::GpuMat src(rgba);\r
- cv::gpu::GpuMat dst;\r
-\r
- declare.time(5.0);\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::meanShiftFiltering(src, dst, 50, 50);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftFiltering, ALL_DEVICES);\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// MeanShiftProc\r
-\r
-GPU_PERF_TEST_1(MeanShiftProc, cv::gpu::DeviceInfo)\r
-{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
cv::Mat img = readImage("gpu/meanshift/cones.png");\r
ASSERT_FALSE(img.empty());\r
\r
- cv::Mat rgba;\r
- cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);\r
-\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()\r
- {\r
- cv::gpu::meanShiftProc(src, dstr, dstsp, 50, 50);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftProc, ALL_DEVICES);\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// MeanShiftSegmentation\r
-\r
-GPU_PERF_TEST_1(MeanShiftSegmentation, cv::gpu::DeviceInfo)\r
-{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat img = readImage("gpu/meanshift/cones.png");\r
- ASSERT_FALSE(img.empty());\r
-\r
- cv::Mat rgba;\r
- cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);\r
-\r
- cv::gpu::GpuMat src(rgba);\r
cv::Mat dst;\r
\r
- declare.time(5.0);\r
+ declare.time(15.0);\r
\r
TEST_CYCLE()\r
{\r
- meanShiftSegmentation(src, dst, 10, 10, 20);\r
+ cv::pyrMeanShiftFiltering(img, dst, 50, 50);\r
}\r
}\r
\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
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
- cv::Size size = GET_PARAM(1);\r
- int type = GET_PARAM(2);\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
-\r
- fill(src_host, 0, 255);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::drawColorDisp(src, dst, 255);\r
- }\r
-}\r
-\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
+INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftFiltering, ALL_DEVICES);\r
\r
//////////////////////////////////////////////////////////////////////\r
// ReprojectImageTo3D\r
\r
GPU_PERF_TEST(ReprojectImageTo3D, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::reprojectImageTo3D(src, dst, cv::Mat::ones(4, 4, CV_32FC1));\r
+ cv::reprojectImageTo3D(src, dst, cv::Mat::ones(4, 4, CV_32FC1));\r
}\r
}\r
\r
\r
GPU_PERF_TEST(CvtColor, cv::gpu::DeviceInfo, cv::Size, perf::MatType, CvtColorInfo)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, CV_MAKETYPE(type, info.scn));\r
+ cv::Mat src(size, CV_MAKETYPE(type, info.scn));\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::cvtColor(src, dst, info.code, info.dcn);\r
+ cv::cvtColor(src, dst, info.code, info.dcn);\r
}\r
}\r
\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
-//////////////////////////////////////////////////////////////////////\r
-// SwapChannels\r
-\r
-GPU_PERF_TEST(SwapChannels, 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
- cv::Mat src_host(size, CV_8UC4);\r
-\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
-\r
- const int dstOrder[] = {2, 1, 0, 3};\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::swapChannels(src, dstOrder);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, SwapChannels, testing::Combine(ALL_DEVICES, GPU_TYPICAL_MAT_SIZES));\r
+ CvtColorInfo(3, 3, cv::COLOR_BGR2XYZ), CvtColorInfo(3, 3, cv::COLOR_BGR2YCrCb), CvtColorInfo(3, 3, cv::COLOR_YCrCb2BGR),\r
+ CvtColorInfo(3, 3, cv::COLOR_BGR2HSV), CvtColorInfo(3, 3, cv::COLOR_HSV2BGR))));\r
\r
//////////////////////////////////////////////////////////////////////\r
// Threshold\r
\r
GPU_PERF_TEST(Threshold, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst(size, type);\r
+ cv::Mat dst(size, type);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::threshold(src, dst, 100.0, 255.0, cv::THRESH_BINARY);\r
+ cv::threshold(src, dst, 100.0, 255.0, cv::THRESH_BINARY);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(Resize, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation, double)\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
double f = GET_PARAM(4);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
declare.time(1.0);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::resize(src, dst, cv::Size(), f, f, interpolation);\r
+ cv::resize(src, dst, cv::Size(), f, f, interpolation);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(WarpAffine, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)\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
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
const double aplha = CV_PI / 4;\r
double mat[2][3] = { {std::cos(aplha), -std::sin(aplha), src.cols / 2},\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::warpAffine(src, dst, M, size, interpolation, cv::BORDER_CONSTANT, cv::Scalar());\r
+ cv::warpAffine(src, dst, M, size, interpolation, cv::BORDER_CONSTANT, cv::Scalar());\r
}\r
}\r
\r
\r
GPU_PERF_TEST(WarpPerspective, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)\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
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
const double aplha = CV_PI / 4;\r
double mat[3][3] = { {std::cos(aplha), -std::sin(aplha), src.cols / 2},\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::warpPerspective(src, dst, M, size, interpolation, cv::BORDER_CONSTANT, cv::Scalar());\r
+ cv::warpPerspective(src, dst, M, size, interpolation, cv::BORDER_CONSTANT, cv::Scalar());\r
}\r
}\r
\r
testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));\r
\r
//////////////////////////////////////////////////////////////////////\r
-// BuildWarpPlaneMaps\r
-\r
-GPU_PERF_TEST(BuildWarpPlaneMaps, 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
- cv::gpu::GpuMat map_x;\r
- cv::gpu::GpuMat map_y;\r
-\r
- TEST_CYCLE()\r
- {\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
-INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpPlaneMaps, testing::Combine(\r
- ALL_DEVICES,\r
- GPU_TYPICAL_MAT_SIZES));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// BuildWarpCylindricalMaps\r
-\r
-GPU_PERF_TEST(BuildWarpCylindricalMaps, 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
- cv::gpu::GpuMat map_x;\r
- cv::gpu::GpuMat map_y;\r
-\r
- TEST_CYCLE()\r
- {\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
-INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpCylindricalMaps, testing::Combine(\r
- ALL_DEVICES,\r
- GPU_TYPICAL_MAT_SIZES));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// BuildWarpSphericalMaps\r
-\r
-GPU_PERF_TEST(BuildWarpSphericalMaps, 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
- cv::gpu::GpuMat map_x;\r
- cv::gpu::GpuMat map_y;\r
-\r
- TEST_CYCLE()\r
- {\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
-INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpSphericalMaps, testing::Combine(\r
- ALL_DEVICES,\r
- GPU_TYPICAL_MAT_SIZES));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// Rotate\r
-\r
-GPU_PERF_TEST(Rotate, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)\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
-\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
- TEST_CYCLE()\r
- {\r
- cv::gpu::rotate(src, dst, size, 30.0, 0, 0, interpolation);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, Rotate, 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
- testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
// CopyMakeBorder\r
\r
GPU_PERF_TEST(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, perf::MatType, 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 borderType = GET_PARAM(3);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat src_host(size, type);\r
+ cv::Mat src(size, type);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);\r
+ cv::copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(Integral, 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
- cv::Mat src_host(size, CV_8UC1);\r
+ cv::Mat src(size, CV_8UC1);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
- cv::gpu::GpuMat buf;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::integralBuffered(src, dst, buf);\r
+ cv::integral(src, dst);\r
}\r
}\r
\r
GPU_TYPICAL_MAT_SIZES));\r
\r
//////////////////////////////////////////////////////////////////////\r
-// IntegralSqr\r
-\r
-GPU_PERF_TEST(IntegralSqr, 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
- cv::Mat src_host(size, CV_8UC1);\r
-\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::sqrIntegral(src, dst);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, IntegralSqr, testing::Combine(\r
- ALL_DEVICES,\r
- GPU_TYPICAL_MAT_SIZES));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// ColumnSum\r
-\r
-GPU_PERF_TEST(ColumnSum, 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
- cv::Mat src_host(size, CV_32FC1);\r
-\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::columnSum(src, dst);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, ColumnSum, testing::Combine(\r
- ALL_DEVICES,\r
- GPU_TYPICAL_MAT_SIZES));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
// CornerHarris\r
\r
GPU_PERF_TEST(CornerHarris, cv::gpu::DeviceInfo, perf::MatType)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
int type = GET_PARAM(1);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- cv::gpu::GpuMat src(img);\r
- cv::gpu::GpuMat dst;\r
- cv::gpu::GpuMat Dx;\r
- cv::gpu::GpuMat Dy;\r
+ cv::Mat dst;\r
\r
int blockSize = 3;\r
int ksize = 7;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::cornerHarris(src, dst, Dx, Dy, blockSize, ksize, k);\r
+ cv::cornerHarris(img, dst, blockSize, ksize, k);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(CornerMinEigenVal, cv::gpu::DeviceInfo, perf::MatType)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
int type = GET_PARAM(1);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- cv::gpu::GpuMat src(img);\r
- cv::gpu::GpuMat dst;\r
- cv::gpu::GpuMat Dx;\r
- cv::gpu::GpuMat Dy;\r
+ cv::Mat dst;\r
\r
int blockSize = 3;\r
int ksize = 7;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::cornerMinEigenVal(src, dst, Dx, Dy, blockSize, ksize);\r
+ cv::cornerMinEigenVal(img, dst, blockSize, ksize);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(MulSpectrums, 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
- cv::Mat a_host(size, CV_32FC2);\r
- cv::Mat b_host(size, CV_32FC2);\r
+ cv::Mat a(size, CV_32FC2);\r
+ cv::Mat b(size, CV_32FC2);\r
\r
- declare.in(a_host, b_host, WARMUP_RNG);\r
+ declare.in(a, b, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat a(a_host);\r
- cv::gpu::GpuMat b(b_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::mulSpectrums(a, b, dst, 0);\r
+ cv::mulSpectrums(a, b, dst, 0);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(Dft, 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
- cv::Mat src_host(size, CV_32FC2);\r
+ cv::Mat src(size, CV_32FC2);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
declare.time(2.0);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::dft(src, dst, size);\r
+ cv::dft(src, dst);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(Convolve, cv::gpu::DeviceInfo, cv::Size, int, bool)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
cv::Size size = GET_PARAM(1);\r
int templ_size = GET_PARAM(2);\r
- bool ccorr = GET_PARAM(3);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
+ cv::Mat image(size, CV_32FC1);\r
+ cv::Mat templ(templ_size, templ_size, CV_32FC1);\r
\r
image.setTo(cv::Scalar(1.0));\r
templ.setTo(cv::Scalar(1.0));\r
\r
- cv::gpu::GpuMat dst;\r
- cv::gpu::ConvolveBuf buf;\r
+ cv::Mat dst;\r
\r
declare.time(2.0);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::convolve(image, templ, dst, ccorr, buf);\r
+ cv::filter2D(image, dst, image.depth(), templ);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(PyrDown, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::pyrDown(src, dst);\r
+ cv::pyrDown(src, dst);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(PyrUp, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
\r
- cv::Mat src_host(size, type);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::pyrUp(src, dst);\r
+ cv::pyrUp(src, dst);\r
}\r
}\r
\r
testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
-// BlendLinear\r
-\r
-GPU_PERF_TEST(BlendLinear, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- 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()\r
- {\r
- cv::gpu::blendLinear(img1, img2, weights1, weights2, dst);\r
- }\r
-}\r
-\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
-//////////////////////////////////////////////////////////////////////\r
-// AlphaComp\r
-\r
-GPU_PERF_TEST(AlphaComp, cv::gpu::DeviceInfo, cv::Size, perf::MatType, AlphaOp)\r
-{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
- cv::Size size = GET_PARAM(1);\r
- int type = GET_PARAM(2);\r
- int alpha_op = GET_PARAM(3);\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\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
- cv::gpu::GpuMat img1(img1_host);\r
- cv::gpu::GpuMat img2(img2_host);\r
- cv::gpu::GpuMat dst;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::alphaComp(img1, img2, dst, alpha_op);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(ImgProc, AlphaComp, testing::Combine(\r
- ALL_DEVICES,\r
- GPU_TYPICAL_MAT_SIZES,\r
- testing::Values(CV_8UC4, CV_16UC4, CV_32SC4, CV_32FC4),\r
- testing::Values((int)cv::gpu::ALPHA_OVER, (int)cv::gpu::ALPHA_IN, (int)cv::gpu::ALPHA_OUT, (int)cv::gpu::ALPHA_ATOP, (int)cv::gpu::ALPHA_XOR, (int)cv::gpu::ALPHA_PLUS, (int)cv::gpu::ALPHA_OVER_PREMUL, (int)cv::gpu::ALPHA_IN_PREMUL, (int)cv::gpu::ALPHA_OUT_PREMUL, (int)cv::gpu::ALPHA_ATOP_PREMUL, (int)cv::gpu::ALPHA_XOR_PREMUL, (int)cv::gpu::ALPHA_PLUS_PREMUL, (int)cv::gpu::ALPHA_PREMUL)));\r
-\r
-//////////////////////////////////////////////////////////////////////\r
// Canny\r
\r
GPU_PERF_TEST_1(Canny, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat image_host = readImage("perf/1280x1024.jpg", cv::IMREAD_GRAYSCALE);\r
- ASSERT_FALSE(image_host.empty());\r
+ cv::Mat image = readImage("perf/1280x1024.jpg", cv::IMREAD_GRAYSCALE);\r
+ ASSERT_FALSE(image.empty());\r
\r
- cv::gpu::GpuMat image(image_host);\r
- cv::gpu::GpuMat dst;\r
- cv::gpu::CannyBuf buf;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::Canny(image, buf, dst, 50.0, 100.0);\r
+ cv::Canny(image, dst, 50.0, 100.0);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(CalcHist, 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
+ cv::Mat src(size, CV_8UC1);\r
\r
- cv::Mat src_host(size, CV_8UC1);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ cv::Mat hist;\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat hist;\r
- cv::gpu::GpuMat buf;\r
+ int histSize = 256;\r
+ float range[] = { 0, 256 } ;\r
+ const float* histRange = { range };\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::calcHist(src, hist, buf);\r
+ cv::calcHist(&src, 1, 0, cv::noArray(), hist, 1, &histSize, &histRange);\r
}\r
}\r
\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
- cv::Mat src_host(size, CV_8UC1);\r
+ cv::Mat src(size, CV_8UC1);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ declare.in(src, 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
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::equalizeHist(src, dst, hist, buf);\r
+ cv::equalizeHist(src, dst);\r
}\r
}\r
\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
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
- cv::Size size = GET_PARAM(1);\r
- int type = GET_PARAM(2);\r
-\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
-\r
- cv::gpu::ImagePyramid pyr;\r
-\r
- TEST_CYCLE()\r
- {\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
-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
- 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()\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
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
\r
GPU_PERF_TEST(Merge, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
const int num_channels = 4;\r
\r
- std::vector<cv::gpu::GpuMat> src(num_channels);\r
+ std::vector<cv::Mat> src(num_channels);\r
for (int i = 0; i < num_channels; ++i)\r
- src[i] = cv::gpu::GpuMat(size, type, cv::Scalar::all(i)); \r
+ src[i] = cv::Mat(size, type, cv::Scalar::all(i));\r
\r
- cv::gpu::GpuMat dst;\r
+ cv::Mat dst;\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::merge(src, dst);\r
+ cv::merge(src, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(MatOp, Merge, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(Split, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
const int num_channels = 4;\r
\r
- cv::gpu::GpuMat src(size, CV_MAKETYPE(type, num_channels), cv::Scalar(1, 2, 3, 4));\r
+ cv::Mat src(size, CV_MAKETYPE(type, num_channels), cv::Scalar(1, 2, 3, 4));\r
\r
- std::vector<cv::gpu::GpuMat> dst(num_channels);\r
+ std::vector<cv::Mat> dst(num_channels);\r
for (int i = 0; i < num_channels; ++i)\r
- dst[i] = cv::gpu::GpuMat(size, type); \r
+ dst[i] = cv::Mat(size, type);\r
\r
TEST_CYCLE()\r
{\r
- cv::gpu::split(src, dst);\r
+ cv::split(src, dst);\r
}\r
}\r
\r
INSTANTIATE_TEST_CASE_P(MatOp, Split, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \r
+ ALL_DEVICES,\r
+ GPU_TYPICAL_MAT_SIZES,\r
testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));\r
\r
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(SetTo, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::gpu::GpuMat src(size, type);\r
+ cv::Mat src(size, type);\r
cv::Scalar val(1, 2, 3, 4);\r
\r
TEST_CYCLE()\r
}\r
\r
INSTANTIATE_TEST_CASE_P(MatOp, SetTo, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \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
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(SetToMasked, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
+ cv::Mat mask(size, CV_8UC1);\r
\r
- cv::Mat src_host(size, type);\r
- cv::Mat mask_host(size, CV_8UC1);\r
+ declare.in(src, WARMUP_RNG);\r
+ fill(mask, 0, 2);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
- fill(mask_host, 0, 2);\r
-\r
- cv::gpu::GpuMat src(src_host);\r
cv::Scalar val(1, 2, 3, 4);\r
- cv::gpu::GpuMat mask(mask_host);\r
- \r
+\r
TEST_CYCLE()\r
{\r
src.setTo(val, mask);\r
}\r
\r
INSTANTIATE_TEST_CASE_P(MatOp, SetToMasked, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \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
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(CopyToMasked, 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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type);\r
+ cv::Mat mask(size, CV_8UC1);\r
\r
- cv::Mat src_host(size, type);\r
- cv::Mat mask_host(size, CV_8UC1);\r
+ declare.in(src, WARMUP_RNG);\r
+ fill(mask, 0, 2);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
- fill(mask_host, 0, 2);\r
+ cv::Mat dst;\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat mask(mask_host);\r
- cv::gpu::GpuMat dst;\r
- \r
TEST_CYCLE()\r
{\r
src.copyTo(dst, mask);\r
}\r
\r
INSTANTIATE_TEST_CASE_P(MatOp, CopyToMasked, testing::Combine(\r
- ALL_DEVICES, \r
- GPU_TYPICAL_MAT_SIZES, \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
//////////////////////////////////////////////////////////////////////\r
\r
GPU_PERF_TEST(ConvertTo, cv::gpu::DeviceInfo, cv::Size, perf::MatType, perf::MatType)\r
{\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
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::Mat src(size, type1);\r
\r
- cv::Mat src_host(size, type1);\r
+ declare.in(src, WARMUP_RNG);\r
\r
- declare.in(src_host, WARMUP_RNG);\r
+ cv::Mat dst;\r
\r
- cv::gpu::GpuMat src(src_host);\r
- cv::gpu::GpuMat dst;\r
- \r
TEST_CYCLE()\r
{\r
src.convertTo(dst, type2, 0.5, 1.0);\r
}\r
\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
+ 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
#endif\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
GPU_PERF_TEST_1(HOG, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
+ cv::Mat img = readImage("gpu/hog/road.png", cv::IMREAD_GRAYSCALE);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
-\r
- cv::Mat img_host = readImage("gpu/hog/road.png", cv::IMREAD_GRAYSCALE);\r
-\r
- cv::gpu::GpuMat img(img_host);\r
std::vector<cv::Rect> found_locations;\r
\r
- cv::gpu::HOGDescriptor hog;\r
+ cv::HOGDescriptor hog;\r
hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());\r
\r
TEST_CYCLE()\r
+++ /dev/null
-#include "perf_precomp.hpp"
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_precomp.hpp"\r
\r
using namespace std;\r
using namespace cv;\r
\r
void PrintTo(const CvtColorInfo& info, ostream* os)\r
{\r
- static const char* str[] = \r
+ static const char* str[] =\r
{\r
"BGR2BGRA",\r
"BGRA2BGR",\r
0,\r
0,\r
0,\r
- \r
+\r
"HLS2BGR",\r
"HLS2RGB",\r
\r
0,\r
0,\r
0,\r
- 0 \r
+ 0\r
};\r
\r
*os << str[info.code];\r
vector<DeviceInfo> devices(FeatureSet feature)\r
{\r
const vector<DeviceInfo>& d = devices();\r
- \r
+\r
vector<DeviceInfo> devs_filtered;\r
\r
if (TargetArchs::builtWith(feature))\r
-#include "perf_precomp.hpp"\r
+#include "perf_cpu_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/opticalflow/frame0.png", cv::IMREAD_GRAYSCALE);\r
- cv::Mat frame1_host = readImage("gpu/opticalflow/frame1.png", 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()\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()\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
-//////////////////////////////////////////////////////\r
-// CreateOpticalFlowNeedleMap\r
-\r
-GPU_PERF_TEST_1(CreateOpticalFlowNeedleMap, 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, 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
- d_flow(frame0, frame1, u, v);\r
-\r
- cv::gpu::GpuMat vertex, colors;\r
-\r
- TEST_CYCLE()\r
- {\r
- cv::gpu::createOpticalFlowNeedleMap(u, v, vertex, colors);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(Video, CreateOpticalFlowNeedleMap, ALL_DEVICES);\r
-\r
-//////////////////////////////////////////////////////\r
// GoodFeaturesToTrack\r
\r
GPU_PERF_TEST(GoodFeaturesToTrack, cv::gpu::DeviceInfo, double)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
double minDistance = GET_PARAM(1);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
- \r
- cv::Mat image_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat image = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
\r
- ASSERT_FALSE(image_host.empty());\r
+ ASSERT_FALSE(image.empty());\r
\r
- cv::gpu::GoodFeaturesToTrackDetector_GPU detector(8000, 0.01, minDistance);\r
-\r
- cv::gpu::GpuMat image(image_host);\r
- cv::gpu::GpuMat pts;\r
+ cv::Mat corners;\r
\r
TEST_CYCLE()\r
{\r
- detector(image, pts);\r
+ cv::goodFeaturesToTrack(image, corners, 8000, 0.01, minDistance);\r
}\r
}\r
\r
\r
GPU_PERF_TEST(PyrLKOpticalFlowSparse, cv::gpu::DeviceInfo, bool, int, int)\r
{\r
- cv::gpu::DeviceInfo devInfo = GET_PARAM(0);\r
bool useGray = GET_PARAM(1);\r
int points = GET_PARAM(2);\r
int win_size = GET_PARAM(3);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
- \r
- cv::Mat frame0_host = readImage("gpu/opticalflow/frame0.png", useGray ? cv::IMREAD_GRAYSCALE : cv::IMREAD_COLOR);\r
- cv::Mat frame1_host = readImage("gpu/opticalflow/frame1.png", useGray ? cv::IMREAD_GRAYSCALE : cv::IMREAD_COLOR);\r
+ cv::Mat frame0 = readImage("gpu/opticalflow/frame0.png", useGray ? cv::IMREAD_GRAYSCALE : cv::IMREAD_COLOR);\r
+ cv::Mat frame1 = readImage("gpu/opticalflow/frame1.png", useGray ? cv::IMREAD_GRAYSCALE : cv::IMREAD_COLOR);\r
\r
- ASSERT_FALSE(frame0_host.empty());\r
- ASSERT_FALSE(frame1_host.empty());\r
+ ASSERT_FALSE(frame0.empty());\r
+ ASSERT_FALSE(frame1.empty());\r
\r
cv::Mat gray_frame;\r
if (useGray)\r
- gray_frame = frame0_host;\r
+ gray_frame = frame0;\r
else\r
- cv::cvtColor(frame0_host, gray_frame, cv::COLOR_BGR2GRAY);\r
-\r
- cv::gpu::GpuMat pts;\r
-\r
- cv::gpu::GoodFeaturesToTrackDetector_GPU detector(points, 0.01, 0.0);\r
- detector(cv::gpu::GpuMat(gray_frame), pts);\r
-\r
- cv::gpu::PyrLKOpticalFlow pyrLK;\r
- pyrLK.winSize = cv::Size(win_size, win_size);\r
-\r
- cv::gpu::GpuMat frame0(frame0_host);\r
- cv::gpu::GpuMat frame1(frame1_host);\r
- cv::gpu::GpuMat nextPts;\r
- cv::gpu::GpuMat status;\r
-\r
- TEST_CYCLE()\r
- {\r
- pyrLK.sparse(frame0, frame1, pts, nextPts, status);\r
- }\r
-}\r
-\r
-INSTANTIATE_TEST_CASE_P(Video, PyrLKOpticalFlowSparse, testing::Combine\r
- (\r
- ALL_DEVICES, \r
- testing::Bool(), \r
- testing::Values(1000, 2000, 4000, 8000), \r
- testing::Values(17, 21)\r
- ));\r
-\r
-//////////////////////////////////////////////////////\r
-// PyrLKOpticalFlowDense\r
-\r
-GPU_PERF_TEST_1(PyrLKOpticalFlowDense, cv::gpu::DeviceInfo)\r
-{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
-\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ cv::cvtColor(frame0, gray_frame, cv::COLOR_BGR2GRAY);\r
\r
- cv::Mat frame0_host = readImage("gpu/opticalflow/frame0.png", cv::IMREAD_GRAYSCALE);\r
- cv::Mat frame1_host = readImage("gpu/opticalflow/frame1.png", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat pts;\r
+ cv::goodFeaturesToTrack(gray_frame, pts, points, 0.01, 0.0);\r
\r
- ASSERT_FALSE(frame0_host.empty());\r
- ASSERT_FALSE(frame1_host.empty());\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::PyrLKOpticalFlow pyrLK;\r
-\r
- declare.time(10);\r
+ cv::Mat nextPts;\r
+ cv::Mat status;\r
\r
TEST_CYCLE()\r
{\r
- pyrLK.dense(frame0, frame1, u, v);\r
+ cv::calcOpticalFlowPyrLK(frame0, frame1, pts, nextPts, status, cv::noArray(), cv::Size(win_size, win_size));\r
}\r
}\r
\r
-INSTANTIATE_TEST_CASE_P(Video, PyrLKOpticalFlowDense, ALL_DEVICES);\r
-\r
+INSTANTIATE_TEST_CASE_P(Video, PyrLKOpticalFlowSparse, testing::Combine(\r
+ ALL_DEVICES,\r
+ testing::Bool(),\r
+ testing::Values(1000, 2000, 4000, 8000),\r
+ testing::Values(17, 21)));\r
\r
//////////////////////////////////////////////////////\r
// FarnebackOpticalFlowTest\r
\r
GPU_PERF_TEST_1(FarnebackOpticalFlowTest, cv::gpu::DeviceInfo)\r
{\r
- cv::gpu::DeviceInfo devInfo = GetParam();\r
+ cv::Mat frame0 = readImage("gpu/opticalflow/frame0.png", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat frame1 = readImage("gpu/opticalflow/frame1.png", cv::IMREAD_GRAYSCALE);\r
\r
- cv::gpu::setDevice(devInfo.deviceID());\r
+ ASSERT_FALSE(frame0.empty());\r
+ ASSERT_FALSE(frame1.empty());\r
\r
- cv::Mat frame0_host = readImage("gpu/opticalflow/frame0.png", cv::IMREAD_GRAYSCALE);\r
- cv::Mat frame1_host = readImage("gpu/opticalflow/frame1.png", cv::IMREAD_GRAYSCALE);\r
-\r
- ASSERT_FALSE(frame0_host.empty());\r
- ASSERT_FALSE(frame1_host.empty());\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::FarnebackOpticalFlow calc;\r
+ cv::Mat flow;\r
\r
declare.time(10);\r
\r
+ int numLevels = 5;\r
+ double pyrScale = 0.5;\r
+ int winSize = 13;\r
+ int numIters = 10;\r
+ int polyN = 5;\r
+ double polySigma = 1.1;\r
+ int flags = 0;\r
+\r
TEST_CYCLE()\r
{\r
- calc(frame0, frame1, u, v);\r
+ cv::calcOpticalFlowFarneback(frame0, frame1, flow, pyrScale, numLevels, winSize, numIters, polyN, polySigma, flags);\r
}\r
}\r
\r