Commit 70a64ebe authored by Erik Karlsson's avatar Erik Karlsson

Added test cases

parent 5f8d6886
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
namespace cvtest { namespace cvtest {
namespace ocl { namespace ocl {
PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, bool, bool) PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, int, bool, bool)
{ {
int cn, templateWindowSize, searchWindowSize; int cn, normType, templateWindowSize, searchWindowSize;
std::vector<float> h; std::vector<float> h;
bool use_roi, use_image; bool use_roi, use_image;
...@@ -25,8 +25,9 @@ PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, bool, bool) ...@@ -25,8 +25,9 @@ PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, bool, bool)
virtual void SetUp() virtual void SetUp()
{ {
cn = GET_PARAM(0); cn = GET_PARAM(0);
use_roi = GET_PARAM(1); normType = GET_PARAM(1);
use_image = GET_PARAM(2); use_roi = GET_PARAM(2);
use_image = GET_PARAM(3);
templateWindowSize = 7; templateWindowSize = 7;
searchWindowSize = 21; searchWindowSize = 21;
...@@ -81,8 +82,8 @@ OCL_TEST_P(FastNlMeansDenoising, Mat) ...@@ -81,8 +82,8 @@ OCL_TEST_P(FastNlMeansDenoising, Mat)
{ {
generateTestData(); generateTestData();
OCL_OFF(cv::fastNlMeansDenoising(src_roi, dst_roi, h[0], templateWindowSize, searchWindowSize)); OCL_OFF(cv::fastNlMeansDenoising(src_roi, dst_roi, std::vector<float>(1, h[0]), templateWindowSize, searchWindowSize, normType));
OCL_ON(cv::fastNlMeansDenoising(usrc_roi, udst_roi, h[0], templateWindowSize, searchWindowSize)); OCL_ON(cv::fastNlMeansDenoising(usrc_roi, udst_roi, std::vector<float>(1, h[0]), templateWindowSize, searchWindowSize, normType));
OCL_EXPECT_MATS_NEAR(dst, 1); OCL_EXPECT_MATS_NEAR(dst, 1);
} }
...@@ -96,8 +97,8 @@ OCL_TEST_P(FastNlMeansDenoising_hsep, Mat) ...@@ -96,8 +97,8 @@ OCL_TEST_P(FastNlMeansDenoising_hsep, Mat)
{ {
generateTestData(); generateTestData();
OCL_OFF(cv::fastNlMeansDenoising(src_roi, dst_roi, h, templateWindowSize, searchWindowSize)); OCL_OFF(cv::fastNlMeansDenoising(src_roi, dst_roi, h, templateWindowSize, searchWindowSize, normType));
OCL_ON(cv::fastNlMeansDenoising(usrc_roi, udst_roi, h, templateWindowSize, searchWindowSize)); OCL_ON(cv::fastNlMeansDenoising(usrc_roi, udst_roi, h, templateWindowSize, searchWindowSize, normType));
OCL_EXPECT_MATS_NEAR(dst, 1); OCL_EXPECT_MATS_NEAR(dst, 1);
} }
...@@ -119,11 +120,13 @@ OCL_TEST_P(FastNlMeansDenoisingColored, Mat) ...@@ -119,11 +120,13 @@ OCL_TEST_P(FastNlMeansDenoisingColored, Mat)
} }
OCL_INSTANTIATE_TEST_CASE_P(Photo, FastNlMeansDenoising, OCL_INSTANTIATE_TEST_CASE_P(Photo, FastNlMeansDenoising,
Combine(Values(1, 2, 3, 4), Bool(), Values(true))); Combine(Values(1, 2, 3, 4), Values((int)NORM_L2, (int)NORM_L1),
Bool(), Values(true)));
OCL_INSTANTIATE_TEST_CASE_P(Photo, FastNlMeansDenoising_hsep, OCL_INSTANTIATE_TEST_CASE_P(Photo, FastNlMeansDenoising_hsep,
Combine(Values(1, 2, 3, 4), Bool(), Values(true))); Combine(Values(1, 2, 3, 4), Values((int)NORM_L2, (int)NORM_L1),
Bool(), Values(true)));
OCL_INSTANTIATE_TEST_CASE_P(Photo, FastNlMeansDenoisingColored, OCL_INSTANTIATE_TEST_CASE_P(Photo, FastNlMeansDenoisingColored,
Combine(Values(3, 4), Bool(), Values(false))); Combine(Values(3, 4), Values((int)NORM_L2), Bool(), Values(false)));
} } // namespace cvtest::ocl } } // namespace cvtest::ocl
......
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