From bec3c186e6fa2453922e1d8d06bf01e0682f080f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrieux=20K=C3=A9vin?= Date: Fri, 29 Jan 2021 12:54:06 +0100 Subject: [PATCH 1/2] deltaCIEDE2000_ fix, did not pass the test case 17 and 19 of Gaurav Sharma's test data --- modules/mcc/src/distance.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mcc/src/distance.cpp b/modules/mcc/src/distance.cpp index 7996379e939..c5eb1b59514 100644 --- a/modules/mcc/src/distance.cpp +++ b/modules/mcc/src/distance.cpp @@ -139,7 +139,8 @@ double deltaCIEDE2000_(const Vec3d& lab1, const Vec3d& lab2, const double& kL, double sC = 1.0 + 0.045 * C_bar_apo; double sH = 1.0 + 0.015 * C_bar_apo * T; double sL = 1.0 + ((0.015 * pow(l_bar_apo - 50.0, 2.0)) / sqrt(20.0 + pow(l_bar_apo - 50.0, 2.0))); - double RT = -2.0 * G * sin(toRad(60.0) * exp(-pow((H_bar_apo - toRad(275.0)) / toRad(25.0), 2.0))); + double R_C = 2.0 * sqrt(pow(C_bar_apo, 7.0) / (pow(C_bar_apo, 7.0) + pow(25, 7))); + double RT = -sin(toRad(60.0) * exp(-pow((H_bar_apo - toRad(275.0)) / toRad(25.0), 2.0))) * R_C; double res = (pow(delta_L_apo / (kL * sL), 2.0) + pow(delta_C_apo / (kC * sC), 2.0) + pow(delta_H_apo / (kH * sH), 2.0) + RT * (delta_C_apo / (kC * sC)) * (delta_H_apo / (kH * sH))); return res > 0 ? sqrt(res) : 0; } From 003d288e196129c16d8ae70a1f2c357e7c1166d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrieux=20K=C3=A9vin?= Date: Wed, 3 Feb 2021 14:58:18 +0100 Subject: [PATCH 2/2] Update ccm test case --- modules/mcc/test/test_ccm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mcc/test/test_ccm.cpp b/modules/mcc/test/test_ccm.cpp index 56ac51db410..cd6498f1b6e 100644 --- a/modules/mcc/test/test_ccm.cpp +++ b/modules/mcc/test/test_ccm.cpp @@ -99,9 +99,9 @@ TEST(CV_ccmRunColorCorrection, test_model) Mat ccm = (Mat_(3, 3) << - 0.37408717, 0.02066172, 0.05796725, - 0.12684056, 0.77364991, -0.01566532, - -0.27464866, 0.00652140, 2.74593262); + 0.37406520, 0.02066507, 0.05804047, + 0.12719672, 0.77389268, -0.01569404, + -0.27627010, 0.00603427, 2.74272981); ASSERT_MAT_NEAR(model.getCCM(), ccm, 1e-4); } TEST(CV_ccmRunColorCorrection, test_masks_weights_1)