EasyHDRFusion¶
Support |
|
|---|---|
Required licenses |
EasyImage |
Recommended images |
Any image from the folder |
Location |
|
Purpose¶
This sample program demonstrates how to:
Perform an HDR Fusion on a specific set of images.
The process steps are:
Load a set of color images.
(Optionally) Set the related exposure time for each image.
(Optionally) Set an alternative merger algorithm or an alternative tone-mapper algorithm.
Perform the HDR Fusion.
Code highlights¶
Perform the HDR Fusion from a set of images.
std::vector<EImageC24> imgs; // previously loaded, all images have the same size std::vector<float> exposureTimes; // previously loaded EImageC24 output(imgs.back()); // its dimension must previously set, same size as the input images EHDRFusion fusion; // by default, the fuser uses a merger that uses the Mertens algorithm, and a linear tone-mapper
Set the related exposure time for each image.
Attention
If a merger that is not of type Mertens or a tone-mapper is used, the related exposure time but be set for each image:
```c++
std::vector<float> times = {
1.0f / 0.03125f,
1.0f / 0.0625f,
1.0f / 0.125f, 1.0f / 0.25f,
1.0f / 0.5f, 1.0f / 1.0f,
1.0f / 2.0f,
1.0f / 4.0f,
1.0f / 8.0f,
1.0f / 16.0f,
1.0f / 32.0f,
1.0f / 64.0f,
1.0f / 128.0f,
1.0f / 256.0f,
1.0f / 512.0f,
1.0f / 1024.0f}; // must have the same number of elements as the input `imgs`
```
Set an alternative merger algorithm or an alternative tone-mapper algorithm.
The type of merger or tone-mapper can be set at the creation of the creation of the HDRFusion object:
```c++
EDebevecMergerParameters mergerParams; // can also be ERobertsonMergerParameters or EMertensMergerParameters
EReinhardToneMapperParameters toneMapperParams; // can also be EDragoToneMapperParameters or ELinearToneMapperParameters or EMantiukToneMapperParameters
EHDRFusion fusion(mergerParams, toneMapperParams);
```
Perform the HDR Fusion.
EImageC24 output; fusion.Fuse(imgs, output); // if using Mertens merger algorithm // OR fusion.Fuse(imgs, output, times); // if not using Mertens merger algorithm