HDR imaging

Overview

This section describes high dynamic range imaging algorithms namely tonemapping, exposure alignment, camera calibration with multiple exposures and exposure fusion. More…

// enums

enum
{
    cv::@173::LDR_SIZE = 256,
};

// classes

class cv::AlignExposures;
class cv::AlignMTB;
class cv::CalibrateCRF;
class cv::CalibrateDebevec;
class cv::CalibrateRobertson;
class cv::MergeDebevec;
class cv::MergeExposures;
class cv::MergeMertens;
class cv::MergeRobertson;
class cv::Tonemap;
class cv::TonemapDrago;
class cv::TonemapDurand;
class cv::TonemapMantiuk;
class cv::TonemapReinhard;

// global functions

Ptr<AlignMTB>
cv::createAlignMTB(
    int max_bits = 6,
    int exclude_range = 4,
    bool cut = true
    );

Ptr<CalibrateDebevec>
cv::createCalibrateDebevec(
    int samples = 70,
    float lambda = 10.0f,
    bool random = false
    );

Ptr<CalibrateRobertson>
cv::createCalibrateRobertson(
    int max_iter = 30,
    float threshold = 0.01f
    );

Ptr<MergeDebevec>
cv::createMergeDebevec();

Ptr<MergeMertens>
cv::createMergeMertens(
    float contrast_weight = 1.0f,
    float saturation_weight = 1.0f,
    float exposure_weight = 0.0f
    );

Ptr<MergeRobertson>
cv::createMergeRobertson();

Ptr<Tonemap>
cv::createTonemap(float gamma = 1.0f);

Ptr<TonemapDrago>
cv::createTonemapDrago(
    float gamma = 1.0f,
    float saturation = 1.0f,
    float bias = 0.85f
    );

Ptr<TonemapDurand>
cv::createTonemapDurand(
    float gamma = 1.0f,
    float contrast = 4.0f,
    float saturation = 1.0f,
    float sigma_space = 2.0f,
    float sigma_color = 2.0f
    );

Ptr<TonemapMantiuk>
cv::createTonemapMantiuk(
    float gamma = 1.0f,
    float scale = 0.7f,
    float saturation = 1.0f
    );

Ptr<TonemapReinhard>
cv::createTonemapReinhard(
    float gamma = 1.0f,
    float intensity = 0.0f,
    float light_adapt = 1.0f,
    float color_adapt = 0.0f
    );

Detailed Documentation

This section describes high dynamic range imaging algorithms namely tonemapping, exposure alignment, camera calibration with multiple exposures and exposure fusion.

Global Functions

Ptr<AlignMTB>
cv::createAlignMTB(
    int max_bits = 6,
    int exclude_range = 4,
    bool cut = true
    )

Creates AlignMTB object.

Parameters:

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).
exclude_range range for exclusion bitmap that is constructed to suppress noise around the median value.
cut if true cuts images, otherwise fills the new regions with zeros.
Ptr<CalibrateDebevec>
cv::createCalibrateDebevec(
    int samples = 70,
    float lambda = 10.0f,
    bool random = false
    )

Creates CalibrateDebevec object.

Parameters:

samples number of pixel locations to use
lambda smoothness term weight. Greater values produce smoother results, but can alter the response.
random if true sample pixel locations are chosen at random, otherwise they form a rectangular grid.
Ptr<CalibrateRobertson>
cv::createCalibrateRobertson(
    int max_iter = 30,
    float threshold = 0.01f
    )

Creates CalibrateRobertson object.

Parameters:

max_iter maximal number of Gauss-Seidel solver iterations.
threshold target difference between results of two successive steps of the minimization.
Ptr<MergeDebevec>
cv::createMergeDebevec()

Creates MergeDebevec object.

Ptr<MergeMertens>
cv::createMergeMertens(
    float contrast_weight = 1.0f,
    float saturation_weight = 1.0f,
    float exposure_weight = 0.0f
    )

Creates MergeMertens object.

Parameters:

contrast_weight contrast measure weight. See MergeMertens.
saturation_weight saturation measure weight
exposure_weight well-exposedness measure weight
Ptr<MergeRobertson>
cv::createMergeRobertson()

Creates MergeRobertson object.

Ptr<Tonemap>
cv::createTonemap(float gamma = 1.0f)

Creates simple linear mapper with gamma correction.

Parameters:

gamma positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma equal to 2.2f is suitable for most displays. Generally gamma > 1 brightens the image and gamma < 1 darkens it.
Ptr<TonemapDrago>
cv::createTonemapDrago(
    float gamma = 1.0f,
    float saturation = 1.0f,
    float bias = 0.85f
    )

Creates TonemapDrago object.

Parameters:

gamma gamma value for gamma correction. See createTonemap
saturation positive saturation enhancement value. 1.0 preserves saturation, values greater than 1 increase saturation and values less than 1 decrease it.
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.
Ptr<TonemapDurand>
cv::createTonemapDurand(
    float gamma = 1.0f,
    float contrast = 4.0f,
    float saturation = 1.0f,
    float sigma_space = 2.0f,
    float sigma_color = 2.0f
    )

Creates TonemapDurand object.

Parameters:

gamma gamma value for gamma correction. See createTonemap
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.
saturation saturation enhancement value. See createTonemapDrago
sigma_space bilateral filter sigma in color space
sigma_color bilateral filter sigma in coordinate space
Ptr<TonemapMantiuk>
cv::createTonemapMantiuk(
    float gamma = 1.0f,
    float scale = 0.7f,
    float saturation = 1.0f
    )

Creates TonemapMantiuk object.

Parameters:

gamma gamma value for gamma correction. See createTonemap
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.
saturation saturation enhancement value. See createTonemapDrago
Ptr<TonemapReinhard>
cv::createTonemapReinhard(
    float gamma = 1.0f,
    float intensity = 0.0f,
    float light_adapt = 1.0f,
    float color_adapt = 0.0f
    )

Creates TonemapReinhard object.

Parameters:

gamma gamma value for gamma correction. See createTonemap
intensity result intensity in [-8, 8] range. Greater intensity produces brighter results.
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.
color_adapt chromatic adaptation in [0, 1] range. If 1 channels are treated independently, if 0 adaptation level is the same for each channel.