|
|
|
@ -53,7 +53,7 @@ namespace opencv_test { namespace { |
|
|
|
|
#define SAVE(x) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
static const double numerical_precision = 1000.; |
|
|
|
|
static const double numerical_precision = 0.05; // 95% of pixels should have exact values
|
|
|
|
|
|
|
|
|
|
TEST(Photo_SeamlessClone_normal, regression) |
|
|
|
|
{ |
|
|
|
@ -82,8 +82,10 @@ TEST(Photo_SeamlessClone_normal, regression) |
|
|
|
|
|
|
|
|
|
SAVE(result); |
|
|
|
|
|
|
|
|
|
double error = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(error, numerical_precision); |
|
|
|
|
double errorINF = cvtest::norm(reference, result, NORM_INF); |
|
|
|
|
EXPECT_LE(errorINF, 1); |
|
|
|
|
double errorL1 = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(Photo_SeamlessClone_mixed, regression) |
|
|
|
@ -113,9 +115,10 @@ TEST(Photo_SeamlessClone_mixed, regression) |
|
|
|
|
Mat reference = imread(reference_path); |
|
|
|
|
ASSERT_FALSE(reference.empty()) << "Could not load reference image " << reference_path; |
|
|
|
|
|
|
|
|
|
double error = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(error, numerical_precision); |
|
|
|
|
|
|
|
|
|
double errorINF = cvtest::norm(reference, result, NORM_INF); |
|
|
|
|
EXPECT_LE(errorINF, 1); |
|
|
|
|
double errorL1 = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(Photo_SeamlessClone_featureExchange, regression) |
|
|
|
@ -145,9 +148,10 @@ TEST(Photo_SeamlessClone_featureExchange, regression) |
|
|
|
|
Mat reference = imread(reference_path); |
|
|
|
|
ASSERT_FALSE(reference.empty()) << "Could not load reference image " << reference_path; |
|
|
|
|
|
|
|
|
|
double error = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(error, numerical_precision); |
|
|
|
|
|
|
|
|
|
double errorINF = cvtest::norm(reference, result, NORM_INF); |
|
|
|
|
EXPECT_LE(errorINF, 1); |
|
|
|
|
double errorL1 = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(Photo_SeamlessClone_colorChange, regression) |
|
|
|
@ -171,9 +175,10 @@ TEST(Photo_SeamlessClone_colorChange, regression) |
|
|
|
|
Mat reference = imread(reference_path); |
|
|
|
|
ASSERT_FALSE(reference.empty()) << "Could not load reference image " << reference_path; |
|
|
|
|
|
|
|
|
|
double error = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(error, numerical_precision); |
|
|
|
|
|
|
|
|
|
double errorINF = cvtest::norm(reference, result, NORM_INF); |
|
|
|
|
EXPECT_LE(errorINF, 1); |
|
|
|
|
double errorL1 = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(Photo_SeamlessClone_illuminationChange, regression) |
|
|
|
@ -195,9 +200,12 @@ TEST(Photo_SeamlessClone_illuminationChange, regression) |
|
|
|
|
SAVE(result); |
|
|
|
|
|
|
|
|
|
Mat reference = imread(reference_path); |
|
|
|
|
double error = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(error, numerical_precision); |
|
|
|
|
ASSERT_FALSE(reference.empty()) << "Could not load reference image " << reference_path; |
|
|
|
|
|
|
|
|
|
double errorINF = cvtest::norm(reference, result, NORM_INF); |
|
|
|
|
EXPECT_LE(errorINF, 1); |
|
|
|
|
double errorL1 = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(Photo_SeamlessClone_textureFlattening, regression) |
|
|
|
@ -221,9 +229,10 @@ TEST(Photo_SeamlessClone_textureFlattening, regression) |
|
|
|
|
Mat reference = imread(reference_path); |
|
|
|
|
ASSERT_FALSE(reference.empty()) << "Could not load reference image " << reference_path; |
|
|
|
|
|
|
|
|
|
double error = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(error, numerical_precision); |
|
|
|
|
|
|
|
|
|
double errorINF = cvtest::norm(reference, result, NORM_INF); |
|
|
|
|
EXPECT_LE(errorINF, 1); |
|
|
|
|
double errorL1 = cvtest::norm(reference, result, NORM_L1); |
|
|
|
|
EXPECT_LE(errorL1, reference.total() * numerical_precision) << "size=" << reference.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}} // namespace
|
|
|
|
|