Commit 4c0f7f9e authored by Fedor Morozov's avatar Fedor Morozov

Tonemapping documentation update

parent cb999a23
...@@ -19,17 +19,11 @@ Tonemaps image ...@@ -19,17 +19,11 @@ Tonemaps image
:param src: source image - 32-bit 3-channel Mat :param src: source image - 32-bit 3-channel Mat
:param dst: destination image - 32-bit 3-channel Mat with values in [0, 1] range :param dst: destination image - 32-bit 3-channel Mat with values in [0, 1] range
TonemapLinear createTonemap
--------
.. ocv:class:: TonemapLinear : public Tonemap
Simple linear mapper with gamma correction.
createTonemapLinear
------------------ ------------------
Creates TonemapLinear object Creates simple linear mapper with gamma correction
.. ocv:function:: Ptr<TonemapLinear> createTonemapLinear(float gamma = 1.0f); .. ocv:function:: Ptr<Tonemap> createTonemap(float gamma = 1.0f);
:param gamma: gamma value for gamma correction :param gamma: gamma value for gamma correction
...@@ -47,6 +41,8 @@ Creates TonemapDrago object ...@@ -47,6 +41,8 @@ Creates TonemapDrago object
:param gamma: gamma value for gamma correction :param gamma: gamma value for gamma correction
:param saturation: saturation enhancement value
:param bias: value for bias function in [0, 1] range :param bias: value for bias function in [0, 1] range
TonemapDurand TonemapDurand
...@@ -61,15 +57,17 @@ createTonemapDurand ...@@ -61,15 +57,17 @@ createTonemapDurand
------------------ ------------------
Creates TonemapDurand object Creates TonemapDurand object
.. ocv:function:: Ptr<TonemapDurand> createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float sigma_space = 2.0f, float sigma_color = 2.0f); .. ocv:function:: Ptr<TonemapDurand> createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_space = 2.0f, float sigma_color = 2.0f);
:param gamma: gamma value for gamma correction :param gamma: gamma value for gamma correction
:param contrast: resulting contrast on logarithmic scale :param contrast: resulting contrast on logarithmic scale
:param sigma_space: filter sigma in the color space :param saturation: saturation enhancement value
:param sigma_color: filter sigma in the coordinate space :param sigma_space: filter sigma in color space
:param sigma_color: filter sigma in coordinate space
TonemapReinhardDevlin TonemapReinhardDevlin
-------- --------
...@@ -91,6 +89,24 @@ Creates TonemapReinhardDevlin object ...@@ -91,6 +89,24 @@ Creates TonemapReinhardDevlin object
:param color_adapt: chromatic adaptation in [0, 1] range. If 1 channels are treated independently, if 0 adaptation level is the same for each channel :param color_adapt: chromatic adaptation in [0, 1] range. If 1 channels are treated independently, if 0 adaptation level is the same for each channel
TonemapMantiuk
--------
.. ocv:class:: TonemapMantiuk : public Tonemap
"Perceptual Framework for Contrast Processing of High Dynamic Range Images", Mantiuk et al., 2006
createTonemapMantiuk
------------------
Creates TonemapMantiuk object
.. ocv:function:: CV_EXPORTS_W Ptr<TonemapMantiuk> createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f);
:param gamma: gamma value for gamma correction
:param scale: contrast scale factor
:param saturation: saturation enhancement value
ExposureAlign ExposureAlign
------------- -------------
.. ocv:class:: ExposureAlign : public Algorithm .. ocv:class:: ExposureAlign : public Algorithm
......
...@@ -126,7 +126,7 @@ public: ...@@ -126,7 +126,7 @@ public:
}; };
CV_EXPORTS_W Ptr<TonemapDurand> CV_EXPORTS_W Ptr<TonemapDurand>
createTonemapDurand(float gamma = 1.0f, float saturation = 1.0f, float contrast = 4.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_space = 2.0f, float sigma_color = 2.0f);
// "Dynamic Range Reduction Inspired by Photoreceptor Physiology", Reinhard, Devlin, 2005 // "Dynamic Range Reduction Inspired by Photoreceptor Physiology", Reinhard, Devlin, 2005
...@@ -146,6 +146,8 @@ public: ...@@ -146,6 +146,8 @@ public:
CV_EXPORTS_W Ptr<TonemapReinhardDevlin> CV_EXPORTS_W Ptr<TonemapReinhardDevlin>
createTonemapReinhardDevlin(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f); createTonemapReinhardDevlin(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f);
// "Perceptual Framework for Contrast Processing of High Dynamic Range Images", Mantiuk et al., 2006
class CV_EXPORTS_W TonemapMantiuk : public Tonemap class CV_EXPORTS_W TonemapMantiuk : public Tonemap
{ {
public: public:
...@@ -166,6 +168,8 @@ public: ...@@ -166,6 +168,8 @@ public:
const std::vector<float>& times, InputArray response) = 0; const std::vector<float>& times, InputArray response) = 0;
}; };
// "Fast, Robust Image Registration for Compositing High Dynamic Range Photographs from Handheld Exposures", Ward, 2003
class CV_EXPORTS_W AlignMTB : public ExposureAlign class CV_EXPORTS_W AlignMTB : public ExposureAlign
{ {
public: public:
...@@ -184,8 +188,6 @@ public: ...@@ -184,8 +188,6 @@ public:
CV_WRAP virtual void setExcludeRange(int exclude_range) = 0; CV_WRAP virtual void setExcludeRange(int exclude_range) = 0;
}; };
// "Fast, Robust Image Registration for Compositing High Dynamic Range Photographs from Handheld Exposures", Ward, 2003
CV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits = 6, int exclude_range = 4); CV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits = 6, int exclude_range = 4);
class CV_EXPORTS_W ExposureCalibrate : public Algorithm class CV_EXPORTS_W ExposureCalibrate : public Algorithm
......
...@@ -183,10 +183,10 @@ Ptr<TonemapDrago> createTonemapDrago(float gamma, float saturation, float bias) ...@@ -183,10 +183,10 @@ Ptr<TonemapDrago> createTonemapDrago(float gamma, float saturation, float bias)
class TonemapDurandImpl : public TonemapDurand class TonemapDurandImpl : public TonemapDurand
{ {
public: public:
TonemapDurandImpl(float gamma, float saturation, float contrast, float sigma_color, float sigma_space) : TonemapDurandImpl(float gamma, float contrast, float saturation, float sigma_color, float sigma_space) :
gamma(gamma), gamma(gamma),
saturation(saturation),
contrast(contrast), contrast(contrast),
saturation(saturation),
sigma_color(sigma_color), sigma_color(sigma_color),
sigma_space(sigma_space), sigma_space(sigma_space),
name("TonemapDurand") name("TonemapDurand")
...@@ -260,9 +260,9 @@ protected: ...@@ -260,9 +260,9 @@ protected:
float gamma, saturation, contrast, sigma_color, sigma_space; float gamma, saturation, contrast, sigma_color, sigma_space;
}; };
Ptr<TonemapDurand> createTonemapDurand(float gamma, float saturation, float contrast, float sigma_color, float sigma_space) Ptr<TonemapDurand> createTonemapDurand(float gamma, float contrast, float saturation, float sigma_color, float sigma_space)
{ {
return new TonemapDurandImpl(gamma, saturation, contrast, sigma_color, sigma_space); return new TonemapDurandImpl(gamma, contrast, saturation, sigma_color, sigma_space);
} }
class TonemapReinhardDevlinImpl : public TonemapReinhardDevlin class TonemapReinhardDevlinImpl : public TonemapReinhardDevlin
......
...@@ -97,7 +97,7 @@ TEST(Photo_Tonemap, regression) ...@@ -97,7 +97,7 @@ TEST(Photo_Tonemap, regression)
loadImage(test_path + "image.hdr", img); loadImage(test_path + "image.hdr", img);
float gamma = 2.2f; float gamma = 2.2f;
Ptr<Tonemap> linear = createTonemapLinear(gamma); Ptr<Tonemap> linear = createTonemap(gamma);
linear->process(img, result); linear->process(img, result);
loadImage(test_path + "linear.png", expected); loadImage(test_path + "linear.png", expected);
result.convertTo(result, CV_8UC3, 255); result.convertTo(result, CV_8UC3, 255);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment