Commit c2394339 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #7075 from alalek:ocl_fix_canny_perf_test

parents de0909e0 f2e41ce3
...@@ -299,33 +299,30 @@ OCL_PERF_TEST_P(CLAHEFixture, CLAHE, OCL_TEST_SIZES) ...@@ -299,33 +299,30 @@ OCL_PERF_TEST_P(CLAHEFixture, CLAHE, OCL_TEST_SIZES)
///////////// Canny //////////////////////// ///////////// Canny ////////////////////////
typedef tuple<int, bool> CannyParams; typedef tuple<Size, int, bool> CannyParams;
typedef TestBaseWithParam<CannyParams> CannyFixture; typedef TestBaseWithParam<CannyParams> CannyFixture;
OCL_PERF_TEST_P(CannyFixture, Canny, ::testing::Combine(OCL_PERF_ENUM(3, 5), Bool())) OCL_PERF_TEST_P(CannyFixture, Canny, ::testing::Combine(OCL_TEST_SIZES, OCL_PERF_ENUM(3, 5), Bool()))
{ {
const CannyParams params = GetParam(); const CannyParams& params = GetParam();
int apertureSize = get<0>(params); cv::Size imgSize = get<0>(params);
bool L2Grad = get<1>(params); int apertureSize = get<1>(params);
bool L2Grad = get<2>(params);
Mat _img = imread(getDataPath("gpu/stereobm/aloe-L.png"), cv::IMREAD_GRAYSCALE); Mat _img = imread(getDataPath("gpu/stereobm/aloe-L.png"), cv::IMREAD_GRAYSCALE);
ASSERT_TRUE(!_img.empty()) << "can't open aloe-L.png"; ASSERT_TRUE(!_img.empty()) << "can't open aloe-L.png";
UMat img; UMat img;
_img.copyTo(img); cv::resize(_img, img, imgSize);
UMat edges(img.size(), CV_8UC1); UMat edges(img.size(), CV_8UC1);
declare.in(img, WARMUP_RNG).out(edges); declare.in(img).out(edges);
OCL_TEST_CYCLE() cv::Canny(img, edges, 50.0, 100.0, apertureSize, L2Grad); OCL_TEST_CYCLE() cv::Canny(img, edges, 50.0, 100.0, apertureSize, L2Grad);
if (apertureSize == 3) SANITY_CHECK_NOTHING();
SANITY_CHECK(edges);
else
SANITY_CHECK_NOTHING();
} }
} } // namespace cvtest::ocl } } // namespace cvtest::ocl
#endif // HAVE_OPENCL #endif // HAVE_OPENCL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment