18 #ifndef PIC_FILTERING_FILTER_LUMINANCE_ADAPTATION_HPP 19 #define PIC_FILTERING_FILTER_LUMINANCE_ADAPTATION_HPP 23 #include "../util/math.hpp" 24 #include "../filtering/filter.hpp" 25 #include "../filtering/filter_luminance.hpp" 26 #include "../algorithms/connected_components.hpp" 82 width = imgIn[0]->width;
83 height = imgIn[0]->height;
85 frames = imgIn[0]->frames;
112 int n = imgIn[0]->width * imgIn[0]->height;
113 int *category =
new int[n];
114 unsigned int *img_labels = NULL;
118 float maxLayer_m_1 = float(
maxLayers - 1);
123 #pragma omp parallel for 124 for(
int j = 0; j < n; j++) {
125 category[j] = int(
lround((
lum->
data[j] - lum_min) / bin_size));
131 std::vector<LabelOutput> labelsList;
132 img_labels = cc_int.
execute(category, imgIn[0]->width, imgIn[0]->height, img_labels, labelsList);
138 for(
unsigned int j_ui = 0; j_ui < labelsList.size(); j_ui++) {
int maxLayers
Definition: filter_luminance_adaptation.hpp:40
float * data
data is the main buffer where pixel values are stored.
Definition: image.hpp:91
float bin_size_2
Definition: filter_luminance_adaptation.hpp:38
void setZero()
setZero sets data to 0.0f.
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
PIC_INLINE long lround(double x)
lround rounds double numbers properly.
Definition: math.hpp:229
Image * Process(ImageVec imgIn, Image *imgOut)
Filter::Process.
Definition: filter_luminance_adaptation.hpp:94
FilterLuminance flt
Definition: filter_luminance_adaptation.hpp:41
The Filter class.
Definition: filter.hpp:50
PIC_INLINE float log10fPlusEpsilon(float x)
log10fPlusEpsilon
Definition: math.hpp:355
Image * lum
Definition: filter_luminance_adaptation.hpp:42
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
The FilterLuminance class.
Definition: filter_luminance.hpp:33
static void mergeIsolatedAreasWithThreshold(uint *labels, int width, int height, std::vector< LabelOutput > &labelsList, int threshold=1)
mergeIsolatedAreasWithThreshold
Definition: connected_components.hpp:577
float * getMinVal(BBox *box, float *ret)
getMinVal computes the minimum value for the current Image.
void update(int maxLayers=32, float threshold=0.05f)
update
Definition: filter_luminance_adaptation.hpp:62
The FilterLuminanceAdaptation class.
Definition: filter_luminance_adaptation.hpp:33
float threshold
Definition: filter_luminance_adaptation.hpp:36
float delta_bin_size
Definition: filter_luminance_adaptation.hpp:39
static uint * reCount(uint *imgLabel, std::vector< LabelOutput > &labelsList)
reCount
Definition: connected_components.hpp:394
FilterLuminanceAdaptation(int maxLayers=32, float threshold=0.05f)
FilterLuminanceAdaptation.
Definition: filter_luminance_adaptation.hpp:51
PIC_INLINE float powf10fMinusEpsilon(float x)
powf10fMinusEpsilon
Definition: math.hpp:365
void applyFunction(float(*func)(float))
applyFunction is an operator that applies an input function to all values in data.
float bin_size_1
Definition: filter_luminance_adaptation.hpp:37
The Image class stores an image as buffer of float.
Definition: image.hpp:60
static void add(T *data, IntCoord &coord, T val)
add is the additive operator.
Definition: indexed_array.hpp:284
virtual void f(FilterFData *data)
f
Definition: filter_radial_basis_function.hpp:69
Definition: bilateral_separation.hpp:25
void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_luminance_adaptation.hpp:80
virtual Image * setupAux(ImageVec imgIn, Image *imgOut)
setupAux
Definition: filter.hpp:288
uint * execute(Image *imgIn, uint *imgOut, std::vector< LabelOutput > &ret)
execute
Definition: connected_components.hpp:253
int width
Definition: image.hpp:80
bool checkInput(ImageVec &imgIn)
checkInput
Definition: filter.hpp:385
int height
Definition: image.hpp:80
Definition: connected_components.hpp:78
static T mean(T *data, IntCoord &coord)
mean computes the mean value.
Definition: indexed_array.hpp:112