18 #ifndef PIC_FILTERING_FILTER_CLAHE_HPP 19 #define PIC_FILTERING_FILTER_CLAHE_HPP 21 #include "../base.hpp" 22 #include "../histogram.hpp" 23 #include "../filtering/filter.hpp" 49 int channels = src[0]->channels;
51 for(
int j = box->
y0; j < box->y1; j++) {
52 for(
int i = box->
x0; i < box->x1; i++) {
53 float *in = (*src[0]) (i, j);
54 float *out = (*dst) (i, j);
58 for(
int ch = 0; ch < channels; ch++) {
64 int ind_source = hist.
project(in[ch]);
66 float x = c_s[ind_source];
67 float *ptr = std::upper_bound(c_t, c_t +
nBin, x);
68 int ind_target =
MAX((
int)(ptr - c_t), 0);
96 this->value =
MAX(area /
nBin, 1);
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
unsigned int uint
Definition: base.hpp:23
int checkHalfSize(int size)
checkHalfSize
Definition: filter_radial_basis_function.hpp:168
float * cumulativef(bool bNormalized)
cumulativef computes the cumulative Histogram.
Definition: histogram.hpp:440
void calculate(Image *imgIn, VALUE_SPACE type=VS_LIN, int nBin=256, BBox *box=NULL, int channel=0)
calculate computes the histogram of an input image. In the case of LDR images, they are ssumed to be ...
Definition: histogram.hpp:213
int halfSize
Definition: filter_clahe.hpp:33
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
The Histogram class is a class for creating, managing, loading, and saving histogram for an Image...
Definition: histogram.hpp:37
int x0
Definition: bbox.hpp:32
static Image * execute(Image *imgIn, Image *imgOut, int size)
execute
Definition: filter_clahe.hpp:106
The Filter class.
Definition: filter.hpp:50
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
float getfMin()
getfMin
Definition: histogram.hpp:468
int y0
Definition: bbox.hpp:32
FilerCLAHE(int size)
FilerCLAHE.
Definition: filter_clahe.hpp:81
int project(float x)
project converts an input value in the histogram domain.
Definition: histogram.hpp:337
uint value
Definition: filter_clahe.hpp:34
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_clahe.hpp:42
Definition: histogram.hpp:31
float unproject(int ind)
unproject converts a histogram value back to its original domain.
Definition: histogram.hpp:352
The FilerCLAHE class.
Definition: filter_clahe.hpp:30
float getfMax()
getfMax
Definition: histogram.hpp:478
The Image class stores an image as buffer of float.
Definition: image.hpp:60
virtual void f(FilterFData *data)
f
Definition: filter_radial_basis_function.hpp:69
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 update(int size)
update
Definition: filter_clahe.hpp:90
#define MAX(a, b)
Definition: math.hpp:73
void uniform(float fMin, float fMax, uint value, VALUE_SPACE type, int nBin)
uniform
Definition: histogram.hpp:298
void update(float x)
update
Definition: histogram.hpp:115
int nBin
Definition: filter_clahe.hpp:33