@@ -38,6 +38,34 @@ TEST(Photo_Tonemap, Durand_regression)
38
38
checkEqual (result, expected, 3 , " Durand" );
39
39
}
40
40
41
+ TEST (Photo_Tonemap, Durand_property_regression)
42
+ {
43
+ const float gamma = 1 .0f ;
44
+ const float contrast = 2 .0f ;
45
+ const float saturation = 3 .0f ;
46
+ const float sigma_color = 4 .0f ;
47
+ const float sigma_space = 5 .0f ;
48
+
49
+ const Ptr<TonemapDurand> durand1 = createTonemapDurand (gamma, contrast, saturation, sigma_color, sigma_space);
50
+ ASSERT_EQ (gamma, durand1->getGamma ());
51
+ ASSERT_EQ (contrast, durand1->getContrast ());
52
+ ASSERT_EQ (saturation, durand1->getSaturation ());
53
+ ASSERT_EQ (sigma_space, durand1->getSigmaSpace ());
54
+ ASSERT_EQ (sigma_color, durand1->getSigmaColor ());
55
+
56
+ const Ptr<TonemapDurand> durand2 = createTonemapDurand ();
57
+ durand2->setGamma (gamma);
58
+ durand2->setContrast (contrast);
59
+ durand2->setSaturation (saturation);
60
+ durand2->setSigmaColor (sigma_color);
61
+ durand2->setSigmaSpace (sigma_space);
62
+ ASSERT_EQ (gamma, durand2->getGamma ());
63
+ ASSERT_EQ (contrast, durand2->getContrast ());
64
+ ASSERT_EQ (saturation, durand2->getSaturation ());
65
+ ASSERT_EQ (sigma_color, durand2->getSigmaColor ());
66
+ ASSERT_EQ (sigma_space, durand2->getSigmaSpace ());
67
+ }
68
+
41
69
#endif // OPENCV_ENABLE_NONFREE
42
70
43
71
}} // namespace
0 commit comments