1
// This file is part of OpenCV project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at http://opencv.org/license.html.
5
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
6
// Third party copyrights are property of their respective owners.
8
#include "../perf_precomp.hpp"
9
#include "opencv2/ts/ocl_perf.hpp"
16
OCL_PERF_TEST(Photo, DenoisingGrayscale)
18
Mat _original = imread(getDataPath("cv/denoising/lena_noised_gaussian_sigma=10.png"), IMREAD_GRAYSCALE);
19
ASSERT_FALSE(_original.empty()) << "Could not load input image";
21
UMat result(_original.size(), _original.type()), original;
22
_original.copyTo(original);
24
declare.in(original).out(result).iterations(10);
27
cv::fastNlMeansDenoising(original, result, 10);
29
SANITY_CHECK(result, 1);
32
OCL_PERF_TEST(Photo, DenoisingColored)
34
Mat _original = imread(getDataPath("cv/denoising/lena_noised_gaussian_sigma=10.png"));
35
ASSERT_FALSE(_original.empty()) << "Could not load input image";
37
UMat result(_original.size(), _original.type()), original;
38
_original.copyTo(original);
40
declare.in(original).out(result).iterations(10);
43
cv::fastNlMeansDenoisingColored(original, result, 10, 10);
45
SANITY_CHECK(result, 2);
48
OCL_PERF_TEST(Photo, DISABLED_DenoisingGrayscaleMulti)
50
const int imgs_count = 3;
52
vector<UMat> original(imgs_count);
54
for (int i = 0; i < imgs_count; i++)
56
string original_path = format("cv/denoising/lena_noised_gaussian_sigma=20_multi_%d.png", i);
57
tmp = imread(getDataPath(original_path), IMREAD_GRAYSCALE);
58
ASSERT_FALSE(tmp.empty()) << "Could not load input image " << original_path;
59
tmp.copyTo(original[i]);
60
declare.in(original[i]);
62
UMat result(tmp.size(), tmp.type());
63
declare.out(result).iterations(10);
66
cv::fastNlMeansDenoisingMulti(original, result, imgs_count / 2, imgs_count, 15);
71
OCL_PERF_TEST(Photo, DISABLED_DenoisingColoredMulti)
73
const int imgs_count = 3;
75
vector<UMat> original(imgs_count);
77
for (int i = 0; i < imgs_count; i++)
79
string original_path = format("cv/denoising/lena_noised_gaussian_sigma=20_multi_%d.png", i);
80
tmp = imread(getDataPath(original_path), IMREAD_COLOR);
81
ASSERT_FALSE(tmp.empty()) << "Could not load input image " << original_path;
83
tmp.copyTo(original[i]);
84
declare.in(original[i]);
86
UMat result(tmp.size(), tmp.type());
87
declare.out(result).iterations(10);
90
cv::fastNlMeansDenoisingColoredMulti(original, result, imgs_count / 2, imgs_count, 10, 15);
95
} } // namespace cvtest::ocl