This section describes high dynamic range imaging algorithms, namely tonemapping, exposure alignment, camera calibration with multiple exposures and exposure fusion.
Tonemap
-------------
---------------------------
.. ocv:class:: Tonemap : public Algorithm
The base class for tonemapping algorithms - tools, that are used to map HDR image to 8-bit range.
Base class for tonemapping algorithms - tools, that are used to map HDR image to 8-bit range.
:param gamma: gamma value for gamma correction. See :ocv:func:`createTonemap`
:param saturation: saturation enhancement value
:param saturation: positive saturation enhancement value. 1.0 preserves saturation, values greater than 1 increase saturation and values less than 1 decrease it.
:param bias: value for bias function in [0, 1] range
:param bias: value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best results, default value is 0.85.
TonemapDurand
--------
---------------------------
.. ocv:class:: TonemapDurand : public Tonemap
"Fast Bilateral Filtering for the Display of High-Dynamic-Range Images", Durand, Dorsey, 2002
This algorithm decomposes image into two layers: base layer and detail layer using bilateral filter and compresses contrast of the base layer thus preserving all the details.
This implementation uses regular bilateral filter from opencv.
Saturation enhancement is possible as in ocv:class:`TonemapDrago`.
:param gamma: gamma value for gamma correction. See :ocv:func:`createTonemap`
:param contrast: resulting contrast on logarithmic scale
: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
:param saturation: saturation enhancement value. See :ocv:func:`createTonemapDrago`
:param sigma_space: filter sigma in color space
:param sigma_space: bilateral filter sigma in color space
:param sigma_color: filter sigma in coordinate space
:param sigma_color: bilateral filter sigma in coordinate space
TonemapReinhardDevlin
--------
---------------------------
.. ocv:class:: TonemapReinhardDevlin : public Tonemap
"Dynamic Range Reduction Inspired by Photoreceptor Physiology", Reinhard, Devlin, 2005
This is a global tonemapping operator that models human visual system.
Mapping function is controlled by adaptation parameter, that is computed using light adaptation and color adaptation.
:param gamma: gamma value for gamma correction. See :ocv:func:`createTonemap`
:param intensity: result intensity. Range in [-8, 8] range
:param intensity: result intensity in [-8, 8] range. Greater intensity produces brighter results.
:param light_adapt: light adaptation in [0, 1] range. If 1 adaptation is based on pixel value, if 0 it's global
:param light_adapt: light adaptation in [0, 1] range. If 1 adaptation is based only on pixel value, if 0 it's global, otherwise it's a weighted mean of this two cases.
: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
This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid, transforms contrast values to HVS response and scales the response.
After this the image is reconstructed from new contrast values.
:param gamma: gamma value for gamma correction. See :ocv:func:`createTonemap`
:param scale: contrast scale factor
:param scale: contrast scale factor. HVS response is multiplied by this parameter, thus compressing dynamic range. Values from 0.6 to 0.9 produce best results.
:param saturation: saturation enhancement value
:param saturation: saturation enhancement value. See :ocv:func:`createTonemapDrago`
ExposureAlign
-------------
---------------------------
.. ocv:class:: ExposureAlign : public Algorithm
The base class for algorithms that align images of the same scene with different exposures
:param response: matrix with camera response, one column per channel
AlignMTB
--------
---------------------------
.. ocv:class:: AlignMTB : public ExposureAlign
"Fast, Robust Image Registration for Compositing High Dynamic Range Photographs from Handheld Exposures", Ward, 2003
This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations.
This algorithm does not use exposure values and camera response, new image regions are filled with zeros.
It is invariant to exposure, so exposure values and camera response are not necessary.
In this implementation new image regions are filled with zeros.
For more information see [GW03]_.
AlignMTB::process
-----------------------
---------------------------
Short version of process, that doesn't take extra arguments.
:param max_bits: logarithm to the base 2 of maximal shift in each dimension
:param max_bits: logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are usually good enough (31 and 63 pixels shift respectively).
:param exclude_range: range for exclusion bitmap
:param exclude_range: range for exclusion bitmap that is constructed to suppress noise around the median value.
ExposureCalibrate
-------------
---------------------------
.. ocv:class:: ExposureCalibrate : public Algorithm
The base class for camera response calibration algorithms.
.. ocv:class:: MergeMertens : public ExposureMerge
"Exposure Fusion", Mertens et al., 2007
Pixels are weighted using contrast, saturation and well-exposedness measures, than images are combined using laplacian pyramids.
The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying by 255, but it's recommended to apply gamma correction and/or linear tonemapping.
The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying by 255.
For more information see [MK07]_.
MergeMertens::process
-----------------------
---------------------------
Short version of process, that doesn't take extra arguments.