Commit ed0eb139 authored by Adrien BAK's avatar Adrien BAK Committed by Adrien BAK

improve decolor tests

parent 0a3aab28
......@@ -47,6 +47,7 @@
using namespace cv;
using namespace std;
static const double numerical_precision = 1.;
TEST(Photo_Decolor, regression)
{
......@@ -61,7 +62,11 @@ TEST(Photo_Decolor, regression)
Mat grayscale, color_boost;
decolor(original, grayscale, color_boost);
imwrite(folder + "grayscale.png",grayscale);
imwrite(folder + "color_boost.png",color_boost);
Mat reference_grayscale = imread(folder + "grayscale_reference.png", 0 /* == grayscale image*/);
double error_grayscale = norm(reference_grayscale, grayscale, NORM_L1);
EXPECT_LE(error_grayscale, numerical_precision);
Mat reference_boost = imread(folder + "boost_reference.png");
double error_boost = norm(reference_boost, color_boost, NORM_L1);
EXPECT_LE(error_boost, numerical_precision);
}
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