1 #include "perf_precomp.hpp"
\r
5 //////////////////////////////////////////////////////////////////////
\r
8 GPU_PERF_TEST(Remap, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation, BorderMode)
\r
10 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
11 cv::Size size = GET_PARAM(1);
\r
12 int type = GET_PARAM(2);
\r
13 int interpolation = GET_PARAM(3);
\r
14 int borderMode = GET_PARAM(4);
\r
16 cv::gpu::setDevice(devInfo.deviceID());
\r
18 cv::Mat src_host(size, type);
\r
19 cv::Mat xmap_host(size, CV_32FC1);
\r
20 cv::Mat ymap_host(size, CV_32FC1);
\r
22 declare.in(src_host, xmap_host, ymap_host, WARMUP_RNG);
\r
24 cv::gpu::GpuMat src(src_host);
\r
25 cv::gpu::GpuMat xmap(xmap_host);
\r
26 cv::gpu::GpuMat ymap(ymap_host);
\r
27 cv::gpu::GpuMat dst;
\r
33 cv::gpu::remap(src, dst, xmap, ymap, interpolation, borderMode);
\r
37 INSTANTIATE_TEST_CASE_P(ImgProc, Remap, testing::Combine(
\r
39 GPU_TYPICAL_MAT_SIZES,
\r
40 testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1),
\r
41 testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC),
\r
42 testing::Values((int) cv::BORDER_REFLECT101, (int) cv::BORDER_REPLICATE, (int) cv::BORDER_CONSTANT)));
\r
44 //////////////////////////////////////////////////////////////////////
\r
45 // MeanShiftFiltering
\r
47 GPU_PERF_TEST_1(MeanShiftFiltering, cv::gpu::DeviceInfo)
\r
49 cv::gpu::DeviceInfo devInfo = GetParam();
\r
51 cv::gpu::setDevice(devInfo.deviceID());
\r
53 cv::Mat img = readImage("gpu/meanshift/cones.png");
\r
54 ASSERT_FALSE(img.empty());
\r
57 cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
\r
59 cv::gpu::GpuMat src(rgba);
\r
60 cv::gpu::GpuMat dst;
\r
66 cv::gpu::meanShiftFiltering(src, dst, 50, 50);
\r
70 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftFiltering, ALL_DEVICES);
\r
72 //////////////////////////////////////////////////////////////////////
\r
75 GPU_PERF_TEST_1(MeanShiftProc, cv::gpu::DeviceInfo)
\r
77 cv::gpu::DeviceInfo devInfo = GetParam();
\r
79 cv::gpu::setDevice(devInfo.deviceID());
\r
81 cv::Mat img = readImage("gpu/meanshift/cones.png");
\r
82 ASSERT_FALSE(img.empty());
\r
85 cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
\r
87 cv::gpu::GpuMat src(rgba);
\r
88 cv::gpu::GpuMat dstr;
\r
89 cv::gpu::GpuMat dstsp;
\r
95 cv::gpu::meanShiftProc(src, dstr, dstsp, 50, 50);
\r
99 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftProc, ALL_DEVICES);
\r
101 //////////////////////////////////////////////////////////////////////
\r
102 // MeanShiftSegmentation
\r
104 GPU_PERF_TEST_1(MeanShiftSegmentation, cv::gpu::DeviceInfo)
\r
106 cv::gpu::DeviceInfo devInfo = GetParam();
\r
108 cv::gpu::setDevice(devInfo.deviceID());
\r
110 cv::Mat img = readImage("gpu/meanshift/cones.png");
\r
111 ASSERT_FALSE(img.empty());
\r
114 cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
\r
116 cv::gpu::GpuMat src(rgba);
\r
123 meanShiftSegmentation(src, dst, 10, 10, 20);
\r
127 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftSegmentation, ALL_DEVICES);
\r
129 //////////////////////////////////////////////////////////////////////
\r
132 GPU_PERF_TEST(DrawColorDisp, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
134 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
135 cv::Size size = GET_PARAM(1);
\r
136 int type = GET_PARAM(2);
\r
138 cv::gpu::setDevice(devInfo.deviceID());
\r
140 cv::Mat src_host(size, type);
\r
142 fill(src_host, 0, 255);
\r
144 cv::gpu::GpuMat src(src_host);
\r
145 cv::gpu::GpuMat dst;
\r
149 cv::gpu::drawColorDisp(src, dst, 255);
\r
153 INSTANTIATE_TEST_CASE_P(ImgProc, DrawColorDisp, testing::Combine(
\r
155 GPU_TYPICAL_MAT_SIZES,
\r
156 testing::Values(CV_8UC1, CV_16SC1)));
\r
158 //////////////////////////////////////////////////////////////////////
\r
159 // ReprojectImageTo3D
\r
161 GPU_PERF_TEST(ReprojectImageTo3D, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
163 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
164 cv::Size size = GET_PARAM(1);
\r
165 int type = GET_PARAM(2);
\r
167 cv::gpu::setDevice(devInfo.deviceID());
\r
169 cv::Mat src_host(size, type);
\r
171 declare.in(src_host, WARMUP_RNG);
\r
173 cv::gpu::GpuMat src(src_host);
\r
174 cv::gpu::GpuMat dst;
\r
178 cv::gpu::reprojectImageTo3D(src, dst, cv::Mat::ones(4, 4, CV_32FC1));
\r
182 INSTANTIATE_TEST_CASE_P(ImgProc, ReprojectImageTo3D, testing::Combine(
\r
184 GPU_TYPICAL_MAT_SIZES,
\r
185 testing::Values(CV_8UC1, CV_16SC1)));
\r
187 //////////////////////////////////////////////////////////////////////
\r
190 GPU_PERF_TEST(CvtColor, cv::gpu::DeviceInfo, cv::Size, perf::MatType, CvtColorInfo)
\r
192 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
193 cv::Size size = GET_PARAM(1);
\r
194 int type = GET_PARAM(2);
\r
195 CvtColorInfo info = GET_PARAM(3);
\r
197 cv::gpu::setDevice(devInfo.deviceID());
\r
199 cv::Mat src_host(size, CV_MAKETYPE(type, info.scn));
\r
201 declare.in(src_host, WARMUP_RNG);
\r
203 cv::gpu::GpuMat src(src_host);
\r
204 cv::gpu::GpuMat dst;
\r
208 cv::gpu::cvtColor(src, dst, info.code, info.dcn);
\r
212 INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor, testing::Combine(
\r
214 GPU_TYPICAL_MAT_SIZES,
\r
215 testing::Values(CV_8UC1, CV_16UC1, CV_32FC1),
\r
217 CvtColorInfo(4, 4, cv::COLOR_RGBA2BGRA), CvtColorInfo(4, 1, cv::COLOR_BGRA2GRAY), CvtColorInfo(1, 4, cv::COLOR_GRAY2BGRA),
\r
218 CvtColorInfo(4, 4, cv::COLOR_BGR2XYZ), CvtColorInfo(4, 4, cv::COLOR_BGR2YCrCb), CvtColorInfo(4, 4, cv::COLOR_YCrCb2BGR),
\r
219 CvtColorInfo(4, 4, cv::COLOR_BGR2HSV), CvtColorInfo(4, 4, cv::COLOR_HSV2BGR))));
\r
221 //////////////////////////////////////////////////////////////////////
\r
224 GPU_PERF_TEST(SwapChannels, cv::gpu::DeviceInfo, cv::Size)
\r
226 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
227 cv::Size size = GET_PARAM(1);
\r
229 cv::gpu::setDevice(devInfo.deviceID());
\r
231 cv::Mat src_host(size, CV_8UC4);
\r
233 declare.in(src_host, WARMUP_RNG);
\r
235 cv::gpu::GpuMat src(src_host);
\r
237 const int dstOrder[] = {2, 1, 0, 3};
\r
241 cv::gpu::swapChannels(src, dstOrder);
\r
245 INSTANTIATE_TEST_CASE_P(ImgProc, SwapChannels, testing::Combine(ALL_DEVICES, GPU_TYPICAL_MAT_SIZES));
\r
247 //////////////////////////////////////////////////////////////////////
\r
250 GPU_PERF_TEST(Threshold, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
252 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
253 cv::Size size = GET_PARAM(1);
\r
254 int type = GET_PARAM(2);
\r
256 cv::gpu::setDevice(devInfo.deviceID());
\r
258 cv::Mat src_host(size, type);
\r
260 declare.in(src_host, WARMUP_RNG);
\r
262 cv::gpu::GpuMat src(src_host);
\r
263 cv::gpu::GpuMat dst(size, type);
\r
267 cv::gpu::threshold(src, dst, 100.0, 255.0, cv::THRESH_BINARY);
\r
271 INSTANTIATE_TEST_CASE_P(ImgProc, Threshold, testing::Combine(
\r
273 GPU_TYPICAL_MAT_SIZES,
\r
274 testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)));
\r
276 //////////////////////////////////////////////////////////////////////
\r
279 GPU_PERF_TEST(Resize, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation, double)
\r
281 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
282 cv::Size size = GET_PARAM(1);
\r
283 int type = GET_PARAM(2);
\r
284 int interpolation = GET_PARAM(3);
\r
285 double f = GET_PARAM(4);
\r
287 cv::gpu::setDevice(devInfo.deviceID());
\r
289 cv::Mat src_host(size, type);
\r
291 declare.in(src_host, WARMUP_RNG);
\r
293 cv::gpu::GpuMat src(src_host);
\r
294 cv::gpu::GpuMat dst;
\r
300 cv::gpu::resize(src, dst, cv::Size(), f, f, interpolation);
\r
304 INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(
\r
306 testing::Values(perf::szSXGA, perf::sz1080p),
\r
307 testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1),
\r
308 testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC),
\r
309 testing::Values(0.5, 2.0)));
\r
311 //////////////////////////////////////////////////////////////////////
\r
314 GPU_PERF_TEST(WarpAffine, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)
\r
316 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
317 cv::Size size = GET_PARAM(1);
\r
318 int type = GET_PARAM(2);
\r
319 int interpolation = GET_PARAM(3);
\r
321 cv::gpu::setDevice(devInfo.deviceID());
\r
323 cv::Mat src_host(size, type);
\r
325 declare.in(src_host, WARMUP_RNG);
\r
327 cv::gpu::GpuMat src(src_host);
\r
328 cv::gpu::GpuMat dst;
\r
330 double reflect[2][3] = { {-1, 0, 0},
\r
332 reflect[0][2] = size.width;
\r
333 reflect[1][2] = size.height;
\r
334 cv::Mat M(2, 3, CV_64F, (void*) reflect);
\r
338 cv::gpu::warpAffine(src, dst, M, size, interpolation);
\r
342 INSTANTIATE_TEST_CASE_P(ImgProc, WarpAffine, testing::Combine(
\r
344 GPU_TYPICAL_MAT_SIZES,
\r
345 testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),
\r
346 testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));
\r
348 //////////////////////////////////////////////////////////////////////
\r
351 GPU_PERF_TEST(WarpPerspective, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)
\r
353 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
354 cv::Size size = GET_PARAM(1);
\r
355 int type = GET_PARAM(2);
\r
356 int interpolation = GET_PARAM(3);
\r
358 cv::gpu::setDevice(devInfo.deviceID());
\r
360 cv::Mat src_host(size, type);
\r
362 declare.in(src_host, WARMUP_RNG);
\r
364 cv::gpu::GpuMat src(src_host);
\r
365 cv::gpu::GpuMat dst;
\r
367 double reflect[3][3] = { {-1, 0, 0},
\r
370 reflect[0][2] = size.width;
\r
371 reflect[1][2] = size.height;
\r
372 cv::Mat M(3, 3, CV_64F, (void*)reflect);
\r
376 cv::gpu::warpPerspective(src, dst, M, size, interpolation);
\r
380 INSTANTIATE_TEST_CASE_P(ImgProc, WarpPerspective, testing::Combine(
\r
382 GPU_TYPICAL_MAT_SIZES,
\r
383 testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),
\r
384 testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));
\r
386 //////////////////////////////////////////////////////////////////////
\r
387 // BuildWarpPlaneMaps
\r
389 GPU_PERF_TEST(BuildWarpPlaneMaps, cv::gpu::DeviceInfo, cv::Size)
\r
391 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
392 cv::Size size = GET_PARAM(1);
\r
394 cv::gpu::setDevice(devInfo.deviceID());
\r
396 cv::gpu::GpuMat map_x;
\r
397 cv::gpu::GpuMat map_y;
\r
401 cv::gpu::buildWarpPlaneMaps(size, cv::Rect(0, 0, size.width, size.height), cv::Mat::eye(3, 3, CV_32FC1),
\r
402 cv::Mat::ones(3, 3, CV_32FC1), cv::Mat::zeros(1, 3, CV_32F), 1.0, map_x, map_y);
\r
406 INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpPlaneMaps, testing::Combine(
\r
408 GPU_TYPICAL_MAT_SIZES));
\r
410 //////////////////////////////////////////////////////////////////////
\r
411 // BuildWarpCylindricalMaps
\r
413 GPU_PERF_TEST(BuildWarpCylindricalMaps, cv::gpu::DeviceInfo, cv::Size)
\r
415 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
416 cv::Size size = GET_PARAM(1);
\r
418 cv::gpu::setDevice(devInfo.deviceID());
\r
420 cv::gpu::GpuMat map_x;
\r
421 cv::gpu::GpuMat map_y;
\r
425 cv::gpu::buildWarpCylindricalMaps(size, cv::Rect(0, 0, size.width, size.height), cv::Mat::eye(3, 3, CV_32FC1),
\r
426 cv::Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);
\r
430 INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpCylindricalMaps, testing::Combine(
\r
432 GPU_TYPICAL_MAT_SIZES));
\r
434 //////////////////////////////////////////////////////////////////////
\r
435 // BuildWarpSphericalMaps
\r
437 GPU_PERF_TEST(BuildWarpSphericalMaps, cv::gpu::DeviceInfo, cv::Size)
\r
439 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
440 cv::Size size = GET_PARAM(1);
\r
442 cv::gpu::setDevice(devInfo.deviceID());
\r
444 cv::gpu::GpuMat map_x;
\r
445 cv::gpu::GpuMat map_y;
\r
449 cv::gpu::buildWarpSphericalMaps(size, cv::Rect(0, 0, size.width, size.height), cv::Mat::eye(3, 3, CV_32FC1),
\r
450 cv::Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);
\r
454 INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpSphericalMaps, testing::Combine(
\r
456 GPU_TYPICAL_MAT_SIZES));
\r
458 //////////////////////////////////////////////////////////////////////
\r
461 GPU_PERF_TEST(Rotate, cv::gpu::DeviceInfo, cv::Size, perf::MatType, Interpolation)
\r
463 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
464 cv::Size size = GET_PARAM(1);
\r
465 int type = GET_PARAM(2);
\r
466 int interpolation = GET_PARAM(3);
\r
468 cv::gpu::setDevice(devInfo.deviceID());
\r
470 cv::Mat src_host(size, type);
\r
472 declare.in(src_host, WARMUP_RNG);
\r
474 cv::gpu::GpuMat src(src_host);
\r
475 cv::gpu::GpuMat dst;
\r
479 cv::gpu::rotate(src, dst, size, 30.0, 0, 0, interpolation);
\r
483 INSTANTIATE_TEST_CASE_P(ImgProc, Rotate, testing::Combine(
\r
485 GPU_TYPICAL_MAT_SIZES,
\r
486 testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4),
\r
487 testing::Values((int) cv::INTER_NEAREST, (int) cv::INTER_LINEAR, (int) cv::INTER_CUBIC)));
\r
489 //////////////////////////////////////////////////////////////////////
\r
492 GPU_PERF_TEST(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, perf::MatType, BorderMode)
\r
494 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
495 cv::Size size = GET_PARAM(1);
\r
496 int type = GET_PARAM(2);
\r
497 int borderType = GET_PARAM(3);
\r
499 cv::gpu::setDevice(devInfo.deviceID());
\r
501 cv::Mat src_host(size, type);
\r
503 declare.in(src_host, WARMUP_RNG);
\r
505 cv::gpu::GpuMat src(src_host);
\r
506 cv::gpu::GpuMat dst;
\r
510 cv::gpu::copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);
\r
514 INSTANTIATE_TEST_CASE_P(ImgProc, CopyMakeBorder, testing::Combine(
\r
516 GPU_TYPICAL_MAT_SIZES,
\r
517 testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),
\r
518 testing::Values((int) cv::BORDER_REPLICATE, (int) cv::BORDER_REFLECT, (int) cv::BORDER_WRAP, (int) cv::BORDER_CONSTANT)));
\r
520 //////////////////////////////////////////////////////////////////////
\r
523 GPU_PERF_TEST(Integral, cv::gpu::DeviceInfo, cv::Size)
\r
525 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
526 cv::Size size = GET_PARAM(1);
\r
528 cv::gpu::setDevice(devInfo.deviceID());
\r
530 cv::Mat src_host(size, CV_8UC1);
\r
532 declare.in(src_host, WARMUP_RNG);
\r
534 cv::gpu::GpuMat src(src_host);
\r
535 cv::gpu::GpuMat dst;
\r
536 cv::gpu::GpuMat buf;
\r
540 cv::gpu::integralBuffered(src, dst, buf);
\r
544 INSTANTIATE_TEST_CASE_P(ImgProc, Integral, testing::Combine(
\r
546 GPU_TYPICAL_MAT_SIZES));
\r
548 //////////////////////////////////////////////////////////////////////
\r
551 GPU_PERF_TEST(IntegralSqr, cv::gpu::DeviceInfo, cv::Size)
\r
553 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
554 cv::Size size = GET_PARAM(1);
\r
556 cv::gpu::setDevice(devInfo.deviceID());
\r
558 cv::Mat src_host(size, CV_8UC1);
\r
560 declare.in(src_host, WARMUP_RNG);
\r
562 cv::gpu::GpuMat src(src_host);
\r
563 cv::gpu::GpuMat dst;
\r
567 cv::gpu::sqrIntegral(src, dst);
\r
571 INSTANTIATE_TEST_CASE_P(ImgProc, IntegralSqr, testing::Combine(
\r
573 GPU_TYPICAL_MAT_SIZES));
\r
575 //////////////////////////////////////////////////////////////////////
\r
578 GPU_PERF_TEST(ColumnSum, cv::gpu::DeviceInfo, cv::Size)
\r
580 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
581 cv::Size size = GET_PARAM(1);
\r
583 cv::gpu::setDevice(devInfo.deviceID());
\r
585 cv::Mat src_host(size, CV_32FC1);
\r
587 declare.in(src_host, WARMUP_RNG);
\r
589 cv::gpu::GpuMat src(src_host);
\r
590 cv::gpu::GpuMat dst;
\r
594 cv::gpu::columnSum(src, dst);
\r
598 INSTANTIATE_TEST_CASE_P(ImgProc, ColumnSum, testing::Combine(
\r
600 GPU_TYPICAL_MAT_SIZES));
\r
602 //////////////////////////////////////////////////////////////////////
\r
605 GPU_PERF_TEST(CornerHarris, cv::gpu::DeviceInfo, perf::MatType)
\r
607 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
608 int type = GET_PARAM(1);
\r
610 cv::gpu::setDevice(devInfo.deviceID());
\r
612 cv::Mat img = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
\r
613 ASSERT_FALSE(img.empty());
\r
615 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
617 cv::gpu::GpuMat src(img);
\r
618 cv::gpu::GpuMat dst;
\r
619 cv::gpu::GpuMat Dx;
\r
620 cv::gpu::GpuMat Dy;
\r
628 cv::gpu::cornerHarris(src, dst, Dx, Dy, blockSize, ksize, k);
\r
632 INSTANTIATE_TEST_CASE_P(ImgProc, CornerHarris, testing::Combine(
\r
634 testing::Values(CV_8UC1, CV_32FC1)));
\r
636 //////////////////////////////////////////////////////////////////////
\r
637 // CornerMinEigenVal
\r
639 GPU_PERF_TEST(CornerMinEigenVal, cv::gpu::DeviceInfo, perf::MatType)
\r
641 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
642 int type = GET_PARAM(1);
\r
644 cv::gpu::setDevice(devInfo.deviceID());
\r
646 cv::Mat img = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
\r
647 ASSERT_FALSE(img.empty());
\r
649 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
651 cv::gpu::GpuMat src(img);
\r
652 cv::gpu::GpuMat dst;
\r
653 cv::gpu::GpuMat Dx;
\r
654 cv::gpu::GpuMat Dy;
\r
661 cv::gpu::cornerMinEigenVal(src, dst, Dx, Dy, blockSize, ksize);
\r
665 INSTANTIATE_TEST_CASE_P(ImgProc, CornerMinEigenVal, testing::Combine(
\r
667 testing::Values(CV_8UC1, CV_32FC1)));
\r
669 //////////////////////////////////////////////////////////////////////
\r
672 GPU_PERF_TEST(MulSpectrums, cv::gpu::DeviceInfo, cv::Size)
\r
674 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
675 cv::Size size = GET_PARAM(1);
\r
677 cv::gpu::setDevice(devInfo.deviceID());
\r
679 cv::Mat a_host(size, CV_32FC2);
\r
680 cv::Mat b_host(size, CV_32FC2);
\r
682 declare.in(a_host, b_host, WARMUP_RNG);
\r
684 cv::gpu::GpuMat a(a_host);
\r
685 cv::gpu::GpuMat b(b_host);
\r
686 cv::gpu::GpuMat dst;
\r
690 cv::gpu::mulSpectrums(a, b, dst, 0);
\r
694 INSTANTIATE_TEST_CASE_P(ImgProc, MulSpectrums, testing::Combine(
\r
696 GPU_TYPICAL_MAT_SIZES));
\r
698 //////////////////////////////////////////////////////////////////////
\r
701 GPU_PERF_TEST(Dft, cv::gpu::DeviceInfo, cv::Size)
\r
703 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
704 cv::Size size = GET_PARAM(1);
\r
706 cv::gpu::setDevice(devInfo.deviceID());
\r
708 cv::Mat src_host(size, CV_32FC2);
\r
710 declare.in(src_host, WARMUP_RNG);
\r
712 cv::gpu::GpuMat src(src_host);
\r
713 cv::gpu::GpuMat dst;
\r
719 cv::gpu::dft(src, dst, size);
\r
723 INSTANTIATE_TEST_CASE_P(ImgProc, Dft, testing::Combine(
\r
725 GPU_TYPICAL_MAT_SIZES));
\r
727 //////////////////////////////////////////////////////////////////////
\r
730 GPU_PERF_TEST(Convolve, cv::gpu::DeviceInfo, cv::Size, int)
\r
732 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
733 cv::Size size = GET_PARAM(1);
\r
734 int templ_size = GET_PARAM(2);
\r
736 cv::gpu::setDevice(devInfo.deviceID());
\r
738 cv::gpu::GpuMat image = cv::gpu::createContinuous(size, CV_32FC1);
\r
739 cv::gpu::GpuMat templ = cv::gpu::createContinuous(templ_size, templ_size, CV_32FC1);
\r
741 image.setTo(cv::Scalar(1.0));
\r
742 templ.setTo(cv::Scalar(1.0));
\r
744 cv::gpu::GpuMat dst;
\r
745 cv::gpu::ConvolveBuf buf;
\r
751 cv::gpu::convolve(image, templ, dst, false, buf);
\r
755 INSTANTIATE_TEST_CASE_P(ImgProc, Convolve, testing::Combine(
\r
757 GPU_TYPICAL_MAT_SIZES,
\r
758 testing::Values(3, 9, 27, 32, 64)));
\r
760 //////////////////////////////////////////////////////////////////////
\r
763 GPU_PERF_TEST(PyrDown, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
765 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
766 cv::Size size = GET_PARAM(1);
\r
767 int type = GET_PARAM(2);
\r
769 cv::gpu::setDevice(devInfo.deviceID());
\r
771 cv::Mat src_host(size, type);
\r
773 declare.in(src_host, WARMUP_RNG);
\r
775 cv::gpu::GpuMat src(src_host);
\r
776 cv::gpu::GpuMat dst;
\r
780 cv::gpu::pyrDown(src, dst);
\r
784 INSTANTIATE_TEST_CASE_P(ImgProc, PyrDown, testing::Combine(
\r
786 GPU_TYPICAL_MAT_SIZES,
\r
787 testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)));
\r
789 //////////////////////////////////////////////////////////////////////
\r
792 GPU_PERF_TEST(PyrUp, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
794 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
795 cv::Size size = GET_PARAM(1);
\r
796 int type = GET_PARAM(2);
\r
798 cv::gpu::setDevice(devInfo.deviceID());
\r
800 cv::Mat src_host(size, type);
\r
802 declare.in(src_host, WARMUP_RNG);
\r
804 cv::gpu::GpuMat src(src_host);
\r
805 cv::gpu::GpuMat dst;
\r
809 cv::gpu::pyrUp(src, dst);
\r
813 INSTANTIATE_TEST_CASE_P(ImgProc, PyrUp, testing::Combine(
\r
815 GPU_TYPICAL_MAT_SIZES,
\r
816 testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)));
\r
818 //////////////////////////////////////////////////////////////////////
\r
821 GPU_PERF_TEST(BlendLinear, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
823 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
824 cv::Size size = GET_PARAM(1);
\r
825 int type = GET_PARAM(2);
\r
827 cv::gpu::setDevice(devInfo.deviceID());
\r
829 cv::Mat img1_host(size, type);
\r
830 cv::Mat img2_host(size, type);
\r
832 declare.in(img1_host, img2_host, WARMUP_RNG);
\r
834 cv::gpu::GpuMat img1(img1_host);
\r
835 cv::gpu::GpuMat img2(img2_host);
\r
836 cv::gpu::GpuMat weights1(size, CV_32FC1, cv::Scalar::all(0.5));
\r
837 cv::gpu::GpuMat weights2(size, CV_32FC1, cv::Scalar::all(0.5));
\r
838 cv::gpu::GpuMat dst;
\r
842 cv::gpu::blendLinear(img1, img2, weights1, weights2, dst);
\r
846 INSTANTIATE_TEST_CASE_P(ImgProc, BlendLinear, testing::Combine(
\r
848 GPU_TYPICAL_MAT_SIZES,
\r
849 testing::Values(CV_8UC1, CV_32FC1)));
\r
851 //////////////////////////////////////////////////////////////////////
\r
854 GPU_PERF_TEST(AlphaComp, cv::gpu::DeviceInfo, cv::Size, perf::MatType, AlphaOp)
\r
856 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
857 cv::Size size = GET_PARAM(1);
\r
858 int type = GET_PARAM(2);
\r
859 int alpha_op = GET_PARAM(3);
\r
861 cv::gpu::setDevice(devInfo.deviceID());
\r
863 cv::Mat img1_host(size, type);
\r
864 cv::Mat img2_host(size, type);
\r
866 declare.in(img1_host, img2_host, WARMUP_RNG);
\r
868 cv::gpu::GpuMat img1(img1_host);
\r
869 cv::gpu::GpuMat img2(img2_host);
\r
870 cv::gpu::GpuMat dst;
\r
874 cv::gpu::alphaComp(img1, img2, dst, alpha_op);
\r
878 INSTANTIATE_TEST_CASE_P(ImgProc, AlphaComp, testing::Combine(
\r
880 GPU_TYPICAL_MAT_SIZES,
\r
881 testing::Values(CV_8UC4, CV_16UC4, CV_32SC4, CV_32FC4),
\r
882 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
884 //////////////////////////////////////////////////////////////////////
\r
887 GPU_PERF_TEST_1(Canny, cv::gpu::DeviceInfo)
\r
889 cv::gpu::DeviceInfo devInfo = GetParam();
\r
891 cv::gpu::setDevice(devInfo.deviceID());
\r
893 cv::Mat image_host = readImage("perf/1280x1024.jpg", cv::IMREAD_GRAYSCALE);
\r
894 ASSERT_FALSE(image_host.empty());
\r
896 cv::gpu::GpuMat image(image_host);
\r
897 cv::gpu::GpuMat dst;
\r
898 cv::gpu::CannyBuf buf;
\r
902 cv::gpu::Canny(image, buf, dst, 50.0, 100.0);
\r
906 INSTANTIATE_TEST_CASE_P(ImgProc, Canny, ALL_DEVICES);
\r
908 //////////////////////////////////////////////////////////////////////
\r
911 GPU_PERF_TEST(CalcHist, cv::gpu::DeviceInfo, cv::Size)
\r
913 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
914 cv::Size size = GET_PARAM(1);
\r
916 cv::gpu::setDevice(devInfo.deviceID());
\r
918 cv::Mat src_host(size, CV_8UC1);
\r
920 declare.in(src_host, WARMUP_RNG);
\r
922 cv::gpu::GpuMat src(src_host);
\r
923 cv::gpu::GpuMat hist;
\r
924 cv::gpu::GpuMat buf;
\r
928 cv::gpu::calcHist(src, hist, buf);
\r
932 INSTANTIATE_TEST_CASE_P(ImgProc, CalcHist, testing::Combine(
\r
934 GPU_TYPICAL_MAT_SIZES));
\r
936 //////////////////////////////////////////////////////////////////////
\r
939 GPU_PERF_TEST(EqualizeHist, cv::gpu::DeviceInfo, cv::Size)
\r
941 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
942 cv::Size size = GET_PARAM(1);
\r
944 cv::gpu::setDevice(devInfo.deviceID());
\r
946 cv::Mat src_host(size, CV_8UC1);
\r
948 declare.in(src_host, WARMUP_RNG);
\r
950 cv::gpu::GpuMat src(src_host);
\r
951 cv::gpu::GpuMat dst;
\r
952 cv::gpu::GpuMat hist;
\r
953 cv::gpu::GpuMat buf;
\r
957 cv::gpu::equalizeHist(src, dst, hist, buf);
\r
961 INSTANTIATE_TEST_CASE_P(ImgProc, EqualizeHist, testing::Combine(
\r
963 GPU_TYPICAL_MAT_SIZES));
\r
965 //////////////////////////////////////////////////////////////////////
\r
968 GPU_PERF_TEST(ImagePyramid_build, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
970 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
971 cv::Size size = GET_PARAM(1);
\r
972 int type = GET_PARAM(2);
\r
974 cv::gpu::setDevice(devInfo.deviceID());
\r
976 cv::Mat src_host(size, type);
\r
978 declare.in(src_host, WARMUP_RNG);
\r
980 cv::gpu::GpuMat src(src_host);
\r
982 cv::gpu::ImagePyramid pyr;
\r
990 INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_build, testing::Combine(
\r
992 GPU_TYPICAL_MAT_SIZES,
\r
993 testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));
\r
995 GPU_PERF_TEST(ImagePyramid_getLayer, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
\r
997 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
998 cv::Size size = GET_PARAM(1);
\r
999 int type = GET_PARAM(2);
\r
1001 cv::gpu::setDevice(devInfo.deviceID());
\r
1003 cv::Mat src_host(size, type);
\r
1005 declare.in(src_host, WARMUP_RNG);
\r
1007 cv::gpu::GpuMat src(src_host);
\r
1008 cv::gpu::GpuMat dst;
\r
1010 cv::gpu::ImagePyramid pyr(src, 3);
\r
1014 pyr.getLayer(dst, cv::Size(size.width / 2 + 10, size.height / 2 + 10));
\r
1018 INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_getLayer, testing::Combine(
\r
1020 GPU_TYPICAL_MAT_SIZES,
\r
1021 testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));
\r