From a1cece733d54c061b56d6339761ff07b121aeb7c Mon Sep 17 00:00:00 2001 From: shimat Date: Sun, 29 Dec 2019 12:34:46 +0900 Subject: [PATCH] swap sigma_color and sigma_space Update test_hdr.cpp Update test_hdr.cpp --- .../xphoto/include/opencv2/xphoto/tonemap.hpp | 6 ++-- modules/xphoto/test/test_hdr.cpp | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/modules/xphoto/include/opencv2/xphoto/tonemap.hpp b/modules/xphoto/include/opencv2/xphoto/tonemap.hpp index 8d977d607..9a69d3904 100644 --- a/modules/xphoto/include/opencv2/xphoto/tonemap.hpp +++ b/modules/xphoto/include/opencv2/xphoto/tonemap.hpp @@ -46,11 +46,11 @@ You need to set the OPENCV_ENABLE_NONFREE option in cmake to use those. Use them @param contrast resulting contrast on logarithmic scale, i. e. log(max / min), where max and min are maximum and minimum luminance values of the resulting image. @param saturation saturation enhancement value. See createTonemapDrago -@param sigma_space bilateral filter sigma in color space -@param sigma_color bilateral filter sigma in coordinate space +@param sigma_color bilateral filter sigma in color space +@param sigma_space bilateral filter sigma in coordinate space */ CV_EXPORTS_W Ptr -createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_space = 2.0f, float sigma_color = 2.0f); +createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_color = 2.0f, float sigma_space = 2.0f); }} // namespace #endif // OPENCV_XPHOTO_TONEMAP_HPP diff --git a/modules/xphoto/test/test_hdr.cpp b/modules/xphoto/test/test_hdr.cpp index bfc0d5eb1..86eeb3113 100644 --- a/modules/xphoto/test/test_hdr.cpp +++ b/modules/xphoto/test/test_hdr.cpp @@ -38,6 +38,34 @@ TEST(Photo_Tonemap, Durand_regression) checkEqual(result, expected, 3, "Durand"); } +TEST(Photo_Tonemap, Durand_property_regression) +{ + const float gamma = 1.0f; + const float contrast = 2.0f; + const float saturation = 3.0f; + const float sigma_color = 4.0f; + const float sigma_space = 5.0f; + + const Ptr durand1 = createTonemapDurand(gamma, contrast, saturation, sigma_color, sigma_space); + ASSERT_EQ(gamma, durand1->getGamma()); + ASSERT_EQ(contrast, durand1->getContrast()); + ASSERT_EQ(saturation, durand1->getSaturation()); + ASSERT_EQ(sigma_space, durand1->getSigmaSpace()); + ASSERT_EQ(sigma_color, durand1->getSigmaColor()); + + const Ptr durand2 = createTonemapDurand(); + durand2->setGamma(gamma); + durand2->setContrast(contrast); + durand2->setSaturation(saturation); + durand2->setSigmaColor(sigma_color); + durand2->setSigmaSpace(sigma_space); + ASSERT_EQ(gamma, durand2->getGamma()); + ASSERT_EQ(contrast, durand2->getContrast()); + ASSERT_EQ(saturation, durand2->getSaturation()); + ASSERT_EQ(sigma_color, durand2->getSigmaColor()); + ASSERT_EQ(sigma_space, durand2->getSigmaSpace()); +} + #endif // OPENCV_ENABLE_NONFREE }} // namespace