improve decolor tests
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
using namespace cv;
|
using namespace cv;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
static const double numerical_precision = 1.;
|
||||||
|
|
||||||
TEST(Photo_Decolor, regression)
|
TEST(Photo_Decolor, regression)
|
||||||
{
|
{
|
||||||
@@ -61,7 +62,11 @@ TEST(Photo_Decolor, regression)
|
|||||||
Mat grayscale, color_boost;
|
Mat grayscale, color_boost;
|
||||||
decolor(original, grayscale, color_boost);
|
decolor(original, grayscale, color_boost);
|
||||||
|
|
||||||
imwrite(folder + "grayscale.png",grayscale);
|
Mat reference_grayscale = imread(folder + "grayscale_reference.png", 0 /* == grayscale image*/);
|
||||||
imwrite(folder + "color_boost.png",color_boost);
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user