提交 ee4b78fc 编写于 作者: A Alexander Alekhin

test: change condition in Photo_Decolor

上级 4439ba09
......@@ -47,8 +47,6 @@
using namespace cv;
using namespace std;
static const double numerical_precision = 10.;
TEST(Photo_Decolor, regression)
{
string folder = string(cvtest::TS::ptr()->get_data_path()) + "decolor/";
......@@ -57,16 +55,16 @@ TEST(Photo_Decolor, regression)
Mat original = imread(original_path, IMREAD_COLOR);
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;
decolor(original, grayscale, color_boost);
Mat reference_grayscale = imread(folder + "grayscale_reference.png", 0 /* == grayscale image*/);
double error_grayscale = cvtest::norm(reference_grayscale, grayscale, NORM_L1);
EXPECT_LE(error_grayscale, numerical_precision);
double gray_psnr = cvtest::PSNR(reference_grayscale, grayscale);
EXPECT_GT(gray_psnr, 60.0);
Mat reference_boost = imread(folder + "boost_reference.png");
double error_boost = cvtest::norm(reference_boost, color_boost, NORM_L1);
EXPECT_LE(error_boost, numerical_precision);
double boost_psnr = cvtest::PSNR(reference_boost, color_boost);
EXPECT_GT(boost_psnr, 60.0);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册