mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
improve decolor tests
This commit is contained in:
parent
0a3aab288a
commit
ed0eb139cb
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user