18 #ifndef PIC_ALGORITHMS_HDR_MERGER_HPP 19 #define PIC_ALGORITHMS_HDR_MERGER_HPP 24 #include "../base.hpp" 25 #include "../util/vec.hpp" 26 #include "../algorithms.hpp" 27 #include "../algorithms/camera_response_function.hpp" 28 #include "../features_matching/ward_alignment.hpp" 29 #include "../filtering/filter_assemble_hdr.hpp" 55 int n = int(stack.size());
57 for(
int i = 0; i < (n - 1); i++) {
62 int n2 = int(s_vec.size());
63 for(
int i = 0; i < (n2 - 1); i++) {
66 for(
int j = (i + 1); j < n2; j++) {
121 void addFile(std::string file_name,
float exposure_time = -1.0f)
139 for(
int i = 0; i < n; i++) {
142 stack.push_back(img);
143 bValid = bValid && img->
isValid();
160 std::vector<Vec2i> shifts;
163 stack_aligned.push_back(stack[n - 1]);
165 for(
int i = 0; i < int(shifts.size()); i++) {
166 auto s_i = shifts[i];
167 if(s_i[0] == 0 && s_i[1] == 0) {
168 stack_aligned.push_back(stack[i]);
171 stack_aligned.push_back(tmp_i);
172 stack_aligned_track.push_back(tmp_i);
static Vec2i execute(Image *imgTarget, Image *imgSource)
Definition: ward_alignment.hpp:266
void addFile(std::string file_name, float exposure_time=-1.0f)
addFile
Definition: hdr_merger.hpp:121
CRF_WEIGHT weight
Definition: hdr_merger.hpp:42
HDR_REC_DOMAIN
The HDR_REC_DOMAIN enum HRD_LOG: assembling HDR image in the log-domain.
Definition: filter_assemble_hdr.hpp:38
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
void release()
release
Definition: hdr_merger.hpp:96
void update(CRF_WEIGHT weight, HDR_REC_DOMAIN domain, HDRAlign hdra, CameraResponseFunction *crf=NULL)
update
Definition: hdr_merger.hpp:106
FilterAssembleHDR merger
Definition: hdr_merger.hpp:39
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
Definition: hdr_merger.hpp:33
Definition: hdr_merger.hpp:35
std::vector< std::string > file_name_vec
Definition: hdr_merger.hpp:45
~HDRMerger()
Definition: hdr_merger.hpp:88
Image * execute(Image *imgOut=NULL)
execute
Definition: hdr_merger.hpp:132
void DebevecMalik(ImageVec stack, CRF_WEIGHT type=CW_DEB97, int nSamples=256, float lambda=20.0f)
DebevecMalik computes the CRF of a camera using multiple exposures value following Debevec and Malik ...
Definition: camera_response_function.hpp:392
HDRAlign hdra
Definition: hdr_merger.hpp:40
CameraResponseFunction * crf
Definition: hdr_merger.hpp:38
The FilterAssembleHDR class.
Definition: filter_assemble_hdr.hpp:43
void update(CameraResponseFunction *crf, CRF_WEIGHT weight_type=CW_DEB97, HDR_REC_DOMAIN domain=HRD_LOG)
update
Definition: filter_assemble_hdr.hpp:177
Definition: filter_assemble_hdr.hpp:38
Definition: hdr_merger.hpp:33
Definition: dynamic_range.hpp:29
The CameraResponseFunction class.
Definition: camera_response_function.hpp:48
Definition: weight_function.hpp:28
PIC_INLINE void ImaveVecSortByExposureTime(ImageVec &stack)
ImaveVecSortByExposureTime.
Definition: image_vec.hpp:96
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Definition: bilateral_separation.hpp:25
std::vector< float > exposure_time_vec
Definition: hdr_merger.hpp:46
bool isValid()
isValid checks if the current image is valid, which means if they have an allocated buffer or not...
HDRAlign
Definition: hdr_merger.hpp:33
bool Read(std::string nameFile, LDR_type typeLoad)
Read opens an Image from a file on the disk.
HDR_REC_DOMAIN domain
Definition: hdr_merger.hpp:43
static Image * shiftImage(Image *img, Vec2i shift, Image *ret=NULL)
Definition: ward_alignment.hpp:284
HDRMerger()
HDRMerger.
Definition: hdr_merger.hpp:79
Definition: hdr_merger.hpp:33
The Vec class.
Definition: vec.hpp:35
CRF_WEIGHT
The CRF_WEIGHT enum.
Definition: weight_function.hpp:28
void incrementalAlignment(ImageVec &stack, std::vector< Vec2i > &s_vec)
incrementalAlignment
Definition: hdr_merger.hpp:53
void stdVectorClear(std::vector< T *> &vec)
stdVectorClear
Definition: std_util.hpp:50