<a id="easyimage-hdr-fusion"></a>

# HDR Fusion

When acquiring images using conventional sensors, all details of the scene may not be visible with a single exposure.

This can happen, for example, when some parts of the image are strongly illuminated while others are in the shadows.

![image](assets/images/easyimage/hdr_fusion_1.webp)

To capture different details, you should acquire multiple images using different exposure settings. Then, instead of processing each level of exposure separately, you can use the class [`EHDRFusion`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html) to fuse the different images into a single image that contains all the details exacerbated at each exposure level.

<a id="easyimage-hdr-fusion-process"></a>

## The HDR Fusion Process

The HDR fusion (High Dynamic Range) function performs 2 operations on the LDR (Low Dynamic Range) input images:

1. The merger operation creates an HDR image from the LDR input images. An HDR image is an image whose pixel values can exceed the typical displayable range found in monitors, printing machine, etc.
2. The tone-mapper function maps the values of the HDR image pixels into the 0-255 range. This creates a LDR image that you can process by conventional image processing methods.

There are three provided merger algorithms:

* `Debevec` ([`EDebevecMergerParameters`](../../../doxygen_cpp/classeVision_1_1EDebevecMergerParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EDebevecMergerParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EDebevecMergerParameters.html)) and `Robertson`([`ERobertsonMergerParameters`](../../../doxygen_cpp/classeVision_1_1ERobertsonMergerParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1ERobertsonMergerParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ERobertsonMergerParameters.html)) require the exposure time for each input image. The first time the method is called, they automatically perform a calibration to compute the camera response. Another calibration is triggered each time the number of images submitted is different or each time the dimension of the submitted image changes.
* `Mertens` ([`EMertensMergerParameters`](../../../doxygen_cpp/classeVision_1_1EMertensMergerParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EMertensMergerParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EMertensMergerParameters.html)) only requires the input images. It can be useful in some scenarios when the exposure times is unknown or when the number of images or the exposure times vary between the fuse operations.

There are four provided tone-mapper algorithms, each one exposes different parameters:

* `Linear` ([`ELinearToneMapperParameters`](../../../doxygen_cpp/classeVision_1_1ELinearToneMapperParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1ELinearToneMapperParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ELinearToneMapperParameters.html))
* `Reinhard` ([`EReinhardToneMapperParameters`](../../../doxygen_cpp/classeVision_1_1EReinhardToneMapperParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EReinhardToneMapperParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EReinhardToneMapperParameters.html))
* `Mantiuk` ([`EMantiukToneMapperParameters`](../../../doxygen_cpp/classeVision_1_1EMantiukToneMapperParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EMantiukToneMapperParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EMantiukToneMapperParameters.html))
* `Drago` ([`EDragoToneMapperParameters`](../../../doxygen_cpp/classeVision_1_1EDragoToneMapperParameters.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EDragoToneMapperParameters.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EDragoToneMapperParameters.html))

#### HINT
Use the HDR sample to determine the algorithm and the parameter values that best suit your set of images.

<a id="easyimage-hdr-fusion-default-parameters"></a>

### The Default Parameters

* By default, the class [`EHDRFusion`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html) uses the `Mertens` merger ([`EHDRFusion::GetMertensMergerParameters`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html#a1f0fee9e2bc4534897696177330ae72d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html#a2c2e4513a946c8e3d903d57561532ce7) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html#a14a98412350ed3a12682e268933db62b)) and `Linear` ([`EHDRFusion::GetLinearToneMapperParameters`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html#a313938f7cc65b009998817f665e8ad50) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html#a75e598da1ac1fb72a4f20be040fc626e) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html#acd6df7a11c84bcfce5859f51180322e9)) tone-mapper.
* Use [`EHDRFusion::SetToneMapperType`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html#a1868184c958b0257a685a42194ff2152) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html#afcf56c53c7aad75347a6c5d7442779da) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html#aa6723b6992cbc36efd989e03d0ebbfdd) and [`EHDRFusion::SetMergerType`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html#a622afdcb1b4afa4aebded57ece75b35a) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html#a8f6486f79296040de5ee8a620e70c4b9) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html#a33fb4d6b0d0a21d1a51e9d2e01154e8c) to change these settings.
* Use the corresponding setters to adjust the parameters (such as [`EHDRFusion::SetMertensMergerParameters`](../../../doxygen_cpp/classeVision_1_1EHDRFusion.html#a7f8cfd2f6ed7e0c2085fcc1268f60294) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EHDRFusion.html#a2c2e4513a946c8e3d903d57561532ce7) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EHDRFusion.html#a14a98412350ed3a12682e268933db62b) if the current merger is `Mertens`).

![image](assets/images/whats_new/rn2410_easyimage_hdr.webp)

<a id="easyimage-hdr-fusion-quick-links"></a>

## See Also

Easy to understand, ready to copy code snippets.
