18 #ifndef PIC_GL_TONE_MAPPING_EXPOSURE_FUSION_TMO_HPP 19 #define PIC_GL_TONE_MAPPING_EXPOSURE_FUSION_TMO_HPP 21 #include "../../util/math.hpp" 23 #include "../../util/std_util.hpp" 25 #include "../../gl/tone_mapping/get_all_exposures.hpp" 27 #include "../../gl/algorithms/pyramid.hpp" 28 #include "../../gl/filtering/filter_luminance.hpp" 29 #include "../../gl/filtering/filter_exposure_fusion_weights.hpp" 30 #include "../../gl/filtering/filter_op.hpp" 101 stdVectorClear<ImageGL>(
images);
102 stdVectorClear<PyramidGL>(
pyramids);
103 stdVectorClear<FilterGL>(
filters);
127 int width = imgIn[0]->width;
128 int height = imgIn[0]->height;
129 int channels = imgIn[0]->channels;
140 pW =
new PyramidGL(width, height, 1,
false, limitLevel);
141 pI =
new PyramidGL(width, height, channels,
true, limitLevel);
142 pOut =
new PyramidGL(width, height, channels,
true, limitLevel);
152 if(!
pOut->
stack[0]->isSimilarType(imgIn[0])) {
155 stdVectorClear<ImageGL>(
images);
156 stdVectorClear<PyramidGL>(
pyramids);
175 stdVectorClear<ImageGL>(img_vec);
188 auto n = imgIn.
size();
198 for(
auto j = 0; j < n; j++) {
208 for(
auto j = 0; j < n; j++) {
226 float *maxVal = imgOut->getMaxVal(NULL);
232 *imgOut /= (maxV - minV);
ImageGL * lum
Definition: exposure_fusion.hpp:48
static T getMax(T *data, int size, int &ind)
getMax
Definition: array.hpp:516
Definition: filter_luminance.hpp:28
PIC_INLINE ImageGLVec getAllExposuresImagesGL(ImageGL *imgIn, float gamma=2.2f)
getAllExposuresImagesGL converts an HDR image into a stack of LDR images
Definition: get_all_exposures.hpp:34
void update(ImageGL *img)
update
The PyramidGL class.
Definition: pyramid.hpp:35
bool bAllocate
Definition: exposure_fusion.hpp:55
PyramidGL * pI
Definition: exposure_fusion.hpp:50
void mul(const PyramidGL *pyr)
mul
bool bDelete
Definition: display.hpp:54
ImageGL * acc
Definition: exposure_fusion.hpp:48
PIC_INLINE ImageGLVec SingleGL(ImageGL *img)
SingleGL creates a single for filters input.
Definition: image_vec.hpp:39
PyramidGL * pW
Definition: exposure_fusion.hpp:50
Definition: filter_op.hpp:28
ImageGL * weights
Definition: exposure_fusion.hpp:48
void update(LUMINANCE_TYPE type)
update
FilterGLOp * removeNegative
Definition: exposure_fusion.hpp:46
The ImageGL class.
Definition: image.hpp:42
float wC
Definition: exposure_fusion.hpp:52
float * getMinVal(float *ret=NULL)
getMinVal
Definition: image.hpp:431
void setValue(float value)
setValue
The FilterGLExposureFusionWeights class.
Definition: filter_exposure_fusion_weights.hpp:30
int size() const
size computes the number of values.
Definition: filter_radial_basis_function.hpp:481
void allocateFilters()
allocateFilters
Definition: exposure_fusion.hpp:60
ImageGLVec images
Definition: exposure_fusion.hpp:42
void add(const PyramidGL *pyr)
add
virtual ImageGL * Process(ImageGLVec imgIn, ImageGL *imgOut)
Process.
Definition: display.hpp:258
ExposureFusionGL(float wC=1.0f, float wE=1.0f, float wS=1.0f)
ExposureFusionGL.
Definition: exposure_fusion.hpp:83
bool bAllocatedFilters
Definition: exposure_fusion.hpp:54
void allocate(ImageGLVec imgIn)
allocate
Definition: exposure_fusion.hpp:123
void update(float wC=1.0f, float wE=1.0f, float wS=1.0f)
update
Definition: exposure_fusion.hpp:112
~ExposureFusionGL()
Definition: exposure_fusion.hpp:99
ImageGL * Process(ImageGL *imgIn, ImageGL *imgOut)
Process.
Definition: exposure_fusion.hpp:169
ImageGLVec stack
Definition: pyramid.hpp:78
FilterGLExposureFusionWeights * flt_weights
Definition: exposure_fusion.hpp:45
static T getMin(T *data, int size, int &ind)
getMin
Definition: array.hpp:542
FilterGLLuminance * flt_lum
Definition: exposure_fusion.hpp:44
#define CLAMPi(x, a, b)
Definition: math.hpp:81
The ExposureFusionGL class.
Definition: exposure_fusion.hpp:37
PIC_INLINE ImageGLVec DoubleGL(ImageGL *img1, ImageGL *img2)
DoubleGL creates a couple for filters input.
Definition: image_vec.hpp:52
Definition: bilateral_separation.hpp:25
PyramidGL * pOut
Definition: exposure_fusion.hpp:50
The FilterGLLuminance class.
Definition: filter_luminance.hpp:30
std::vector< PyramidGL * > pyramids
Definition: exposure_fusion.hpp:41
ImageGL * ProcessStack(ImageGLVec imgIn, ImageGL *imgOut=NULL)
ProcessStack.
Definition: exposure_fusion.hpp:186
std::vector< ImageGL * > ImageGLVec
ImageGLVec an std::vector of pic::ImageGL.
Definition: display.hpp:32
float wS
Definition: exposure_fusion.hpp:52
ImageGL * reconstruct(ImageGL *imgOut)
reconstruct
std::vector< FilterGL * > filters
Definition: exposure_fusion.hpp:40
float wE
Definition: exposure_fusion.hpp:52
std::vector< ImageGL * > ImageGLVec
ImageGLVec an std::vector of pic::ImageGL.
Definition: image_vec.hpp:32