18 #ifndef PIC_TONE_MAPPING_EXPOSURE_FUSION_HPP 19 #define PIC_TONE_MAPPING_EXPOSURE_FUSION_HPP 21 #include "../base.hpp" 22 #include "../util/std_util.hpp" 23 #include "../util/array.hpp" 24 #include "../colors/saturation.hpp" 25 #include "../filtering/filter_luminance.hpp" 26 #include "../filtering/filter_laplacian.hpp" 27 #include "../filtering/filter_exposure_fusion_weights.hpp" 29 #include "../algorithms/pyramid.hpp" 31 #include "../tone_mapping/get_all_exposures.hpp" 32 #include "../tone_mapping/tone_mapping_operator.hpp" 65 if(imgIn.size() > 1) {
72 stdVectorClear<Image>(stack);
86 auto n = imgIn.
size();
94 int width = imgIn[0]->width;
95 int height = imgIn[0]->height;
105 for(
auto j = 0; j < n; j++) {
117 pW =
new Pyramid(width, height, 1,
false, limitLevel);
118 pI =
new Pyramid(width, height, channels,
true, limitLevel);
119 pOut =
new Pyramid(width, height, channels,
true, limitLevel);
123 for(
auto j = 0; j < n; j++) {
140 float *minVal = imgOut->
getMinVal(NULL, NULL);
141 float *maxVal = imgOut->
getMaxVal(NULL, NULL);
147 *imgOut /= (maxV- minV);
180 setToANullVector<Image>(
images, 3);
196 void update(
float wC = 1.0f,
float wE = 1.0f,
223 return ef.
Process(imgIn, imgOut);
PIC_INLINE bool ImageVecCheck(ImageVec &imgIn, int minInputImages)
ImageVecCheck.
Definition: image_vec.hpp:147
static T getMax(T *data, int size, int &ind)
getMax
Definition: array.hpp:516
int size() const
size computes the number of values.
Definition: image.hpp:481
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: filter_radial_basis_function.hpp:29
Image * Process(ImageVec imgIn, Image *imgOut=NULL)
Process.
Definition: tone_mapping_operator.hpp:120
void add(const Pyramid *pyr)
add is the add operator ( += ) between pyramids.
Definition: pyramid.hpp:368
int channels
Definition: image.hpp:80
T * delete_s(T *data)
delete_s
Definition: std_util.hpp:123
Definition: filter_luminance.hpp:28
void update(LUMINANCE_TYPE type=LT_CIE_LUMINANCE)
update
Definition: filter_luminance.hpp:135
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
void setValue(float value)
SetValue.
Definition: pyramid.hpp:350
ImageVec images
Definition: tone_mapping_operator.hpp:35
void update(float wC=1.0f, float wE=1.0f, float wS=1.0f)
update
Definition: filter_exposure_fusion_weights.hpp:99
FilterLuminance flt_lum
Definition: exposure_fusion.hpp:42
The ToneMappingOperator class.
Definition: tone_mapping_operator.hpp:31
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
The FilterLuminance class.
Definition: filter_luminance.hpp:33
Image * ProcessAux(ImageVec imgIn, Image *imgOut)
ProcessAux.
Definition: exposure_fusion.hpp:63
float * getMinVal(BBox *box, float *ret)
getMinVal computes the minimum value for the current Image.
ExposureFusion(float wC=1.0f, float wE=1.0f, float wS=1.0f)
ExposureFusion.
Definition: exposure_fusion.hpp:172
The ExposureFusion class.
Definition: exposure_fusion.hpp:39
void updateImage(Image *imgIn)
updateImage
Definition: tone_mapping_operator.hpp:78
Pyramid * pOut
Definition: exposure_fusion.hpp:45
~ExposureFusion()
Definition: exposure_fusion.hpp:185
void release()
release
Definition: tone_mapping_operator.hpp:68
Image * ProcessAuxStack(ImageVec imgIn, Image *imgOut)
ProcessAuxStack.
Definition: exposure_fusion.hpp:84
PIC_INLINE ImageVec Double(Image *img1, Image *img2)
Double creates an std::vector which contains img1 and img2; this is for filters input.
Definition: image_vec.hpp:49
void releaseAux()
releaseAux
Definition: exposure_fusion.hpp:157
Pyramid * pW
Definition: exposure_fusion.hpp:45
void update(Image *img)
update recomputes the pyramid given a compatible image, img.
Definition: pyramid.hpp:280
The FilterExposureFusionWeights class.
Definition: filter_exposure_fusion_weights.hpp:30
Image * reconstruct(Image *imgOut)
reconstruct evaluates a Gaussian/Laplacian pyramid.
Definition: pyramid.hpp:320
static float removeNegative(float x)
removeNegative
Definition: exposure_fusion.hpp:52
static T getMin(T *data, int size, int &ind)
getMin
Definition: array.hpp:542
void applyFunction(float(*func)(float))
applyFunction is an operator that applies an input function to all values in data.
The Image class stores an image as buffer of float.
Definition: image.hpp:60
PIC_INLINE ImageVec getAllExposuresImages(Image *imgIn, std::vector< float > &fstops, float gamma=2.2f)
getAllExposuresImages converts an image into a stack of images.
Definition: get_all_exposures.hpp:144
static Image * execute(Image *imgIn, Image *imgOut)
execute
Definition: exposure_fusion.hpp:208
The Pyramid class.
Definition: pyramid.hpp:36
FilterExposureFusionWeights flt_weights
Definition: exposure_fusion.hpp:43
void update(float wC=1.0f, float wE=1.0f, float wS=1.0f)
update
Definition: exposure_fusion.hpp:196
static Image * executeStack(ImageVec imgIn, Image *imgOut)
executeStack
Definition: exposure_fusion.hpp:220
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
Definition: bilateral_separation.hpp:25
void mul(const Pyramid *pyr)
mul is the mul operator ( *= ) between pyramids.
Definition: pyramid.hpp:357
#define MAX(a, b)
Definition: math.hpp:73
float * getMaxVal(BBox *box, float *ret)
getMaxVal computes the maximum value for the current Image.
Pyramid * pI
Definition: exposure_fusion.hpp:45