1 #include "perf_precomp.hpp"
\r
5 //////////////////////////////////////////////////////////////////////
\r
8 GPU_PERF_TEST(Remap, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation, BorderMode)
\r
10 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
11 cv::gpu::setDevice(devInfo.deviceID());
\r
13 cv::Size size = GET_PARAM(1);
\r
14 int type = GET_PARAM(2);
\r
15 int interpolation = GET_PARAM(3);
\r
16 int borderMode = GET_PARAM(4);
\r
18 cv::Mat src_host(size, type);
\r
19 fill(src_host, 0, 255);
\r
21 cv::Mat xmap_host(size, CV_32FC1);
\r
22 fill(xmap_host, 0, size.width);
\r
24 cv::Mat ymap_host(size, CV_32FC1);
\r
25 fill(ymap_host, 0, size.height);
\r
27 cv::gpu::GpuMat src(src_host);
\r
28 cv::gpu::GpuMat xmap(xmap_host);
\r
29 cv::gpu::GpuMat ymap(ymap_host);
\r
30 cv::gpu::GpuMat dst;
\r
32 cv::gpu::remap(src, dst, xmap, ymap, interpolation, borderMode);
\r
38 cv::gpu::remap(src, dst, xmap, ymap, interpolation, borderMode);
\r
42 INSTANTIATE_TEST_CASE_P(ImgProc, Remap, testing::Combine(
\r
44 GPU_TYPICAL_MAT_SIZES,
\r
45 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
46 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
47 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
\r
48 testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
\r
49 testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_CONSTANT), BorderMode(cv::BORDER_REFLECT), BorderMode(cv::BORDER_WRAP))));
\r
52 //////////////////////////////////////////////////////////////////////
\r
55 IMPLEMENT_PARAM_CLASS(Scale, double)
\r
57 GPU_PERF_TEST(Resize, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation, Scale)
\r
59 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
60 cv::gpu::setDevice(devInfo.deviceID());
\r
62 cv::Size size = GET_PARAM(1);
\r
63 int type = GET_PARAM(2);
\r
64 int interpolation = GET_PARAM(3);
\r
65 double f = GET_PARAM(4);
\r
67 cv::Mat src_host(size, type);
\r
68 fill(src_host, 0, 255);
\r
70 cv::gpu::GpuMat src(src_host);
\r
71 cv::gpu::GpuMat dst;
\r
73 cv::gpu::resize(src, dst, cv::Size(), f, f, interpolation);
\r
79 cv::gpu::resize(src, dst, cv::Size(), f, f, interpolation);
\r
83 INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(
\r
85 GPU_TYPICAL_MAT_SIZES,
\r
86 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
87 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
88 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
\r
89 testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR),
\r
90 Interpolation(cv::INTER_CUBIC), Interpolation(cv::INTER_AREA)),
\r
91 testing::Values(Scale(0.5), Scale(0.3), Scale(2.0))));
\r
93 //////////////////////////////////////////////////////////////////////
\r
96 GPU_PERF_TEST(WarpAffine, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation, BorderMode)
\r
98 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
99 cv::gpu::setDevice(devInfo.deviceID());
\r
101 cv::Size size = GET_PARAM(1);
\r
102 int type = GET_PARAM(2);
\r
103 int interpolation = GET_PARAM(3);
\r
104 int borderMode = GET_PARAM(4);
\r
106 cv::Mat src_host(size, type);
\r
107 fill(src_host, 0, 255);
\r
109 cv::gpu::GpuMat src(src_host);
\r
110 cv::gpu::GpuMat dst;
\r
112 const double aplha = CV_PI / 4;
\r
113 double mat[2][3] = { {std::cos(aplha), -std::sin(aplha), src.cols / 2},
\r
114 {std::sin(aplha), std::cos(aplha), 0}};
\r
115 cv::Mat M(2, 3, CV_64F, (void*) mat);
\r
117 cv::gpu::warpAffine(src, dst, M, size, interpolation, borderMode);
\r
121 cv::gpu::warpAffine(src, dst, M, size, interpolation, borderMode);
\r
125 INSTANTIATE_TEST_CASE_P(ImgProc, WarpAffine, testing::Combine(
\r
127 GPU_TYPICAL_MAT_SIZES,
\r
128 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
129 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
130 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
\r
131 testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
\r
132 testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_CONSTANT), BorderMode(cv::BORDER_REFLECT), BorderMode(cv::BORDER_WRAP))));
\r
134 //////////////////////////////////////////////////////////////////////
\r
137 GPU_PERF_TEST(WarpPerspective, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation, BorderMode)
\r
139 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
140 cv::gpu::setDevice(devInfo.deviceID());
\r
142 cv::Size size = GET_PARAM(1);
\r
143 int type = GET_PARAM(2);
\r
144 int interpolation = GET_PARAM(3);
\r
145 int borderMode = GET_PARAM(4);
\r
147 cv::Mat src_host(size, type);
\r
148 fill(src_host, 0, 255);
\r
150 cv::gpu::GpuMat src(src_host);
\r
151 cv::gpu::GpuMat dst;
\r
153 const double aplha = CV_PI / 4;
\r
154 double mat[3][3] = { {std::cos(aplha), -std::sin(aplha), src.cols / 2},
\r
155 {std::sin(aplha), std::cos(aplha), 0},
\r
157 cv::Mat M(3, 3, CV_64F, (void*) mat);
\r
159 cv::gpu::warpPerspective(src, dst, M, size, interpolation, borderMode);
\r
163 cv::gpu::warpPerspective(src, dst, M, size, interpolation, borderMode);
\r
167 INSTANTIATE_TEST_CASE_P(ImgProc, WarpPerspective, testing::Combine(
\r
169 GPU_TYPICAL_MAT_SIZES,
\r
170 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
171 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
172 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
\r
173 testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
\r
174 testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_CONSTANT), BorderMode(cv::BORDER_REFLECT), BorderMode(cv::BORDER_WRAP))));
\r
176 //////////////////////////////////////////////////////////////////////
\r
179 GPU_PERF_TEST(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, MatType, BorderMode)
\r
181 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
182 cv::gpu::setDevice(devInfo.deviceID());
\r
184 cv::Size size = GET_PARAM(1);
\r
185 int type = GET_PARAM(2);
\r
186 int borderType = GET_PARAM(3);
\r
188 cv::Mat src_host(size, type);
\r
189 fill(src_host, 0, 255);
\r
191 cv::gpu::GpuMat src(src_host);
\r
192 cv::gpu::GpuMat dst;
\r
194 cv::gpu::copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);
\r
198 cv::gpu::copyMakeBorder(src, dst, 5, 5, 5, 5, borderType);
\r
202 INSTANTIATE_TEST_CASE_P(ImgProc, CopyMakeBorder, testing::Combine(
\r
204 GPU_TYPICAL_MAT_SIZES,
\r
205 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
206 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
207 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
\r
208 testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_CONSTANT), BorderMode(cv::BORDER_REFLECT), BorderMode(cv::BORDER_WRAP))));
\r
210 //////////////////////////////////////////////////////////////////////
\r
213 CV_ENUM(ThreshOp, cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC, cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV)
\r
214 #define ALL_THRESH_OPS testing::Values(ThreshOp(cv::THRESH_BINARY), ThreshOp(cv::THRESH_BINARY_INV), ThreshOp(cv::THRESH_TRUNC), ThreshOp(cv::THRESH_TOZERO), ThreshOp(cv::THRESH_TOZERO_INV))
\r
216 GPU_PERF_TEST(Threshold, cv::gpu::DeviceInfo, cv::Size, MatDepth, ThreshOp)
\r
218 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
219 cv::gpu::setDevice(devInfo.deviceID());
\r
221 cv::Size size = GET_PARAM(1);
\r
222 int depth = GET_PARAM(2);
\r
223 int threshOp = GET_PARAM(3);
\r
225 cv::Mat src_host(size, depth);
\r
226 fill(src_host, 0, 255);
\r
228 cv::gpu::GpuMat src(src_host);
\r
229 cv::gpu::GpuMat dst;
\r
231 cv::gpu::threshold(src, dst, 100.0, 255.0, threshOp);
\r
235 cv::gpu::threshold(src, dst, 100.0, 255.0, threshOp);
\r
239 INSTANTIATE_TEST_CASE_P(ImgProc, Threshold, testing::Combine(
\r
241 GPU_TYPICAL_MAT_SIZES,
\r
242 testing::Values(MatDepth(CV_8U), MatDepth(CV_16U), MatDepth(CV_32F), MatDepth(CV_64F)),
\r
245 //////////////////////////////////////////////////////////////////////
\r
248 GPU_PERF_TEST(Integral, cv::gpu::DeviceInfo, cv::Size)
\r
250 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
251 cv::gpu::setDevice(devInfo.deviceID());
\r
253 cv::Size size = GET_PARAM(1);
\r
255 cv::Mat src_host(size, CV_8UC1);
\r
256 fill(src_host, 0, 255);
\r
258 cv::gpu::GpuMat src(src_host);
\r
259 cv::gpu::GpuMat dst;
\r
260 cv::gpu::GpuMat buf;
\r
262 cv::gpu::integralBuffered(src, dst, buf);
\r
266 cv::gpu::integralBuffered(src, dst, buf);
\r
270 INSTANTIATE_TEST_CASE_P(ImgProc, Integral, testing::Combine(
\r
272 GPU_TYPICAL_MAT_SIZES));
\r
274 //////////////////////////////////////////////////////////////////////
\r
277 GPU_PERF_TEST(Integral_Sqr, cv::gpu::DeviceInfo, cv::Size)
\r
279 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
280 cv::gpu::setDevice(devInfo.deviceID());
\r
282 cv::Size size = GET_PARAM(1);
\r
284 cv::Mat src_host(size, CV_8UC1);
\r
285 fill(src_host, 0, 255);
\r
287 cv::gpu::GpuMat src(src_host);
\r
288 cv::gpu::GpuMat dst;
\r
290 cv::gpu::sqrIntegral(src, dst);
\r
294 cv::gpu::sqrIntegral(src, dst);
\r
298 INSTANTIATE_TEST_CASE_P(ImgProc, Integral_Sqr, testing::Combine(
\r
300 GPU_TYPICAL_MAT_SIZES));
\r
302 //////////////////////////////////////////////////////////////////////
\r
303 // HistEven_OneChannel
\r
305 GPU_PERF_TEST(HistEven_OneChannel, cv::gpu::DeviceInfo, cv::Size, MatDepth)
\r
307 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
308 cv::gpu::setDevice(devInfo.deviceID());
\r
310 cv::Size size = GET_PARAM(1);
\r
311 int depth = GET_PARAM(2);
\r
313 cv::Mat src_host(size, depth);
\r
314 fill(src_host, 0, 255);
\r
316 cv::gpu::GpuMat src(src_host);
\r
317 cv::gpu::GpuMat hist;
\r
318 cv::gpu::GpuMat buf;
\r
320 cv::gpu::histEven(src, hist, buf, 30, 0, 180);
\r
324 cv::gpu::histEven(src, hist, buf, 30, 0, 180);
\r
328 INSTANTIATE_TEST_CASE_P(ImgProc, HistEven_OneChannel, testing::Combine(
\r
330 GPU_TYPICAL_MAT_SIZES,
\r
331 testing::Values(MatDepth(CV_8U), MatDepth(CV_16U), MatDepth(CV_16S))));
\r
333 //////////////////////////////////////////////////////////////////////
\r
334 // HistEven_FourChannel
\r
336 GPU_PERF_TEST(HistEven_FourChannel, cv::gpu::DeviceInfo, cv::Size, MatDepth)
\r
338 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
339 cv::gpu::setDevice(devInfo.deviceID());
\r
341 cv::Size size = GET_PARAM(1);
\r
342 int depth = GET_PARAM(2);
\r
344 cv::Mat src_host(size, CV_MAKE_TYPE(depth, 4));
\r
345 fill(src_host, 0, 255);
\r
347 cv::gpu::GpuMat src(src_host);
\r
348 cv::gpu::GpuMat hist[4];
\r
349 cv::gpu::GpuMat buf;
\r
350 int histSize[] = {30, 30, 30, 30};
\r
351 int lowerLevel[] = {0, 0, 0, 0};
\r
352 int upperLevel[] = {180, 180, 180, 180};
\r
354 cv::gpu::histEven(src, hist, buf, histSize, lowerLevel, upperLevel);
\r
358 cv::gpu::histEven(src, hist, buf, histSize, lowerLevel, upperLevel);
\r
362 INSTANTIATE_TEST_CASE_P(ImgProc, HistEven_FourChannel, testing::Combine(
\r
364 GPU_TYPICAL_MAT_SIZES,
\r
365 testing::Values(MatDepth(CV_8U), MatDepth(CV_16U), MatDepth(CV_16S))));
\r
367 //////////////////////////////////////////////////////////////////////
\r
370 GPU_PERF_TEST(CalcHist, cv::gpu::DeviceInfo, cv::Size)
\r
372 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
373 cv::gpu::setDevice(devInfo.deviceID());
\r
375 cv::Size size = GET_PARAM(1);
\r
377 cv::Mat src_host(size, CV_8UC1);
\r
378 fill(src_host, 0, 255);
\r
380 cv::gpu::GpuMat src(src_host);
\r
381 cv::gpu::GpuMat hist;
\r
382 cv::gpu::GpuMat buf;
\r
384 cv::gpu::calcHist(src, hist, buf);
\r
388 cv::gpu::calcHist(src, hist, buf);
\r
392 INSTANTIATE_TEST_CASE_P(ImgProc, CalcHist, testing::Combine(
\r
394 GPU_TYPICAL_MAT_SIZES));
\r
396 //////////////////////////////////////////////////////////////////////
\r
399 GPU_PERF_TEST(EqualizeHist, cv::gpu::DeviceInfo, cv::Size)
\r
401 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
402 cv::gpu::setDevice(devInfo.deviceID());
\r
404 cv::Size size = GET_PARAM(1);
\r
406 cv::Mat src_host(size, CV_8UC1);
\r
407 fill(src_host, 0, 255);
\r
409 cv::gpu::GpuMat src(src_host);
\r
410 cv::gpu::GpuMat dst;
\r
411 cv::gpu::GpuMat hist;
\r
412 cv::gpu::GpuMat buf;
\r
414 cv::gpu::equalizeHist(src, dst, hist, buf);
\r
418 cv::gpu::equalizeHist(src, dst, hist, buf);
\r
422 INSTANTIATE_TEST_CASE_P(ImgProc, EqualizeHist, testing::Combine(
\r
424 GPU_TYPICAL_MAT_SIZES));
\r
426 //////////////////////////////////////////////////////////////////////
\r
429 GPU_PERF_TEST(ColumnSum, cv::gpu::DeviceInfo, cv::Size)
\r
431 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
432 cv::gpu::setDevice(devInfo.deviceID());
\r
434 cv::Size size = GET_PARAM(1);
\r
436 cv::Mat src_host(size, CV_32FC1);
\r
437 fill(src_host, 0, 255);
\r
439 cv::gpu::GpuMat src(src_host);
\r
440 cv::gpu::GpuMat dst;
\r
442 cv::gpu::columnSum(src, dst);
\r
446 cv::gpu::columnSum(src, dst);
\r
450 INSTANTIATE_TEST_CASE_P(ImgProc, ColumnSum, testing::Combine(
\r
452 GPU_TYPICAL_MAT_SIZES));
\r
454 //////////////////////////////////////////////////////////////////////
\r
457 IMPLEMENT_PARAM_CLASS(AppertureSize, int)
\r
458 IMPLEMENT_PARAM_CLASS(L2gradient, bool)
\r
460 GPU_PERF_TEST(Canny, cv::gpu::DeviceInfo, AppertureSize, L2gradient)
\r
462 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
463 cv::gpu::setDevice(devInfo.deviceID());
\r
465 int apperture_size = GET_PARAM(1);
\r
466 bool useL2gradient = GET_PARAM(2);
\r
468 cv::Mat image_host = readImage("perf/1280x1024.jpg", cv::IMREAD_GRAYSCALE);
\r
469 ASSERT_FALSE(image_host.empty());
\r
471 cv::gpu::GpuMat image(image_host);
\r
472 cv::gpu::GpuMat dst;
\r
473 cv::gpu::CannyBuf buf;
\r
475 cv::gpu::Canny(image, buf, dst, 50.0, 100.0, apperture_size, useL2gradient);
\r
479 cv::gpu::Canny(image, buf, dst, 50.0, 100.0, apperture_size, useL2gradient);
\r
483 INSTANTIATE_TEST_CASE_P(ImgProc, Canny, testing::Combine(
\r
485 testing::Values(AppertureSize(3), AppertureSize(5)),
\r
486 testing::Values(L2gradient(false), L2gradient(true))));
\r
488 //////////////////////////////////////////////////////////////////////
\r
489 // MeanShiftFiltering
\r
491 GPU_PERF_TEST_1(MeanShiftFiltering, cv::gpu::DeviceInfo)
\r
493 cv::gpu::DeviceInfo devInfo = GetParam();
\r
494 cv::gpu::setDevice(devInfo.deviceID());
\r
496 cv::Mat img = readImage("gpu/meanshift/cones.png");
\r
497 ASSERT_FALSE(img.empty());
\r
500 cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
\r
502 cv::gpu::GpuMat src(rgba);
\r
503 cv::gpu::GpuMat dst;
\r
505 cv::gpu::meanShiftFiltering(src, dst, 50, 50);
\r
511 cv::gpu::meanShiftFiltering(src, dst, 50, 50);
\r
515 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftFiltering, ALL_DEVICES);
\r
517 //////////////////////////////////////////////////////////////////////
\r
520 GPU_PERF_TEST_1(MeanShiftProc, cv::gpu::DeviceInfo)
\r
522 cv::gpu::DeviceInfo devInfo = GetParam();
\r
523 cv::gpu::setDevice(devInfo.deviceID());
\r
525 cv::Mat img = readImage("gpu/meanshift/cones.png");
\r
526 ASSERT_FALSE(img.empty());
\r
529 cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
\r
531 cv::gpu::GpuMat src(rgba);
\r
532 cv::gpu::GpuMat dstr;
\r
533 cv::gpu::GpuMat dstsp;
\r
535 cv::gpu::meanShiftProc(src, dstr, dstsp, 50, 50);
\r
541 cv::gpu::meanShiftProc(src, dstr, dstsp, 50, 50);
\r
545 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftProc, ALL_DEVICES);
\r
547 //////////////////////////////////////////////////////////////////////
\r
548 // MeanShiftSegmentation
\r
550 GPU_PERF_TEST_1(MeanShiftSegmentation, cv::gpu::DeviceInfo)
\r
552 cv::gpu::DeviceInfo devInfo = GetParam();
\r
553 cv::gpu::setDevice(devInfo.deviceID());
\r
555 cv::Mat img = readImage("gpu/meanshift/cones.png");
\r
556 ASSERT_FALSE(img.empty());
\r
559 cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
\r
561 cv::gpu::GpuMat src(rgba);
\r
564 meanShiftSegmentation(src, dst, 10, 10, 20);
\r
570 meanShiftSegmentation(src, dst, 10, 10, 20);
\r
574 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftSegmentation, ALL_DEVICES);
\r
576 //////////////////////////////////////////////////////////////////////
\r
579 GPU_PERF_TEST(BlendLinear, cv::gpu::DeviceInfo, cv::Size, MatType)
\r
581 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
582 cv::gpu::setDevice(devInfo.deviceID());
\r
584 cv::Size size = GET_PARAM(1);
\r
585 int type = GET_PARAM(2);
\r
587 cv::Mat img1_host(size, type);
\r
588 fill(img1_host, 0, 255);
\r
590 cv::Mat img2_host(size, type);
\r
591 fill(img2_host, 0, 255);
\r
593 cv::gpu::GpuMat img1(img1_host);
\r
594 cv::gpu::GpuMat img2(img2_host);
\r
595 cv::gpu::GpuMat weights1(size, CV_32FC1, cv::Scalar::all(0.5));
\r
596 cv::gpu::GpuMat weights2(size, CV_32FC1, cv::Scalar::all(0.5));
\r
597 cv::gpu::GpuMat dst;
\r
599 cv::gpu::blendLinear(img1, img2, weights1, weights2, dst);
\r
603 cv::gpu::blendLinear(img1, img2, weights1, weights2, dst);
\r
607 INSTANTIATE_TEST_CASE_P(ImgProc, BlendLinear, testing::Combine(
\r
609 GPU_TYPICAL_MAT_SIZES,
\r
610 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
611 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4))));
\r
613 //////////////////////////////////////////////////////////////////////
\r
616 IMPLEMENT_PARAM_CLASS(KSize, int)
\r
617 IMPLEMENT_PARAM_CLASS(Ccorr, bool)
\r
619 GPU_PERF_TEST(Convolve, cv::gpu::DeviceInfo, cv::Size, KSize, Ccorr)
\r
621 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
622 cv::gpu::setDevice(devInfo.deviceID());
\r
624 cv::Size size = GET_PARAM(1);
\r
625 int templ_size = GET_PARAM(2);
\r
626 bool ccorr = GET_PARAM(3);
\r
628 cv::gpu::GpuMat image = cv::gpu::createContinuous(size, CV_32FC1);
\r
629 image.setTo(cv::Scalar(1.0));
\r
631 cv::gpu::GpuMat templ = cv::gpu::createContinuous(templ_size, templ_size, CV_32FC1);
\r
632 templ.setTo(cv::Scalar(1.0));
\r
634 cv::gpu::GpuMat dst;
\r
635 cv::gpu::ConvolveBuf buf;
\r
637 cv::gpu::convolve(image, templ, dst, ccorr, buf);
\r
643 cv::gpu::convolve(image, templ, dst, ccorr, buf);
\r
647 INSTANTIATE_TEST_CASE_P(ImgProc, Convolve, testing::Combine(
\r
649 GPU_TYPICAL_MAT_SIZES,
\r
650 testing::Values(KSize(3), KSize(9), KSize(17), KSize(27), KSize(32), KSize(64)),
\r
651 testing::Values(Ccorr(false), Ccorr(true))));
\r
653 ////////////////////////////////////////////////////////////////////////////////
\r
654 // MatchTemplate_8U
\r
656 CV_ENUM(TemplateMethod, cv::TM_SQDIFF, cv::TM_SQDIFF_NORMED, cv::TM_CCORR, cv::TM_CCORR_NORMED, cv::TM_CCOEFF, cv::TM_CCOEFF_NORMED)
\r
657 #define ALL_TEMPLATE_METHODS testing::Values(TemplateMethod(cv::TM_SQDIFF), TemplateMethod(cv::TM_SQDIFF_NORMED), TemplateMethod(cv::TM_CCORR), TemplateMethod(cv::TM_CCORR_NORMED), TemplateMethod(cv::TM_CCOEFF), TemplateMethod(cv::TM_CCOEFF_NORMED))
\r
659 IMPLEMENT_PARAM_CLASS(TemplateSize, cv::Size)
\r
661 GPU_PERF_TEST(MatchTemplate_8U, cv::gpu::DeviceInfo, cv::Size, TemplateSize, Channels, TemplateMethod)
\r
663 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
664 cv::gpu::setDevice(devInfo.deviceID());
\r
666 cv::Size size = GET_PARAM(1);
\r
667 cv::Size templ_size = GET_PARAM(2);
\r
668 int cn = GET_PARAM(3);
\r
669 int method = GET_PARAM(4);
\r
671 cv::Mat image_host(size, CV_MAKE_TYPE(CV_8U, cn));
\r
672 fill(image_host, 0, 255);
\r
674 cv::Mat templ_host(templ_size, CV_MAKE_TYPE(CV_8U, cn));
\r
675 fill(templ_host, 0, 255);
\r
677 cv::gpu::GpuMat image(image_host);
\r
678 cv::gpu::GpuMat templ(templ_host);
\r
679 cv::gpu::GpuMat dst;
\r
681 cv::gpu::matchTemplate(image, templ, dst, method);
\r
685 cv::gpu::matchTemplate(image, templ, dst, method);
\r
689 INSTANTIATE_TEST_CASE_P(ImgProc, MatchTemplate_8U, testing::Combine(
\r
691 GPU_TYPICAL_MAT_SIZES,
\r
692 testing::Values(TemplateSize(cv::Size(5, 5)), TemplateSize(cv::Size(16, 16)), TemplateSize(cv::Size(30, 30))),
\r
693 testing::Values(Channels(1), Channels(3), Channels(4)),
\r
694 ALL_TEMPLATE_METHODS));
\r
696 ////////////////////////////////////////////////////////////////////////////////
\r
697 // MatchTemplate_32F
\r
699 GPU_PERF_TEST(MatchTemplate_32F, cv::gpu::DeviceInfo, cv::Size, TemplateSize, Channels, TemplateMethod)
\r
701 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
702 cv::gpu::setDevice(devInfo.deviceID());
\r
704 cv::Size size = GET_PARAM(1);
\r
705 cv::Size templ_size = GET_PARAM(2);
\r
706 int cn = GET_PARAM(3);
\r
707 int method = GET_PARAM(4);
\r
709 cv::Mat image_host(size, CV_MAKE_TYPE(CV_32F, cn));
\r
710 fill(image_host, 0, 255);
\r
712 cv::Mat templ_host(templ_size, CV_MAKE_TYPE(CV_32F, cn));
\r
713 fill(templ_host, 0, 255);
\r
715 cv::gpu::GpuMat image(image_host);
\r
716 cv::gpu::GpuMat templ(templ_host);
\r
717 cv::gpu::GpuMat dst;
\r
719 cv::gpu::matchTemplate(image, templ, dst, method);
\r
723 cv::gpu::matchTemplate(image, templ, dst, method);
\r
727 INSTANTIATE_TEST_CASE_P(ImgProc, MatchTemplate_32F, testing::Combine(
\r
729 GPU_TYPICAL_MAT_SIZES,
\r
730 testing::Values(TemplateSize(cv::Size(5, 5)), TemplateSize(cv::Size(16, 16)), TemplateSize(cv::Size(30, 30))),
\r
731 testing::Values(Channels(1), Channels(3), Channels(4)),
\r
732 testing::Values(TemplateMethod(cv::TM_SQDIFF), TemplateMethod(cv::TM_CCORR))));
\r
734 //////////////////////////////////////////////////////////////////////
\r
737 CV_FLAGS(DftFlags, 0, cv::DFT_INVERSE, cv::DFT_SCALE, cv::DFT_ROWS, cv::DFT_COMPLEX_OUTPUT, cv::DFT_REAL_OUTPUT)
\r
739 GPU_PERF_TEST(MulSpectrums, cv::gpu::DeviceInfo, cv::Size, DftFlags)
\r
741 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
742 cv::gpu::setDevice(devInfo.deviceID());
\r
744 cv::Size size = GET_PARAM(1);
\r
745 int flag = GET_PARAM(2);
\r
747 cv::Mat a_host(size, CV_32FC2);
\r
748 fill(a_host, 0, 100);
\r
750 cv::Mat b_host(size, CV_32FC2);
\r
751 fill(b_host, 0, 100);
\r
753 cv::gpu::GpuMat a(a_host);
\r
754 cv::gpu::GpuMat b(b_host);
\r
755 cv::gpu::GpuMat dst;
\r
757 cv::gpu::mulSpectrums(a, b, dst, flag);
\r
761 cv::gpu::mulSpectrums(a, b, dst, flag);
\r
765 INSTANTIATE_TEST_CASE_P(ImgProc, MulSpectrums, testing::Combine(
\r
767 GPU_TYPICAL_MAT_SIZES,
\r
768 testing::Values(DftFlags(0), DftFlags(cv::DFT_ROWS))));
\r
770 //////////////////////////////////////////////////////////////////////
\r
771 // MulAndScaleSpectrums
\r
773 GPU_PERF_TEST(MulAndScaleSpectrums, cv::gpu::DeviceInfo, cv::Size)
\r
775 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
776 cv::gpu::setDevice(devInfo.deviceID());
\r
778 cv::Size size = GET_PARAM(1);
\r
780 float scale = 1.f / size.area();
\r
782 cv::Mat src1_host(size, CV_32FC2);
\r
783 fill(src1_host, 0, 100);
\r
785 cv::Mat src2_host(size, CV_32FC2);
\r
786 fill(src2_host, 0, 100);
\r
788 cv::gpu::GpuMat src1(src1_host);
\r
789 cv::gpu::GpuMat src2(src2_host);
\r
790 cv::gpu::GpuMat dst;
\r
792 cv::gpu::mulAndScaleSpectrums(src1, src2, dst, cv::DFT_ROWS, scale, false);
\r
796 cv::gpu::mulAndScaleSpectrums(src1, src2, dst, cv::DFT_ROWS, scale, false);
\r
800 INSTANTIATE_TEST_CASE_P(ImgProc, MulAndScaleSpectrums, testing::Combine(
\r
802 GPU_TYPICAL_MAT_SIZES));
\r
804 //////////////////////////////////////////////////////////////////////
\r
807 GPU_PERF_TEST(Dft, cv::gpu::DeviceInfo, cv::Size, DftFlags)
\r
809 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
810 cv::gpu::setDevice(devInfo.deviceID());
\r
812 cv::Size size = GET_PARAM(1);
\r
813 int flag = GET_PARAM(2);
\r
815 cv::Mat src_host(size, CV_32FC2);
\r
816 fill(src_host, 0, 100);
\r
818 cv::gpu::GpuMat src(src_host);
\r
819 cv::gpu::GpuMat dst;
\r
821 cv::gpu::dft(src, dst, size, flag);
\r
827 cv::gpu::dft(src, dst, size, flag);
\r
831 INSTANTIATE_TEST_CASE_P(ImgProc, Dft, testing::Combine(
\r
833 GPU_TYPICAL_MAT_SIZES,
\r
834 testing::Values(DftFlags(0), DftFlags(cv::DFT_ROWS), DftFlags(cv::DFT_INVERSE))));
\r
836 //////////////////////////////////////////////////////////////////////
\r
839 IMPLEMENT_PARAM_CLASS(BlockSize, int)
\r
840 IMPLEMENT_PARAM_CLASS(ApertureSize, int)
\r
842 GPU_PERF_TEST(CornerHarris, cv::gpu::DeviceInfo, MatType, BorderMode, BlockSize, ApertureSize)
\r
844 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
845 cv::gpu::setDevice(devInfo.deviceID());
\r
847 int type = GET_PARAM(1);
\r
848 int borderType = GET_PARAM(2);
\r
849 int blockSize = GET_PARAM(3);
\r
850 int apertureSize = GET_PARAM(4);
\r
852 cv::Mat img = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
\r
853 ASSERT_FALSE(img.empty());
\r
855 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
857 cv::gpu::GpuMat src(img);
\r
858 cv::gpu::GpuMat dst;
\r
859 cv::gpu::GpuMat Dx;
\r
860 cv::gpu::GpuMat Dy;
\r
861 cv::gpu::GpuMat buf;
\r
865 cv::gpu::cornerHarris(src, dst, Dx, Dy, buf, blockSize, apertureSize, k, borderType);
\r
869 cv::gpu::cornerHarris(src, dst, Dx, Dy, buf, blockSize, apertureSize, k, borderType);
\r
873 INSTANTIATE_TEST_CASE_P(ImgProc, CornerHarris, testing::Combine(
\r
875 testing::Values(MatType(CV_8UC1), MatType(CV_32FC1)),
\r
876 testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_REFLECT)),
\r
877 testing::Values(BlockSize(3), BlockSize(5), BlockSize(7)),
\r
878 testing::Values(ApertureSize(0), ApertureSize(3), ApertureSize(5), ApertureSize(7))));
\r
880 //////////////////////////////////////////////////////////////////////
\r
881 // CornerMinEigenVal
\r
883 GPU_PERF_TEST(CornerMinEigenVal, cv::gpu::DeviceInfo, MatType, BorderMode, BlockSize, ApertureSize)
\r
885 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
886 cv::gpu::setDevice(devInfo.deviceID());
\r
888 int type = GET_PARAM(1);
\r
889 int borderType = GET_PARAM(2);
\r
890 int blockSize = GET_PARAM(3);
\r
891 int apertureSize = GET_PARAM(4);
\r
893 cv::Mat img = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
\r
894 ASSERT_FALSE(img.empty());
\r
896 img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
\r
898 cv::gpu::GpuMat src(img);
\r
899 cv::gpu::GpuMat dst;
\r
900 cv::gpu::GpuMat Dx;
\r
901 cv::gpu::GpuMat Dy;
\r
902 cv::gpu::GpuMat buf;
\r
904 cv::gpu::cornerMinEigenVal(src, dst, Dx, Dy, buf, blockSize, apertureSize, borderType);
\r
908 cv::gpu::cornerMinEigenVal(src, dst, Dx, Dy, buf, blockSize, apertureSize, borderType);
\r
912 INSTANTIATE_TEST_CASE_P(ImgProc, CornerMinEigenVal, testing::Combine(
\r
914 testing::Values(MatType(CV_8UC1), MatType(CV_32FC1)),
\r
915 testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_REFLECT)),
\r
916 testing::Values(BlockSize(3), BlockSize(5), BlockSize(7)),
\r
917 testing::Values(ApertureSize(0), ApertureSize(3), ApertureSize(5), ApertureSize(7))));
\r
919 //////////////////////////////////////////////////////////////////////
\r
920 // BuildWarpPlaneMaps
\r
922 GPU_PERF_TEST(BuildWarpPlaneMaps, cv::gpu::DeviceInfo, cv::Size)
\r
924 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
925 cv::gpu::setDevice(devInfo.deviceID());
\r
927 cv::Size size = GET_PARAM(1);
\r
929 cv::Mat K = cv::Mat::eye(3, 3, CV_32FC1);
\r
930 cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
\r
931 cv::Mat T = cv::Mat::zeros(1, 3, CV_32F);
\r
932 cv::gpu::GpuMat map_x;
\r
933 cv::gpu::GpuMat map_y;
\r
935 cv::gpu::buildWarpPlaneMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, T, 1.0, map_x, map_y);
\r
939 cv::gpu::buildWarpPlaneMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, T, 1.0, map_x, map_y);
\r
943 INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpPlaneMaps, testing::Combine(
\r
945 GPU_TYPICAL_MAT_SIZES));
\r
947 //////////////////////////////////////////////////////////////////////
\r
948 // BuildWarpCylindricalMaps
\r
950 GPU_PERF_TEST(BuildWarpCylindricalMaps, cv::gpu::DeviceInfo, cv::Size)
\r
952 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
953 cv::gpu::setDevice(devInfo.deviceID());
\r
955 cv::Size size = GET_PARAM(1);
\r
957 cv::Mat K = cv::Mat::eye(3, 3, CV_32FC1);
\r
958 cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
\r
959 cv::gpu::GpuMat map_x;
\r
960 cv::gpu::GpuMat map_y;
\r
962 cv::gpu::buildWarpCylindricalMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, 1.0, map_x, map_y);
\r
966 cv::gpu::buildWarpCylindricalMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, 1.0, map_x, map_y);
\r
970 INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpCylindricalMaps, testing::Combine(
\r
972 GPU_TYPICAL_MAT_SIZES));
\r
974 //////////////////////////////////////////////////////////////////////
\r
975 // BuildWarpSphericalMaps
\r
977 GPU_PERF_TEST(BuildWarpSphericalMaps, cv::gpu::DeviceInfo, cv::Size)
\r
979 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
980 cv::gpu::setDevice(devInfo.deviceID());
\r
982 cv::Size size = GET_PARAM(1);
\r
984 cv::Mat K = cv::Mat::eye(3, 3, CV_32FC1);
\r
985 cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
\r
986 cv::gpu::GpuMat map_x;
\r
987 cv::gpu::GpuMat map_y;
\r
989 cv::gpu::buildWarpSphericalMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, 1.0, map_x, map_y);
\r
993 cv::gpu::buildWarpSphericalMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, 1.0, map_x, map_y);
\r
997 INSTANTIATE_TEST_CASE_P(ImgProc, BuildWarpSphericalMaps, testing::Combine(
\r
999 GPU_TYPICAL_MAT_SIZES));
\r
1001 //////////////////////////////////////////////////////////////////////
\r
1004 GPU_PERF_TEST(Rotate, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation)
\r
1006 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1007 cv::gpu::setDevice(devInfo.deviceID());
\r
1009 cv::Size size = GET_PARAM(1);
\r
1010 int type = GET_PARAM(2);
\r
1011 int interpolation = GET_PARAM(3);
\r
1013 cv::Mat src_host(size, type);
\r
1014 fill(src_host, 0, 255);
\r
1016 cv::gpu::GpuMat src(src_host);
\r
1017 cv::gpu::GpuMat dst;
\r
1019 cv::gpu::rotate(src, dst, size, 30.0, 0, 0, interpolation);
\r
1023 cv::gpu::rotate(src, dst, size, 30.0, 0, 0, interpolation);
\r
1027 INSTANTIATE_TEST_CASE_P(ImgProc, Rotate, testing::Combine(
\r
1029 GPU_TYPICAL_MAT_SIZES,
\r
1030 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
1031 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
1032 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
\r
1033 testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC))));
\r
1035 //////////////////////////////////////////////////////////////////////
\r
1038 GPU_PERF_TEST(PyrDown, cv::gpu::DeviceInfo, cv::Size, MatType)
\r
1040 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1041 cv::gpu::setDevice(devInfo.deviceID());
\r
1043 cv::Size size = GET_PARAM(1);
\r
1044 int type = GET_PARAM(2);
\r
1046 cv::Mat src_host(size, type);
\r
1047 fill(src_host, 0, 255);
\r
1049 cv::gpu::GpuMat src(src_host);
\r
1050 cv::gpu::GpuMat dst;
\r
1052 cv::gpu::pyrDown(src, dst);
\r
1056 cv::gpu::pyrDown(src, dst);
\r
1060 INSTANTIATE_TEST_CASE_P(ImgProc, PyrDown, testing::Combine(
\r
1062 GPU_TYPICAL_MAT_SIZES,
\r
1063 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
1064 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
1065 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4))));
\r
1067 //////////////////////////////////////////////////////////////////////
\r
1070 GPU_PERF_TEST(PyrUp, cv::gpu::DeviceInfo, cv::Size, MatType)
\r
1072 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1073 cv::gpu::setDevice(devInfo.deviceID());
\r
1075 cv::Size size = GET_PARAM(1);
\r
1076 int type = GET_PARAM(2);
\r
1078 cv::Mat src_host(size, type);
\r
1079 fill(src_host, 0, 255);
\r
1081 cv::gpu::GpuMat src(src_host);
\r
1082 cv::gpu::GpuMat dst;
\r
1084 cv::gpu::pyrUp(src, dst);
\r
1088 cv::gpu::pyrUp(src, dst);
\r
1092 INSTANTIATE_TEST_CASE_P(ImgProc, PyrUp, testing::Combine(
\r
1094 GPU_TYPICAL_MAT_SIZES,
\r
1095 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
1096 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
1097 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4))));
\r
1099 //////////////////////////////////////////////////////////////////////
\r
1102 GPU_PERF_TEST(CvtColor, cv::gpu::DeviceInfo, cv::Size, MatDepth, CvtColorInfo)
\r
1104 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1105 cv::gpu::setDevice(devInfo.deviceID());
\r
1107 cv::Size size = GET_PARAM(1);
\r
1108 int depth = GET_PARAM(2);
\r
1109 CvtColorInfo info = GET_PARAM(3);
\r
1111 cv::Mat src_host(size, CV_MAKETYPE(depth, info.scn));
\r
1112 fill(src_host, 0, 255);
\r
1114 cv::gpu::GpuMat src(src_host);
\r
1115 cv::gpu::GpuMat dst;
\r
1117 cv::gpu::cvtColor(src, dst, info.code, info.dcn);
\r
1121 cv::gpu::cvtColor(src, dst, info.code, info.dcn);
\r
1125 INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor, testing::Combine(
\r
1127 GPU_TYPICAL_MAT_SIZES,
\r
1128 testing::Values(MatDepth(CV_8U), MatDepth(CV_16U), MatDepth(CV_32F)),
\r
1129 testing::Values(CvtColorInfo(4, 4, cv::COLOR_RGBA2BGRA),
\r
1130 CvtColorInfo(4, 1, cv::COLOR_BGRA2GRAY),
\r
1131 CvtColorInfo(1, 4, cv::COLOR_GRAY2BGRA),
\r
1132 CvtColorInfo(3, 3, cv::COLOR_BGR2XYZ),
\r
1133 CvtColorInfo(3, 3, cv::COLOR_XYZ2BGR),
\r
1134 CvtColorInfo(3, 3, cv::COLOR_BGR2YCrCb),
\r
1135 CvtColorInfo(3, 3, cv::COLOR_YCrCb2BGR),
\r
1136 CvtColorInfo(3, 3, cv::COLOR_BGR2YUV),
\r
1137 CvtColorInfo(3, 3, cv::COLOR_YUV2BGR),
\r
1138 CvtColorInfo(3, 3, cv::COLOR_BGR2HSV),
\r
1139 CvtColorInfo(3, 3, cv::COLOR_HSV2BGR),
\r
1140 CvtColorInfo(3, 3, cv::COLOR_BGR2HLS),
\r
1141 CvtColorInfo(3, 3, cv::COLOR_HLS2BGR))));
\r
1143 //////////////////////////////////////////////////////////////////////
\r
1146 GPU_PERF_TEST(SwapChannels, cv::gpu::DeviceInfo, cv::Size)
\r
1148 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1149 cv::gpu::setDevice(devInfo.deviceID());
\r
1151 cv::Size size = GET_PARAM(1);
\r
1153 cv::Mat src_host(size, CV_8UC4);
\r
1154 fill(src_host, 0, 255);
\r
1156 cv::gpu::GpuMat src(src_host);
\r
1158 const int dstOrder[] = {2, 1, 0, 3};
\r
1160 cv::gpu::swapChannels(src, dstOrder);
\r
1164 cv::gpu::swapChannels(src, dstOrder);
\r
1168 INSTANTIATE_TEST_CASE_P(ImgProc, SwapChannels, testing::Combine(ALL_DEVICES, GPU_TYPICAL_MAT_SIZES));
\r
1170 //////////////////////////////////////////////////////////////////////
\r
1173 CV_ENUM(AlphaOp, cv::gpu::ALPHA_OVER, cv::gpu::ALPHA_IN, cv::gpu::ALPHA_OUT, cv::gpu::ALPHA_ATOP, cv::gpu::ALPHA_XOR, cv::gpu::ALPHA_PLUS, cv::gpu::ALPHA_OVER_PREMUL, cv::gpu::ALPHA_IN_PREMUL, cv::gpu::ALPHA_OUT_PREMUL, cv::gpu::ALPHA_ATOP_PREMUL, cv::gpu::ALPHA_XOR_PREMUL, cv::gpu::ALPHA_PLUS_PREMUL, cv::gpu::ALPHA_PREMUL)
\r
1175 GPU_PERF_TEST(AlphaComp, cv::gpu::DeviceInfo, cv::Size, MatType, AlphaOp)
\r
1177 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1178 cv::gpu::setDevice(devInfo.deviceID());
\r
1180 cv::Size size = GET_PARAM(1);
\r
1181 int type = GET_PARAM(2);
\r
1182 int alpha_op = GET_PARAM(3);
\r
1184 cv::Mat img1_host(size, type);
\r
1185 fill(img1_host, 0, 255);
\r
1187 cv::Mat img2_host(size, type);
\r
1188 fill(img2_host, 0, 255);
\r
1190 cv::gpu::GpuMat img1(img1_host);
\r
1191 cv::gpu::GpuMat img2(img2_host);
\r
1192 cv::gpu::GpuMat dst;
\r
1194 cv::gpu::alphaComp(img1, img2, dst, alpha_op);
\r
1198 cv::gpu::alphaComp(img1, img2, dst, alpha_op);
\r
1202 INSTANTIATE_TEST_CASE_P(ImgProc, AlphaComp, testing::Combine(
\r
1204 GPU_TYPICAL_MAT_SIZES,
\r
1205 testing::Values(MatType(CV_8UC4), MatType(CV_16UC4), MatType(CV_32SC4), MatType(CV_32FC4)),
\r
1206 testing::Values(AlphaOp(cv::gpu::ALPHA_OVER),
\r
1207 AlphaOp(cv::gpu::ALPHA_IN),
\r
1208 AlphaOp(cv::gpu::ALPHA_OUT),
\r
1209 AlphaOp(cv::gpu::ALPHA_ATOP),
\r
1210 AlphaOp(cv::gpu::ALPHA_XOR),
\r
1211 AlphaOp(cv::gpu::ALPHA_PLUS),
\r
1212 AlphaOp(cv::gpu::ALPHA_OVER_PREMUL),
\r
1213 AlphaOp(cv::gpu::ALPHA_IN_PREMUL),
\r
1214 AlphaOp(cv::gpu::ALPHA_OUT_PREMUL),
\r
1215 AlphaOp(cv::gpu::ALPHA_ATOP_PREMUL),
\r
1216 AlphaOp(cv::gpu::ALPHA_XOR_PREMUL),
\r
1217 AlphaOp(cv::gpu::ALPHA_PLUS_PREMUL),
\r
1218 AlphaOp(cv::gpu::ALPHA_PREMUL))));
\r
1220 //////////////////////////////////////////////////////////////////////
\r
1223 GPU_PERF_TEST(ImagePyramid_build, cv::gpu::DeviceInfo, cv::Size, MatType)
\r
1225 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1226 cv::gpu::setDevice(devInfo.deviceID());
\r
1228 cv::Size size = GET_PARAM(1);
\r
1229 int type = GET_PARAM(2);
\r
1231 cv::Mat src_host(size, type);
\r
1232 fill(src_host, 0, 255);
\r
1234 cv::gpu::GpuMat src(src_host);
\r
1236 cv::gpu::ImagePyramid pyr;
\r
1238 pyr.build(src, 5);
\r
1242 pyr.build(src, 5);
\r
1246 INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_build, testing::Combine(
\r
1248 GPU_TYPICAL_MAT_SIZES,
\r
1249 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
1250 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
1251 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4))));
\r
1253 GPU_PERF_TEST(ImagePyramid_getLayer, cv::gpu::DeviceInfo, cv::Size, MatType)
\r
1255 cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
\r
1256 cv::gpu::setDevice(devInfo.deviceID());
\r
1258 cv::Size size = GET_PARAM(1);
\r
1259 int type = GET_PARAM(2);
\r
1261 cv::Mat src_host(size, type);
\r
1262 fill(src_host, 0, 255);
\r
1264 cv::gpu::GpuMat src(src_host);
\r
1265 cv::gpu::GpuMat dst;
\r
1267 cv::gpu::ImagePyramid pyr(src, 3);
\r
1269 pyr.getLayer(dst, cv::Size(size.width / 2 + 10, size.height / 2 + 10));
\r
1273 pyr.getLayer(dst, cv::Size(size.width / 2 + 10, size.height / 2 + 10));
\r
1277 INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_getLayer, testing::Combine(
\r
1279 GPU_TYPICAL_MAT_SIZES,
\r
1280 testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
\r
1281 MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
\r
1282 MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4))));
\r