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(GPU_TYPICAL_MAT_SIZES),
\r
248 testing::Values(CV_8UC1, CV_8UC4),
\r
249 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR),
\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(0.5).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::ones(3, 3, CV_32FC1), 1.0, 1.0, 1.0, map_x, map_y);
\r
372 Mat map_x_host(map_x);
\r
373 Mat map_y_host(map_y);
\r
375 SANITY_CHECK(map_x_host);
\r
376 SANITY_CHECK(map_y_host);
\r
379 PERF_TEST_P(DevInfo_Size, buildWarpCylindricalMaps, testing::Combine(testing::ValuesIn(devices()),
\r
380 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
382 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
383 Size size = std::tr1::get<1>(GetParam());
\r
385 setDevice(devInfo.deviceID());
\r
387 GpuMat map_x(size, CV_32FC1);
\r
388 GpuMat map_y(size, CV_32FC1);
\r
390 declare.time(0.5).iterations(100);
\r
392 SIMPLE_TEST_CYCLE()
\r
394 buildWarpCylindricalMaps(size, Rect(0, 0, size.width, size.height), Mat::ones(3, 3, CV_32FC1), 1.0, 1.0, map_x, map_y);
\r
397 Mat map_x_host(map_x);
\r
398 Mat map_y_host(map_y);
\r
400 SANITY_CHECK(map_x_host);
\r
401 SANITY_CHECK(map_y_host);
\r
404 PERF_TEST_P(DevInfo_Size, buildWarpSphericalMaps, testing::Combine(testing::ValuesIn(devices()),
\r
405 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
407 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
408 Size size = std::tr1::get<1>(GetParam());
\r
410 setDevice(devInfo.deviceID());
\r
412 GpuMat map_x(size, CV_32FC1);
\r
413 GpuMat map_y(size, CV_32FC1);
\r
415 declare.time(0.5).iterations(100);
\r
417 SIMPLE_TEST_CYCLE()
\r
419 buildWarpSphericalMaps(size, Rect(0, 0, size.width, size.height), Mat::ones(3, 3, CV_32FC1), 1.0, 1.0, map_x, map_y);
\r
422 Mat map_x_host(map_x);
\r
423 Mat map_y_host(map_y);
\r
425 SANITY_CHECK(map_x_host);
\r
426 SANITY_CHECK(map_y_host);
\r
429 PERF_TEST_P(DevInfo_Size_MatType_Interpolation, rotate, testing::Combine(testing::ValuesIn(devices()),
\r
430 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
431 testing::Values(CV_8UC1, CV_8UC4),
\r
432 testing::Values((int)INTER_NEAREST, (int)INTER_LINEAR, (int)INTER_CUBIC)))
\r
434 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
435 Size size = std::tr1::get<1>(GetParam());
\r
436 int type = std::tr1::get<2>(GetParam());
\r
437 int interpolation = std::tr1::get<3>(GetParam());
\r
439 setDevice(devInfo.deviceID());
\r
441 Mat src_host(size, type);
\r
443 declare.in(src_host, WARMUP_RNG);
\r
445 GpuMat src(src_host);
\r
446 GpuMat dst(size, type);
\r
448 declare.time(0.5).iterations(100);
\r
450 SIMPLE_TEST_CYCLE()
\r
452 rotate(src, dst, size, 30.0, 0, 0, interpolation);
\r
457 SANITY_CHECK(dst_host);
\r
460 PERF_TEST_P(DevInfo_Size_MatType, copyMakeBorder, testing::Combine(testing::ValuesIn(devices()),
\r
461 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
462 testing::Values(CV_8UC1, CV_8UC4, CV_32SC1)))
\r
464 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
465 Size size = std::tr1::get<1>(GetParam());
\r
466 int type = std::tr1::get<2>(GetParam());
\r
468 setDevice(devInfo.deviceID());
\r
470 Mat src_host(size, type);
\r
472 declare.in(src_host, WARMUP_RNG);
\r
474 GpuMat src(src_host);
\r
477 declare.time(0.5).iterations(100);
\r
479 SIMPLE_TEST_CYCLE()
\r
481 copyMakeBorder(src, dst, 5, 5, 5, 5);
\r
486 SANITY_CHECK(dst_host);
\r
489 PERF_TEST_P(DevInfo_Size, integralBuffered, testing::Combine(testing::ValuesIn(devices()),
\r
490 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
492 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
493 Size size = std::tr1::get<1>(GetParam());
\r
495 setDevice(devInfo.deviceID());
\r
497 Mat src_host(size, CV_8UC1);
\r
499 declare.in(src_host, WARMUP_RNG);
\r
501 GpuMat src(src_host);
\r
505 declare.time(0.5).iterations(100);
\r
507 SIMPLE_TEST_CYCLE()
\r
509 integralBuffered(src, dst, buf);
\r
514 SANITY_CHECK(dst_host);
\r
517 PERF_TEST_P(DevInfo_Size, integral, testing::Combine(testing::ValuesIn(devices()),
\r
518 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
520 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
521 Size size = std::tr1::get<1>(GetParam());
\r
523 setDevice(devInfo.deviceID());
\r
525 Mat src_host(size, CV_8UC1);
\r
527 declare.in(src_host, WARMUP_RNG);
\r
529 GpuMat src(src_host);
\r
532 declare.time(0.5).iterations(100);
\r
534 SIMPLE_TEST_CYCLE()
\r
536 integral(src, sum, sqsum);
\r
540 Mat sqsum_host(sqsum);
\r
542 SANITY_CHECK(sum_host);
\r
543 SANITY_CHECK(sqsum_host);
\r
546 PERF_TEST_P(DevInfo_Size, sqrIntegral, testing::Combine(testing::ValuesIn(devices()),
\r
547 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
549 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
550 Size size = std::tr1::get<1>(GetParam());
\r
552 setDevice(devInfo.deviceID());
\r
554 Mat src_host(size, CV_8UC1);
\r
556 declare.in(src_host, WARMUP_RNG);
\r
558 GpuMat src(src_host);
\r
561 declare.time(0.5).iterations(100);
\r
563 SIMPLE_TEST_CYCLE()
\r
565 sqrIntegral(src, dst);
\r
570 SANITY_CHECK(dst_host);
\r
573 PERF_TEST_P(DevInfo_Size, columnSum, testing::Combine(testing::ValuesIn(devices()),
\r
574 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
576 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
577 Size size = std::tr1::get<1>(GetParam());
\r
579 setDevice(devInfo.deviceID());
\r
581 Mat src_host(size, CV_32FC1);
\r
583 declare.in(src_host, WARMUP_RNG);
\r
585 GpuMat src(src_host);
\r
588 declare.time(0.5).iterations(100);
\r
590 SIMPLE_TEST_CYCLE()
\r
592 columnSum(src, dst);
\r
597 SANITY_CHECK(dst_host);
\r
600 PERF_TEST_P(DevInfo_MatType, cornerHarris, testing::Combine(testing::ValuesIn(devices()),
\r
601 testing::Values(CV_8UC1, CV_32FC1)))
\r
603 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
604 int type = std::tr1::get<1>(GetParam());
\r
606 setDevice(devInfo.deviceID());
\r
608 Mat img = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);
\r
609 ASSERT_FALSE(img.empty());
\r
611 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
622 declare.time(0.5).iterations(100);
\r
624 SIMPLE_TEST_CYCLE()
\r
626 cornerHarris(src, dst, Dx, Dy, blockSize, ksize, k);
\r
633 SANITY_CHECK(dst_host);
\r
634 SANITY_CHECK(Dx_host);
\r
635 SANITY_CHECK(Dy_host);
\r
638 PERF_TEST_P(DevInfo_MatType, cornerMinEigenVal, testing::Combine(testing::ValuesIn(devices()),
\r
639 testing::Values(CV_8UC1, CV_32FC1)))
\r
641 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
642 int type = std::tr1::get<1>(GetParam());
\r
644 setDevice(devInfo.deviceID());
\r
646 Mat img = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);
\r
647 ASSERT_FALSE(img.empty());
\r
649 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
659 declare.time(0.5).iterations(100);
\r
661 SIMPLE_TEST_CYCLE()
\r
663 cornerMinEigenVal(src, dst, Dx, Dy, blockSize, ksize);
\r
670 SANITY_CHECK(dst_host);
\r
671 SANITY_CHECK(Dx_host);
\r
672 SANITY_CHECK(Dy_host);
\r
675 PERF_TEST_P(DevInfo_Size_MatType, mulSpectrums, testing::Combine(testing::ValuesIn(devices()),
\r
676 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
677 testing::Values(CV_8UC1, CV_32FC1)))
\r
679 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
680 Size size = std::tr1::get<1>(GetParam());
\r
681 int type = std::tr1::get<2>(GetParam());
\r
683 setDevice(devInfo.deviceID());
\r
685 Mat a_host(size, CV_32FC2);
\r
686 Mat b_host(size, CV_32FC2);
\r
688 declare.in(a_host, b_host, WARMUP_RNG);
\r
694 declare.time(0.5).iterations(100);
\r
696 SIMPLE_TEST_CYCLE()
\r
698 mulSpectrums(a, b, dst, 0);
\r
703 SANITY_CHECK(dst_host);
\r
706 PERF_TEST_P(DevInfo_Size, dft, testing::Combine(testing::ValuesIn(devices()),
\r
707 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
709 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
710 Size size = std::tr1::get<1>(GetParam());
\r
712 setDevice(devInfo.deviceID());
\r
714 Mat src_host(size, CV_32FC2);
\r
716 declare.in(src_host, WARMUP_RNG);
\r
718 GpuMat src(src_host);
\r
721 declare.time(2.0).iterations(100);
\r
723 SIMPLE_TEST_CYCLE()
\r
725 dft(src, dst, size);
\r
730 SANITY_CHECK(dst_host);
\r
733 PERF_TEST_P(DevInfo_Size, convolve, testing::Combine(testing::ValuesIn(devices()),
\r
734 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
736 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
737 Size size = std::tr1::get<1>(GetParam());
\r
739 setDevice(devInfo.deviceID());
\r
741 Mat image_host(size, CV_32FC1);
\r
742 Mat templ_host(size, CV_32FC1);
\r
744 declare.in(image_host, templ_host, WARMUP_RNG);
\r
746 GpuMat image(image_host);
\r
747 GpuMat templ(templ_host);
\r
751 declare.time(2.0).iterations(100);
\r
753 SIMPLE_TEST_CYCLE()
\r
755 convolve(image, templ, dst, false, buf);
\r
760 SANITY_CHECK(dst_host);
\r
763 PERF_TEST_P(DevInfo_Size_MatType, pyrDown, testing::Combine(testing::ValuesIn(devices()),
\r
764 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
765 testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)))
\r
767 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
768 Size size = std::tr1::get<1>(GetParam());
\r
769 int type = std::tr1::get<2>(GetParam());
\r
771 setDevice(devInfo.deviceID());
\r
773 Mat src_host(size, type);
\r
775 declare.in(src_host, WARMUP_RNG);
\r
777 GpuMat src(src_host);
\r
780 declare.time(0.5).iterations(100);
\r
782 SIMPLE_TEST_CYCLE()
\r
789 SANITY_CHECK(dst_host);
\r
792 PERF_TEST_P(DevInfo_Size_MatType, pyrUp, testing::Combine(testing::ValuesIn(devices()),
\r
793 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
794 testing::Values(CV_8UC1, CV_8UC4, CV_16SC3, CV_32FC1)))
\r
796 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
797 Size size = std::tr1::get<1>(GetParam());
\r
798 int type = std::tr1::get<2>(GetParam());
\r
800 setDevice(devInfo.deviceID());
\r
802 Mat src_host(size, type);
\r
804 declare.in(src_host, WARMUP_RNG);
\r
806 GpuMat src(src_host);
\r
809 declare.time(0.5).iterations(100);
\r
811 SIMPLE_TEST_CYCLE()
\r
818 SANITY_CHECK(dst_host);
\r
821 PERF_TEST_P(DevInfo_Size_MatType, blendLinear, testing::Combine(testing::ValuesIn(devices()),
\r
822 testing::Values(GPU_TYPICAL_MAT_SIZES),
\r
823 testing::Values(CV_8UC1, CV_32FC1)))
\r
825 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
826 Size size = std::tr1::get<1>(GetParam());
\r
827 int type = std::tr1::get<2>(GetParam());
\r
829 setDevice(devInfo.deviceID());
\r
831 Mat img1_host(size, type);
\r
832 Mat img2_host(size, type);
\r
834 declare.in(img1_host, img2_host, WARMUP_RNG);
\r
836 GpuMat img1(img1_host);
\r
837 GpuMat img2(img2_host);
\r
838 GpuMat weights1(size, CV_32FC1, Scalar::all(0.5));
\r
839 GpuMat weights2(size, CV_32FC1, Scalar::all(0.5));
\r
842 declare.time(0.5).iterations(100);
\r
844 SIMPLE_TEST_CYCLE()
\r
846 blendLinear(img1, img2, weights1, weights2, dst);
\r
851 SANITY_CHECK(dst_host);
\r
854 PERF_TEST_P(DevInfo, Canny, testing::ValuesIn(devices()))
\r
856 DeviceInfo devInfo = GetParam();
\r
858 setDevice(devInfo.deviceID());
\r
860 Mat image_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE);
\r
861 ASSERT_FALSE(image_host.empty());
\r
863 GpuMat image(image_host);
\r
867 declare.time(0.5).iterations(100);
\r
869 SIMPLE_TEST_CYCLE()
\r
871 Canny(image, buf, dst, 50.0, 100.0);
\r
876 SANITY_CHECK(dst_host);
\r
879 PERF_TEST_P(DevInfo_Size, calcHist, testing::Combine(testing::ValuesIn(devices()),
\r
880 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
882 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
883 Size size = std::tr1::get<1>(GetParam());
\r
885 setDevice(devInfo.deviceID());
\r
887 Mat src_host(size, CV_8UC1);
\r
889 declare.in(src_host, WARMUP_RNG);
\r
891 GpuMat src(src_host);
\r
895 declare.time(0.5).iterations(100);
\r
897 SIMPLE_TEST_CYCLE()
\r
899 calcHist(src, hist, buf);
\r
902 Mat hist_host(hist);
\r
904 SANITY_CHECK(hist_host);
\r
907 PERF_TEST_P(DevInfo_Size, equalizeHist, testing::Combine(testing::ValuesIn(devices()),
\r
908 testing::Values(GPU_TYPICAL_MAT_SIZES)))
\r
910 DeviceInfo devInfo = std::tr1::get<0>(GetParam());
\r
911 Size size = std::tr1::get<1>(GetParam());
\r
913 setDevice(devInfo.deviceID());
\r
915 Mat src_host(size, CV_8UC1);
\r
917 declare.in(src_host, WARMUP_RNG);
\r
919 GpuMat src(src_host);
\r
924 declare.time(0.5).iterations(100);
\r
926 SIMPLE_TEST_CYCLE()
\r
928 equalizeHist(src, dst, hist, buf);
\r
933 SANITY_CHECK(dst_host);
\r