diff --git a/modules/gpu/src/denoising.cpp b/modules/gpu/src/denoising.cpp index b140011eb..6c7a6695b 100644 --- a/modules/gpu/src/denoising.cpp +++ b/modules/gpu/src/denoising.cpp @@ -51,6 +51,10 @@ void cv::gpu::bilateralFilter(const GpuMat&, GpuMat&, int, float, float, int, St void cv::gpu::nonLocalMeans(const GpuMat&, GpuMat&, float, int, int, int, Stream&) { throw_nogpu(); } void cv::gpu::fastNlMeansDenoising( const GpuMat&, GpuMat&, float, int, int, Stream&) { throw_nogpu(); } +void cv::gpu::FastNonLocalMeansDenoising::simpleMethod(const GpuMat&, GpuMat&, float, int, int, Stream&) { throw_nogpu(); } +void cv::gpu::FastNonLocalMeansDenoising::labMethod( const GpuMat&, GpuMat, float, float, int, int, Stream&) { throw_nogpu(); } + + #else ////////////////////////////////////////////////////////////////////////////////// diff --git a/modules/imgproc/perf/perf_goodFeaturesToTrack.cpp b/modules/imgproc/perf/perf_goodFeaturesToTrack.cpp index 47ec19c30..8177d6bb3 100644 --- a/modules/imgproc/perf/perf_goodFeaturesToTrack.cpp +++ b/modules/imgproc/perf/perf_goodFeaturesToTrack.cpp @@ -15,7 +15,7 @@ PERF_TEST_P(Image_MaxCorners_QualityLevel_MinDistance_BlockSize_UseHarris, goodF testing::Values( 100, 500 ), testing::Values( 0.1, 0.01 ), testing::Values( 3, 5 ), - testing::Bool() + testing::Bool() ) ) { @@ -28,11 +28,14 @@ PERF_TEST_P(Image_MaxCorners_QualityLevel_MinDistance_BlockSize_UseHarris, goodF Mat image = imread(filename, IMREAD_GRAYSCALE); if (image.empty()) FAIL() << "Unable to load source image" << filename; - + std::vector corners; double minDistance = 1; TEST_CYCLE() goodFeaturesToTrack(image, corners, maxCorners, qualityLevel, minDistance, noArray(), blockSize, useHarrisDetector); - //SANITY_CHECK(corners); + if (corners.size() > 50) + corners.erase(corners.begin() + 50, corners.end()); + + SANITY_CHECK(corners); } diff --git a/modules/imgproc/perf/perf_remap.cpp b/modules/imgproc/perf/perf_remap.cpp index 5ec8f46d8..f1c8956b3 100644 --- a/modules/imgproc/perf/perf_remap.cpp +++ b/modules/imgproc/perf/perf_remap.cpp @@ -1,71 +1,69 @@ -#include "perf_precomp.hpp" - -using namespace std; -using namespace cv; -using namespace perf; -using namespace testing; -using std::tr1::make_tuple; -using std::tr1::get; - -CV_ENUM(MatrixType, CV_16UC1, CV_16SC1, CV_32FC1) -CV_ENUM(MapType, CV_16SC2, CV_32FC1, CV_32FC2) -CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_LANCZOS4) - -typedef TestBaseWithParam< tr1::tuple > TestRemap; - -PERF_TEST_P( TestRemap, Remap, - Combine( - Values( szVGA, sz1080p ), - ValuesIn( MatrixType::all() ), - ValuesIn( MapType::all() ), - ValuesIn( InterType::all() ) - ) -) -{ - Size sz; - int src_type, map1_type, inter_type; - - sz = get<0>(GetParam()); - src_type = get<1>(GetParam()); - map1_type = get<2>(GetParam()); - inter_type = get<3>(GetParam()); - - Mat src(sz, src_type), dst(sz, src_type), map1(sz, map1_type), map2; - if (map1_type == CV_32FC1) - map2.create(sz, CV_32FC1); - else if (inter_type != INTER_NEAREST && map1_type == CV_16SC2) - { - map2.create(sz, CV_16UC1); - map2 = Scalar::all(0); - } - - RNG rng; - rng.fill(src, RNG::UNIFORM, 0, 256); - - for (int j = 0; j < map1.rows; ++j) - for (int i = 0; i < map1.cols; ++i) - switch (map1_type) - { - case CV_32FC1: - map1.at(j, i) = static_cast(src.cols - i - 1); - map2.at(j, i) = static_cast(j); - break; - case CV_32FC2: - map1.at(j, i)[0] = static_cast(src.cols - i - 1); - map1.at(j, i)[1] = static_cast(j); - break; - case CV_16SC2: - map1.at(j, i)[0] = static_cast(src.cols - i - 1); - map1.at(j, i)[1] = static_cast(j); - break; - default: - CV_Assert(0); - } - - - declare.in(src, WARMUP_RNG).out(dst).time(20); - - TEST_CYCLE() remap(src, dst, map1, map2, inter_type); - - SANITY_CHECK(dst); -} +#include "perf_precomp.hpp" + +using namespace std; +using namespace cv; +using namespace perf; +using namespace testing; +using std::tr1::make_tuple; +using std::tr1::get; + +CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_LANCZOS4) + +typedef TestBaseWithParam< tr1::tuple > TestRemap; + +PERF_TEST_P( TestRemap, Remap, + Combine( + Values( szVGA, sz1080p ), + Values( CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( CV_16SC2, CV_32FC1, CV_32FC2 ), + ValuesIn( InterType::all() ) + ) +) +{ + Size sz; + int src_type, map1_type, inter_type; + + sz = get<0>(GetParam()); + src_type = get<1>(GetParam()); + map1_type = get<2>(GetParam()); + inter_type = get<3>(GetParam()); + + Mat src(sz, src_type), dst(sz, src_type), map1(sz, map1_type), map2; + if (map1_type == CV_32FC1) + map2.create(sz, CV_32FC1); + else if (inter_type != INTER_NEAREST && map1_type == CV_16SC2) + { + map2.create(sz, CV_16UC1); + map2 = Scalar::all(0); + } + + RNG rng; + rng.fill(src, RNG::UNIFORM, 0, 256); + + for (int j = 0; j < map1.rows; ++j) + for (int i = 0; i < map1.cols; ++i) + switch (map1_type) + { + case CV_32FC1: + map1.at(j, i) = static_cast(src.cols - i - 1); + map2.at(j, i) = static_cast(j); + break; + case CV_32FC2: + map1.at(j, i)[0] = static_cast(src.cols - i - 1); + map1.at(j, i)[1] = static_cast(j); + break; + case CV_16SC2: + map1.at(j, i)[0] = static_cast(src.cols - i - 1); + map1.at(j, i)[1] = static_cast(j); + break; + default: + CV_Assert(0); + } + + + declare.in(src, WARMUP_RNG).out(dst).time(20); + + TEST_CYCLE() remap(src, dst, map1, map2, inter_type); + + SANITY_CHECK(dst); +} diff --git a/modules/imgproc/perf/perf_warp.cpp b/modules/imgproc/perf/perf_warp.cpp index b394479d1..cb15bac54 100644 --- a/modules/imgproc/perf/perf_warp.cpp +++ b/modules/imgproc/perf/perf_warp.cpp @@ -9,9 +9,9 @@ using std::tr1::get; enum{HALF_SIZE=0, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH}; -CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE); -CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR); -CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH); +CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE) +CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR) +CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH) typedef TestBaseWithParam< tr1::tuple > TestWarpAffine; typedef TestBaseWithParam< tr1::tuple > TestWarpPerspective; @@ -164,5 +164,7 @@ PERF_TEST(Transform, getPerspectiveTransform) { transformCoefficient = getPerspectiveTransform(source, destination); } + + SANITY_CHECK(transformCoefficient, 1e-5); } diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index 0b5f0b743..44d98bc65 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -90,7 +90,7 @@ private: \*****************************************************************************************/ #define CV_ENUM(class_name, ...) \ -class CV_EXPORTS class_name {\ +namespace { class CV_EXPORTS class_name {\ public:\ class_name(int val = 0) : _val(val) {}\ operator int() const {return _val;}\ @@ -116,12 +116,12 @@ public:\ private: class_name *_begin, *_end;\ };\ static Container all(){\ - static class_name vals[] = {__VA_ARGS__};\ - return Container(vals, sizeof(vals)/sizeof(vals[0]));\ + static int vals[] = {__VA_ARGS__};\ + return Container((class_name*)vals, sizeof(vals)/sizeof(vals[0]));\ }\ private: int _val;\ };\ -inline void PrintTo(const class_name& t, std::ostream* os) { t.PrintTo(os); } +inline void PrintTo(const class_name& t, std::ostream* os) { t.PrintTo(os); } } #define CV_FLAGS(class_name, ...) \ class CV_EXPORTS class_name {\