Commit ee4b78fc authored by Alexander Alekhin's avatar Alexander Alekhin

test: change condition in Photo_Decolor

parent 4439ba09
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
using namespace cv; using namespace cv;
using namespace std; using namespace std;
static const double numerical_precision = 10.;
TEST(Photo_Decolor, regression) TEST(Photo_Decolor, regression)
{ {
string folder = string(cvtest::TS::ptr()->get_data_path()) + "decolor/"; string folder = string(cvtest::TS::ptr()->get_data_path()) + "decolor/";
...@@ -57,16 +55,16 @@ TEST(Photo_Decolor, regression) ...@@ -57,16 +55,16 @@ TEST(Photo_Decolor, regression)
Mat original = imread(original_path, IMREAD_COLOR); Mat original = imread(original_path, IMREAD_COLOR);
ASSERT_FALSE(original.empty()) << "Could not load input image " << original_path; ASSERT_FALSE(original.empty()) << "Could not load input image " << original_path;
ASSERT_FALSE(original.channels()!=3) << "Load color input image " << original_path; ASSERT_EQ(3, original.channels()) << "Load color input image " << original_path;
Mat grayscale, color_boost; Mat grayscale, color_boost;
decolor(original, grayscale, color_boost); decolor(original, grayscale, color_boost);
Mat reference_grayscale = imread(folder + "grayscale_reference.png", 0 /* == grayscale image*/); Mat reference_grayscale = imread(folder + "grayscale_reference.png", 0 /* == grayscale image*/);
double error_grayscale = cvtest::norm(reference_grayscale, grayscale, NORM_L1); double gray_psnr = cvtest::PSNR(reference_grayscale, grayscale);
EXPECT_LE(error_grayscale, numerical_precision); EXPECT_GT(gray_psnr, 60.0);
Mat reference_boost = imread(folder + "boost_reference.png"); Mat reference_boost = imread(folder + "boost_reference.png");
double error_boost = cvtest::norm(reference_boost, color_boost, NORM_L1); double boost_psnr = cvtest::PSNR(reference_boost, color_boost);
EXPECT_LE(error_boost, numerical_precision); EXPECT_GT(boost_psnr, 60.0);
} }
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