1 #include "perf_precomp.hpp"
\r
3 PERF_TEST_P(DevInfo_Size_MatType_Interpolation_BorderMode, remap, testing::Combine(testing::ValuesIn(devices()),
\r
4 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
5 testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1),
\r
6 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC),
\r
7 testing::Values((int)BORDER_REFLECT101, (int)BORDER_REPLICATE, (int)BORDER_CONSTANT)))
\r
9 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
10 Size size = std::tr1::get<1>(GetParam());
\r
11 int type = std::tr1::get<2>(GetParam());
\r
12 int interpolation = std::tr1::get<3>(GetParam());
\r
13 int borderMode = std::tr1::get<4>(GetParam());
\r
15 setDevice(devInfo.deviceID());
\r
17 Mat src_host(size, type);
\r
19 declare.in(src_host, WARMUP_RNG);
\r
21 GpuMat src(src_host);
\r
22 GpuMat dst(size, type);
\r
24 Mat xmap_host(size, CV_32FC1);
\r
25 Mat ymap_host(size, CV_32FC1);
\r
26 randu(xmap_host, -300, size.width + 300);
\r
27 randu(ymap_host, -300, size.height + 300);
\r
29 GpuMat xmap(xmap_host);
\r
30 GpuMat ymap(ymap_host);
\r
32 declare.time(3.0).iterations(100);
\r
36 remap(src, dst, xmap, ymap, interpolation, borderMode);
\r
41 SANITY_CHECK(dst_host);
\r
44 PERF_TEST_P(DevInfo, meanShiftFiltering, testing::ValuesIn(devices()))
\r
46 DeviceInfo devInfo = GetParam();
\r
48 setDevice(devInfo.deviceID());
\r
50 Mat img = readImage("gpu/meanshift/cones.png");
\r
51 ASSERT_FALSE(img.empty());
\r
54 cvtColor(img, rgba, CV_BGR2BGRA);
\r
57 GpuMat dst(src.size(), CV_8UC4);
\r
59 declare.time(5.0).iterations(100);
\r
63 meanShiftFiltering(src, dst, 50, 50);
\r
68 SANITY_CHECK(dst_host);
\r
71 PERF_TEST_P(DevInfo, meanShiftProc, testing::ValuesIn(devices()))
\r
73 DeviceInfo devInfo = GetParam();
\r
75 setDevice(devInfo.deviceID());
\r
77 Mat img = readImage("gpu/meanshift/cones.png");
\r
78 ASSERT_FALSE(img.empty());
\r
81 cvtColor(img, rgba, CV_BGR2BGRA);
\r
84 GpuMat dstr(src.size(), CV_8UC4);
\r
85 GpuMat dstsp(src.size(), CV_16SC2);
\r
87 declare.time(5.0).iterations(100);
\r
91 meanShiftProc(src, dstr, dstsp, 50, 50);
\r
94 Mat dstr_host(dstr);
\r
95 Mat dstsp_host(dstsp);
\r
97 SANITY_CHECK(dstr_host);
\r
98 SANITY_CHECK(dstsp_host);
\r
101 PERF_TEST_P(DevInfo, meanShiftSegmentation, testing::ValuesIn(devices()))
\r
103 DeviceInfo devInfo = GetParam();
\r
105 setDevice(devInfo.deviceID());
\r
107 Mat img = readImage("gpu/meanshift/cones.png");
\r
108 ASSERT_FALSE(img.empty());
\r
111 cvtColor(img, rgba, CV_BGR2BGRA);
\r
114 Mat dst(src.size(), CV_8UC4);
\r
116 declare.time(5.0).iterations(100);
\r
118 SIMPLE_TEST_CYCLE()
\r
120 meanShiftSegmentation(src, dst, 10, 10, 20);
\r
126 PERF_TEST_P(DevInfo_Size_MatType, drawColorDisp, testing::Combine(testing::ValuesIn(devices()),
\r
127 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
128 testing::Values(CV_8UC1, CV_16SC1)))
\r
130 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
131 Size size = std::tr1::get<1>(GetParam());
\r
132 int type = std::tr1::get<2>(GetParam());
\r
134 setDevice(devInfo.deviceID());
\r
136 Mat src_host(size, CV_8UC1);
\r
137 declare.in(src_host, WARMUP_RNG);
\r
138 src_host.convertTo(src_host, type);
\r
140 GpuMat src(src_host);
\r
141 GpuMat dst(size, CV_8UC4);
\r
143 declare.time(0.5).iterations(100);
\r
145 SIMPLE_TEST_CYCLE()
\r
147 drawColorDisp(src, dst, 255);
\r
152 SANITY_CHECK(dst_host);
\r
155 PERF_TEST_P(DevInfo_Size_MatType, reprojectImageTo3D, testing::Combine(testing::ValuesIn(devices()),
\r
156 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
157 testing::Values(CV_8UC1, CV_16SC1)))
\r
159 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
160 Size size = std::tr1::get<1>(GetParam());
\r
161 int type = std::tr1::get<2>(GetParam());
\r
163 setDevice(devInfo.deviceID());
\r
165 Mat src_host(size, type);
\r
167 declare.in(src_host, WARMUP_RNG);
\r
169 GpuMat src(src_host);
\r
170 GpuMat dst(size, CV_32FC4);
\r
172 declare.time(0.5).iterations(100);
\r
174 SIMPLE_TEST_CYCLE()
\r
176 reprojectImageTo3D(src, dst, Mat::ones(4, 4, CV_32FC1));
\r
181 SANITY_CHECK(dst_host);
\r
184 PERF_TEST_P(DevInfo_Size_MatType_CvtColorInfo, cvtColor, testing::Combine(testing::ValuesIn(devices()),
\r
185 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
186 testing::Values(CV_8UC1, CV_16UC1, CV_32FC1),
\r
187 testing::Values(CvtColorInfo(4, 4, CV_RGBA2BGRA), CvtColorInfo(4, 1, CV_BGRA2GRAY), CvtColorInfo(1, 4, CV_GRAY2BGRA),
\r
188 CvtColorInfo(4, 4, CV_BGR2XYZ), CvtColorInfo(4, 4, CV_BGR2YCrCb), CvtColorInfo(4, 4, CV_YCrCb2BGR),
\r
189 CvtColorInfo(4, 4, CV_BGR2HSV), CvtColorInfo(4, 4, CV_HSV2BGR))))
\r
191 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
192 Size size = std::tr1::get<1>(GetParam());
\r
193 int type = std::tr1::get<2>(GetParam());
\r
194 CvtColorInfo info = std::tr1::get<3>(GetParam());
\r
196 setDevice(devInfo.deviceID());
\r
198 Mat src_host(size, CV_MAKETYPE(type, info.scn));
\r
200 declare.in(src_host, WARMUP_RNG);
\r
202 GpuMat src(src_host);
\r
203 GpuMat dst(size, CV_MAKETYPE(type, info.dcn));
\r
205 declare.time(0.5).iterations(100);
\r
207 SIMPLE_TEST_CYCLE()
\r
209 cvtColor(src, dst, info.code, info.dcn);
\r
214 SANITY_CHECK(dst_host);
\r
217 PERF_TEST_P(DevInfo_Size_MatType, threshold, testing::Combine(testing::ValuesIn(devices()),
\r
218 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
219 testing::Values(CV_8UC1, CV_16UC1, CV_32FC1)))
\r
221 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
222 Size size = std::tr1::get<1>(GetParam());
\r
223 int type = std::tr1::get<2>(GetParam());
\r
225 setDevice(devInfo.deviceID());
\r
227 Mat src_host(size, type);
\r
229 declare.in(src_host, WARMUP_RNG);
\r
231 GpuMat src(src_host);
\r
232 GpuMat dst(size, type);
\r
234 declare.time(0.5).iterations(100);
\r
236 SIMPLE_TEST_CYCLE()
\r
238 threshold(src, dst, 100.0, 255.0, THRESH_BINARY);
\r
243 SANITY_CHECK(dst_host);
\r
246 PERF_TEST_P(DevInfo_Size_MatType_Interpolation_SizeCoeff, resize, testing::Combine(testing::ValuesIn(devices()),
\r
247 testing::Values(szSXGA, sz1080p),
\r
248 testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_32FC1),
\r
249 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC),
\r
250 testing::Values(0.5, 2.0)))
\r
252 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
253 Size size = std::tr1::get<1>(GetParam());
\r
254 int type = std::tr1::get<2>(GetParam());
\r
255 int interpolation = std::tr1::get<3>(GetParam());
\r
256 double f = std::tr1::get<4>(GetParam());
\r
258 setDevice(devInfo.deviceID());
\r
260 Mat src_host(size, type);
\r
262 declare.in(src_host, WARMUP_RNG);
\r
264 GpuMat src(src_host);
\r
267 declare.time(1.0).iterations(100);
\r
269 SIMPLE_TEST_CYCLE()
\r
271 resize(src, dst, Size(), f, f, interpolation);
\r
276 SANITY_CHECK(dst_host);
\r
279 PERF_TEST_P(DevInfo_Size_MatType_Interpolation, warpAffine, testing::Combine(testing::ValuesIn(devices()),
\r
280 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
281 testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),
\r
282 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))
\r
284 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
285 Size size = std::tr1::get<1>(GetParam());
\r
286 int type = std::tr1::get<2>(GetParam());
\r
287 int interpolation = std::tr1::get<3>(GetParam());
\r
289 setDevice(devInfo.deviceID());
\r
291 Mat src_host(size, type);
\r
293 declare.in(src_host, WARMUP_RNG);
\r
295 GpuMat src(src_host);
\r
296 GpuMat dst(size, type);
\r
298 static double reflect[2][3] = { {-1, 0, 0},
\r
300 reflect[0][2] = size.width;
\r
301 reflect[1][2] = size.height;
\r
302 Mat M(2, 3, CV_64F, (void*)reflect);
\r
304 declare.time(0.5).iterations(100);
\r
306 SIMPLE_TEST_CYCLE()
\r
308 warpAffine(src, dst, M, size, interpolation);
\r
313 SANITY_CHECK(dst_host);
\r
316 PERF_TEST_P(DevInfo_Size_MatType_Interpolation, warpPerspective, testing::Combine(testing::ValuesIn(devices()),
\r
317 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
318 testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),
\r
319 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))
\r
321 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
322 Size size = std::tr1::get<1>(GetParam());
\r
323 int type = std::tr1::get<2>(GetParam());
\r
324 int interpolation = std::tr1::get<3>(GetParam());
\r
326 setDevice(devInfo.deviceID());
\r
328 Mat src_host(size, type);
\r
330 declare.in(src_host, WARMUP_RNG);
\r
332 GpuMat src(src_host);
\r
333 GpuMat dst(size, type);
\r
335 static double reflect[3][3] = { {-1, 0, 0},
\r
338 reflect[0][2] = size.width;
\r
339 reflect[1][2] = size.height;
\r
340 Mat M(3, 3, CV_64F, (void*)reflect);
\r
342 declare.time(0.5).iterations(100);
\r
344 SIMPLE_TEST_CYCLE()
\r
346 warpPerspective(src, dst, M, size, interpolation);
\r
351 SANITY_CHECK(dst_host);
\r
354 PERF_TEST_P(DevInfo_Size, buildWarpPlaneMaps, testing::Combine(testing::ValuesIn(devices()),
\r
355 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
357 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
358 Size size = std::tr1::get<1>(GetParam());
\r
360 setDevice(devInfo.deviceID());
\r
362 GpuMat map_x(size, CV_32FC1);
\r
363 GpuMat map_y(size, CV_32FC1);
\r
365 declare.time(0.5).iterations(100);
\r
367 SIMPLE_TEST_CYCLE()
\r
369 buildWarpPlaneMaps(size, Rect(0, 0, size.width, size.height), Mat::eye(3, 3, CV_32FC1),
\r
370 Mat::ones(3, 3, CV_32FC1), Mat::zeros(1, 3, CV_32F), 1.0, map_x, map_y);
\r
373 Mat map_x_host(map_x);
\r
374 Mat map_y_host(map_y);
\r
376 SANITY_CHECK(map_x_host);
\r
377 SANITY_CHECK(map_y_host);
\r
380 PERF_TEST_P(DevInfo_Size, buildWarpCylindricalMaps, testing::Combine(testing::ValuesIn(devices()),
\r
381 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
383 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
384 Size size = std::tr1::get<1>(GetParam());
\r
386 setDevice(devInfo.deviceID());
\r
388 GpuMat map_x(size, CV_32FC1);
\r
389 GpuMat map_y(size, CV_32FC1);
\r
391 declare.time(0.5).iterations(100);
\r
393 SIMPLE_TEST_CYCLE()
\r
395 buildWarpCylindricalMaps(size, Rect(0, 0, size.width, size.height), Mat::eye(3, 3, CV_32FC1),
\r
396 Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);
\r
399 Mat map_x_host(map_x);
\r
400 Mat map_y_host(map_y);
\r
402 SANITY_CHECK(map_x_host);
\r
403 SANITY_CHECK(map_y_host);
\r
406 PERF_TEST_P(DevInfo_Size, buildWarpSphericalMaps, testing::Combine(testing::ValuesIn(devices()),
\r
407 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
409 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
410 Size size = std::tr1::get<1>(GetParam());
\r
412 setDevice(devInfo.deviceID());
\r
414 GpuMat map_x(size, CV_32FC1);
\r
415 GpuMat map_y(size, CV_32FC1);
\r
417 declare.time(0.5).iterations(100);
\r
419 SIMPLE_TEST_CYCLE()
\r
421 buildWarpSphericalMaps(size, Rect(0, 0, size.width, size.height), Mat::eye(3, 3, CV_32FC1),
\r
422 Mat::ones(3, 3, CV_32FC1), 1.0, map_x, map_y);
\r
425 Mat map_x_host(map_x);
\r
426 Mat map_y_host(map_y);
\r
428 SANITY_CHECK(map_x_host);
\r
429 SANITY_CHECK(map_y_host);
\r
432 PERF_TEST_P(DevInfo_Size_MatType_Interpolation, rotate, testing::Combine(testing::ValuesIn(devices()),
\r
433 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
434 testing::Values(CV_8UC1, CV_8UC4),
\r
435 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))
\r
437 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
438 Size size = std::tr1::get<1>(GetParam());
\r
439 int type = std::tr1::get<2>(GetParam());
\r
440 int interpolation = std::tr1::get<3>(GetParam());
\r
442 setDevice(devInfo.deviceID());
\r
444 Mat src_host(size, type);
\r
446 declare.in(src_host, WARMUP_RNG);
\r
448 GpuMat src(src_host);
\r
449 GpuMat dst(size, type);
\r
451 declare.time(0.5).iterations(100);
\r
453 SIMPLE_TEST_CYCLE()
\r
455 rotate(src, dst, size, 30.0, 0, 0, interpolation);
\r
460 SANITY_CHECK(dst_host);
\r
463 PERF_TEST_P(DevInfo_Size_MatType_BorderMode, copyMakeBorder, testing::Combine(testing::ValuesIn(devices()),
\r
464 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
465 testing::Values(CV_8UC1, CV_8UC4, CV_32FC1),
\r
466 testing::Values((int)BORDER_REPLICATE, (int)BORDER_CONSTANT)))
\r
468 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
469 Size size = std::tr1::get<1>(GetParam());
\r
470 int type = std::tr1::get<2>(GetParam());
\r
471 int borderType = std::tr1::get<3>(GetParam());
\r
473 setDevice(devInfo.deviceID());
\r
475 Mat src_host(size, type);
\r
477 declare.in(src_host, WARMUP_RNG);
\r
479 GpuMat src(src_host);
\r
482 declare.time(0.5).iterations(100);
\r
484 SIMPLE_TEST_CYCLE()
\r
486 copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);
\r
491 SANITY_CHECK(dst_host);
\r
494 PERF_TEST_P(DevInfo_Size, integralBuffered, testing::Combine(testing::ValuesIn(devices()),
\r
495 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
497 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
498 Size size = std::tr1::get<1>(GetParam());
\r
500 setDevice(devInfo.deviceID());
\r
502 Mat src_host(size, CV_8UC1);
\r
504 declare.in(src_host, WARMUP_RNG);
\r
506 GpuMat src(src_host);
\r
510 declare.time(0.5).iterations(100);
\r
512 SIMPLE_TEST_CYCLE()
\r
514 integralBuffered(src, dst, buf);
\r
519 SANITY_CHECK(dst_host);
\r
522 PERF_TEST_P(DevInfo_Size, integral, testing::Combine(testing::ValuesIn(devices()),
\r
523 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
525 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
526 Size size = std::tr1::get<1>(GetParam());
\r
528 setDevice(devInfo.deviceID());
\r
530 Mat src_host(size, CV_8UC1);
\r
532 declare.in(src_host, WARMUP_RNG);
\r
534 GpuMat src(src_host);
\r
537 declare.time(0.5).iterations(100);
\r
539 SIMPLE_TEST_CYCLE()
\r
541 integral(src, sum, sqsum);
\r
545 Mat sqsum_host(sqsum);
\r
547 SANITY_CHECK(sum_host);
\r
548 SANITY_CHECK(sqsum_host);
\r
551 PERF_TEST_P(DevInfo_Size, sqrIntegral, testing::Combine(testing::ValuesIn(devices()),
\r
552 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
554 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
555 Size size = std::tr1::get<1>(GetParam());
\r
557 setDevice(devInfo.deviceID());
\r
559 Mat src_host(size, CV_8UC1);
\r
561 declare.in(src_host, WARMUP_RNG);
\r
563 GpuMat src(src_host);
\r
566 declare.time(0.5).iterations(100);
\r
568 SIMPLE_TEST_CYCLE()
\r
570 sqrIntegral(src, dst);
\r
575 SANITY_CHECK(dst_host);
\r
578 PERF_TEST_P(DevInfo_Size, columnSum, testing::Combine(testing::ValuesIn(devices()),
\r
579 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
581 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
582 Size size = std::tr1::get<1>(GetParam());
\r
584 setDevice(devInfo.deviceID());
\r
586 Mat src_host(size, CV_32FC1);
\r
588 declare.in(src_host, WARMUP_RNG);
\r
590 GpuMat src(src_host);
\r
593 declare.time(0.5).iterations(100);
\r
595 SIMPLE_TEST_CYCLE()
\r
597 columnSum(src, dst);
\r
602 SANITY_CHECK(dst_host);
\r
605 PERF_TEST_P(DevInfo_MatType, cornerHarris, testing::Combine(testing::ValuesIn(devices()),
\r
606 testing::Values(CV_8UC1, CV_32FC1)))
\r
608 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
609 int type = std::tr1::get<1>(GetParam());
\r
611 setDevice(devInfo.deviceID());
\r
613 Mat img = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);
\r
614 ASSERT_FALSE(img.empty());
\r
616 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
627 declare.time(0.5).iterations(100);
\r
629 SIMPLE_TEST_CYCLE()
\r
631 cornerHarris(src, dst, Dx, Dy, blockSize, ksize, k);
\r
638 SANITY_CHECK(dst_host);
\r
639 SANITY_CHECK(Dx_host);
\r
640 SANITY_CHECK(Dy_host);
\r
643 PERF_TEST_P(DevInfo_MatType, cornerMinEigenVal, testing::Combine(testing::ValuesIn(devices()),
\r
644 testing::Values(CV_8UC1, CV_32FC1)))
\r
646 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
647 int type = std::tr1::get<1>(GetParam());
\r
649 setDevice(devInfo.deviceID());
\r
651 Mat img = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);
\r
652 ASSERT_FALSE(img.empty());
\r
654 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
664 declare.time(0.5).iterations(100);
\r
666 SIMPLE_TEST_CYCLE()
\r
668 cornerMinEigenVal(src, dst, Dx, Dy, blockSize, ksize);
\r
675 SANITY_CHECK(dst_host);
\r
676 SANITY_CHECK(Dx_host);
\r
677 SANITY_CHECK(Dy_host);
\r
680 PERF_TEST_P(DevInfo_Size_MatType, mulSpectrums, testing::Combine(testing::ValuesIn(devices()),
\r
681 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
682 testing::Values(CV_8UC1, CV_32FC1)))
\r
684 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
685 Size size = std::tr1::get<1>(GetParam());
\r
686 int type = std::tr1::get<2>(GetParam());
\r
688 setDevice(devInfo.deviceID());
\r
690 Mat a_host(size, CV_32FC2);
\r
691 Mat b_host(size, CV_32FC2);
\r
693 declare.in(a_host, b_host, WARMUP_RNG);
\r
699 declare.time(0.5).iterations(100);
\r
701 SIMPLE_TEST_CYCLE()
\r
703 mulSpectrums(a, b, dst, 0);
\r
708 SANITY_CHECK(dst_host);
\r
711 PERF_TEST_P(DevInfo_Size, dft, testing::Combine(testing::ValuesIn(devices()),
\r
712 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
714 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
715 Size size = std::tr1::get<1>(GetParam());
\r
717 setDevice(devInfo.deviceID());
\r
719 Mat src_host(size, CV_32FC2);
\r
721 declare.in(src_host, WARMUP_RNG);
\r
723 GpuMat src(src_host);
\r
726 declare.time(2.0).iterations(100);
\r
728 SIMPLE_TEST_CYCLE()
\r
730 dft(src, dst, size);
\r
735 SANITY_CHECK(dst_host);
\r
738 PERF_TEST_P(DevInfo_Int_Int, convolve, testing::Combine(testing::ValuesIn(devices()),
\r
739 testing::Values(512, 1024, 1536, 2048, 2560, 3072, 3584),
\r
740 testing::Values(3, 9, 27, 32, 64)))
\r
742 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
743 int image_size = std::tr1::get<1>(GetParam());
\r
744 int templ_size = std::tr1::get<2>(GetParam());
\r
746 setDevice(devInfo.deviceID());
\r
748 GpuMat image = createContinuous(image_size, image_size, CV_32FC1);
\r
749 GpuMat templ = createContinuous(templ_size, templ_size, CV_32FC1);
\r
751 image.setTo(Scalar(1.0));
\r
752 templ.setTo(Scalar(1.0));
\r
757 declare.time(2.0).iterations(100);
\r
759 SIMPLE_TEST_CYCLE()
\r
761 convolve(image, templ, dst, false, buf);
\r
766 SANITY_CHECK(dst_host);
\r
769 PERF_TEST_P(DevInfo_Size_MatType, pyrDown, testing::Combine(testing::ValuesIn(devices()),
\r
770 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
771 testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)))
\r
773 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
774 Size size = std::tr1::get<1>(GetParam());
\r
775 int type = std::tr1::get<2>(GetParam());
\r
777 setDevice(devInfo.deviceID());
\r
779 Mat src_host(size, type);
\r
781 declare.in(src_host, WARMUP_RNG);
\r
783 GpuMat src(src_host);
\r
786 declare.time(0.5).iterations(100);
\r
788 SIMPLE_TEST_CYCLE()
\r
795 SANITY_CHECK(dst_host);
\r
798 PERF_TEST_P(DevInfo_Size_MatType, pyrUp, testing::Combine(testing::ValuesIn(devices()),
\r
799 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
800 testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)))
\r
802 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
803 Size size = std::tr1::get<1>(GetParam());
\r
804 int type = std::tr1::get<2>(GetParam());
\r
806 setDevice(devInfo.deviceID());
\r
808 Mat src_host(size, type);
\r
810 declare.in(src_host, WARMUP_RNG);
\r
812 GpuMat src(src_host);
\r
815 declare.time(0.5).iterations(100);
\r
817 SIMPLE_TEST_CYCLE()
\r
824 SANITY_CHECK(dst_host);
\r
827 PERF_TEST_P(DevInfo_Size_MatType, blendLinear, testing::Combine(testing::ValuesIn(devices()),
\r
828 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
829 testing::Values(CV_8UC1, CV_32FC1)))
\r
831 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
832 Size size = std::tr1::get<1>(GetParam());
\r
833 int type = std::tr1::get<2>(GetParam());
\r
835 setDevice(devInfo.deviceID());
\r
837 Mat img1_host(size, type);
\r
838 Mat img2_host(size, type);
\r
840 declare.in(img1_host, img2_host, WARMUP_RNG);
\r
842 GpuMat img1(img1_host);
\r
843 GpuMat img2(img2_host);
\r
844 GpuMat weights1(size, CV_32FC1, Scalar::all(0.5));
\r
845 GpuMat weights2(size, CV_32FC1, Scalar::all(0.5));
\r
848 declare.time(0.5).iterations(100);
\r
850 SIMPLE_TEST_CYCLE()
\r
852 blendLinear(img1, img2, weights1, weights2, dst);
\r
857 SANITY_CHECK(dst_host);
\r
860 PERF_TEST_P(DevInfo, Canny, testing::ValuesIn(devices()))
\r
862 DeviceInfo devInfo = GetParam();
\r
864 setDevice(devInfo.deviceID());
\r
866 Mat image_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);
\r
867 ASSERT_FALSE(image_host.empty());
\r
869 GpuMat image(image_host);
\r
873 declare.time(0.5).iterations(100);
\r
875 SIMPLE_TEST_CYCLE()
\r
877 Canny(image, buf, dst, 50.0, 100.0);
\r
882 SANITY_CHECK(dst_host);
\r
885 PERF_TEST_P(DevInfo_Size, calcHist, testing::Combine(testing::ValuesIn(devices()),
\r
886 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
888 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
889 Size size = std::tr1::get<1>(GetParam());
\r
891 setDevice(devInfo.deviceID());
\r
893 Mat src_host(size, CV_8UC1);
\r
895 declare.in(src_host, WARMUP_RNG);
\r
897 GpuMat src(src_host);
\r
901 declare.time(0.5).iterations(100);
\r
903 SIMPLE_TEST_CYCLE()
\r
905 calcHist(src, hist, buf);
\r
908 Mat hist_host(hist);
\r
910 SANITY_CHECK(hist_host);
\r
913 PERF_TEST_P(DevInfo_Size, equalizeHist, testing::Combine(testing::ValuesIn(devices()),
\r
914 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
916 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
917 Size size = std::tr1::get<1>(GetParam());
\r
919 setDevice(devInfo.deviceID());
\r
921 Mat src_host(size, CV_8UC1);
\r
923 declare.in(src_host, WARMUP_RNG);
\r
925 GpuMat src(src_host);
\r
930 declare.time(0.5).iterations(100);
\r
932 SIMPLE_TEST_CYCLE()
\r
934 equalizeHist(src, dst, hist, buf);
\r
939 SANITY_CHECK(dst_host);
\r